Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 57c84f5d authored by Maurice Lam's avatar Maurice Lam Committed by Automerger Merge Worker
Browse files

Merge "Update ukey2_jni API usage" into udc-dev-plus-aosp am: 4419e86d am:...

Merge "Update ukey2_jni API usage" into udc-dev-plus-aosp am: 4419e86d am: 00a69a45 am: 74f4b1b4

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/24668652



Change-Id: I80112fa34f28bf4174fea8e4fd6390409282ec45
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 427db233 74f4b1b4
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -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();
    }