diff options
| author | 2023-09-05 22:44:50 +0000 | |
|---|---|---|
| committer | 2023-09-07 17:27:26 +0000 | |
| commit | 5e08dd1b4f9e8edbc240d523c2022a416917fb8c (patch) | |
| tree | fe04440e818e96596c43b4091bae3f1393a160a1 | |
| parent | 8ea8db8b630d25f05c277dabf947bf0e1f0a0dc4 (diff) | |
Update ukey2_jni API usage
Change-Id: I901b7606acee3dc0ce9bcf47e02b7a299c73cb89
Merged-In: I901b7606acee3dc0ce9bcf47e02b7a299c73cb89
(cherry picked from commit 73acca1ec9afbce60dbdc6f3a97099d9657a9e57)
| -rw-r--r-- | services/companion/java/com/android/server/companion/securechannel/SecureChannel.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/services/companion/java/com/android/server/companion/securechannel/SecureChannel.java b/services/companion/java/com/android/server/companion/securechannel/SecureChannel.java index 3cb9ac823bac..e8839a2a76ae 100644 --- a/services/companion/java/com/android/server/companion/securechannel/SecureChannel.java +++ b/services/companion/java/com/android/server/companion/securechannel/SecureChannel.java @@ -340,7 +340,7 @@ public class SecureChannel { return; } - mRole = Role.Initiator; + mRole = Role.INITIATOR; mHandshakeContext = D2DHandshakeContext.forInitiator(); mClientInit = mHandshakeContext.getNextHandshakeMessage(); @@ -412,7 +412,7 @@ public class SecureChannel { // Proceed with the rest of Ukey2 handshake if (mHandshakeContext == null) { // Server-side logic - mRole = Role.Responder; + mRole = Role.RESPONDER; mHandshakeContext = D2DHandshakeContext.forResponder(); // Receive Client Init @@ -479,9 +479,9 @@ public class SecureChannel { } sendMessage(MessageType.PRE_SHARED_KEY, constructToken(mRole, mPreSharedKey)); byte[] receivedAuthToken = readMessage(MessageType.PRE_SHARED_KEY); - byte[] expectedAuthToken = constructToken(mRole == Role.Initiator - ? Role.Responder - : Role.Initiator, + byte[] expectedAuthToken = constructToken(mRole == Role.INITIATOR + ? Role.RESPONDER + : Role.INITIATOR, mPreSharedKey); mPskVerified = Arrays.equals(receivedAuthToken, expectedAuthToken); @@ -515,9 +515,9 @@ public class SecureChannel { byte[] remoteAttestation = readMessage(MessageType.ATTESTATION); // Verifying remote attestation with public key local binding param - byte[] expectedChallenge = constructToken(mRole == Role.Initiator - ? Role.Responder - : Role.Initiator, + byte[] expectedChallenge = constructToken(mRole == Role.INITIATOR + ? Role.RESPONDER + : Role.INITIATOR, mConnectionContext.getSessionUnique()); mVerificationResult = mVerifier.verifyAttestation(remoteAttestation, expectedChallenge); @@ -554,7 +554,7 @@ public class SecureChannel { // This information is needed to help resolve potential role collision. private byte[] constructHandshakeInitMessage(byte[] message) { return ByteBuffer.allocate(1 + message.length) - .put((byte) (Role.Initiator.equals(mRole) ? 0 : 1)) + .put((byte) (Role.INITIATOR.equals(mRole) ? 0 : 1)) .put(message) .array(); } |