dash: rename EAP AKA to SessionEstablisher
This commit is contained in:
parent
b2797fa57f
commit
7c0e2af053
2 changed files with 5 additions and 6 deletions
|
@ -16,7 +16,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.io.Chara
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message.MessageIO
|
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message.MessageIO
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.pair.LTKExchanger
|
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.pair.LTKExchanger
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.scan.PodScanner
|
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.scan.PodScanner
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.session.EapAkaExchanger
|
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.session.SessionEstablisher
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.status.ConnectionStatus
|
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.status.ConnectionStatus
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.event.PodEvent
|
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.event.PodEvent
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.command.base.Command
|
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.command.base.Command
|
||||||
|
@ -134,7 +134,7 @@ class OmnipodDashBleManagerImpl @Inject constructor(
|
||||||
|
|
||||||
emitter.onNext(PodEvent.EstablishingSession)
|
emitter.onNext(PodEvent.EstablishingSession)
|
||||||
|
|
||||||
val eapAkaExchanger = EapAkaExchanger(aapsLogger, msgIO, ltk)
|
val eapAkaExchanger = SessionEstablisher(aapsLogger, msgIO, ltk)
|
||||||
val sessionKeys = eapAkaExchanger.negotiateSessionKeys()
|
val sessionKeys = eapAkaExchanger.negotiateSessionKeys()
|
||||||
aapsLogger.info(LTag.PUMPCOMM, "CK: ${sessionKeys.ck.toHex()}")
|
aapsLogger.info(LTag.PUMPCOMM, "CK: ${sessionKeys.ck.toHex()}")
|
||||||
aapsLogger.info(LTag.PUMPCOMM, "noncePrefix: ${sessionKeys.noncePrefix.toHex()}")
|
aapsLogger.info(LTag.PUMPCOMM, "noncePrefix: ${sessionKeys.noncePrefix.toHex()}")
|
||||||
|
|
|
@ -13,7 +13,7 @@ import info.nightscout.androidaps.utils.extensions.toHex
|
||||||
import org.spongycastle.util.encoders.Hex
|
import org.spongycastle.util.encoders.Hex
|
||||||
import java.security.SecureRandom
|
import java.security.SecureRandom
|
||||||
|
|
||||||
class EapAkaExchanger(private val aapsLogger: AAPSLogger, private val msgIO: MessageIO, private val ltk: PairResult) {
|
class SessionEstablisher(private val aapsLogger: AAPSLogger, private val msgIO: MessageIO, private val ltk: PairResult) {
|
||||||
|
|
||||||
var seq = ltk.seq
|
var seq = ltk.seq
|
||||||
|
|
||||||
|
@ -32,13 +32,12 @@ class EapAkaExchanger(private val aapsLogger: AAPSLogger, private val msgIO: Mes
|
||||||
|
|
||||||
fun negotiateSessionKeys(): SessionKeys {
|
fun negotiateSessionKeys(): SessionKeys {
|
||||||
// send EAP-AKA challenge
|
// send EAP-AKA challenge
|
||||||
seq++ // TODO: get from pod state. This only works for activating a new pod
|
seq++ //TODO: get from pod state. This only works for activating a new pod
|
||||||
var challenge = eapAkaChallenge()
|
var challenge = eapAkaChallenge()
|
||||||
msgIO.sendMesssage(challenge)
|
msgIO.sendMesssage(challenge)
|
||||||
|
|
||||||
val challengeResponse = msgIO.receiveMessage()
|
val challengeResponse = msgIO.receiveMessage()
|
||||||
processChallengeResponse(challengeResponse)
|
processChallengeResponse(challengeResponse) //TODO: what do we have to answer if challenge response does not validate?
|
||||||
// TODO: what do we have to answer if challenge response does not validate?
|
|
||||||
|
|
||||||
seq++
|
seq++
|
||||||
var success = eapSuccess()
|
var success = eapSuccess()
|
Loading…
Reference in a new issue