From 7c0e2af0535b7980df80cfd498458b190209d8ef Mon Sep 17 00:00:00 2001 From: Andrei Vereha Date: Wed, 3 Mar 2021 14:24:23 +0100 Subject: [PATCH] dash: rename EAP AKA to SessionEstablisher --- .../omnipod/dash/driver/comm/OmnipodDashBleManagerImpl.kt | 4 ++-- .../session/{EapAkaExchanger.kt => SessionEstablisher.kt} | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) rename omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/{EapAkaExchanger.kt => SessionEstablisher.kt} (92%) diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashBleManagerImpl.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashBleManagerImpl.kt index a3b14a7d74..aa87822628 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashBleManagerImpl.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashBleManagerImpl.kt @@ -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.pair.LTKExchanger 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.event.PodEvent 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) - val eapAkaExchanger = EapAkaExchanger(aapsLogger, msgIO, ltk) + val eapAkaExchanger = SessionEstablisher(aapsLogger, msgIO, ltk) val sessionKeys = eapAkaExchanger.negotiateSessionKeys() aapsLogger.info(LTag.PUMPCOMM, "CK: ${sessionKeys.ck.toHex()}") aapsLogger.info(LTag.PUMPCOMM, "noncePrefix: ${sessionKeys.noncePrefix.toHex()}") diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/EapAkaExchanger.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/SessionEstablisher.kt similarity index 92% rename from omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/EapAkaExchanger.kt rename to omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/SessionEstablisher.kt index 3fb645f5f3..92f9e47d30 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/EapAkaExchanger.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/SessionEstablisher.kt @@ -13,7 +13,7 @@ import info.nightscout.androidaps.utils.extensions.toHex import org.spongycastle.util.encoders.Hex 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 @@ -32,13 +32,12 @@ class EapAkaExchanger(private val aapsLogger: AAPSLogger, private val msgIO: Mes fun negotiateSessionKeys(): SessionKeys { // 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() msgIO.sendMesssage(challenge) val challengeResponse = msgIO.receiveMessage() - processChallengeResponse(challengeResponse) - // TODO: what do we have to answer if challenge response does not validate? + processChallengeResponse(challengeResponse) //TODO: what do we have to answer if challenge response does not validate? seq++ var success = eapSuccess()