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

Commit b4339e42 authored by Raphael Kim's avatar Raphael Kim Committed by Automerger Merge Worker
Browse files

Merge "Use hard-coded string to represent the ukey2 role when salting the...

Merge "Use hard-coded string to represent the ukey2 role when salting the authentication token." into aosp-main-future am: ffc308aa am: 12db8972 am: 6cfbd96e am: 3091bc06

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



Change-Id: I82f6c9ce78d81126ec9e2c80eb8a6c7a358f11f3
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 9fa75957 3091bc06
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -562,7 +562,8 @@ public class SecureChannel {
    private byte[] constructToken(D2DHandshakeContext.Role role, byte[] authValue)
            throws GeneralSecurityException {
        MessageDigest hash = MessageDigest.getInstance("SHA-256");
        byte[] roleUtf8 = role.name().getBytes(StandardCharsets.UTF_8);
        String roleName = role == Role.INITIATOR ? "Initiator" : "Responder";
        byte[] roleUtf8 = roleName.getBytes(StandardCharsets.UTF_8);
        int tokenLength = roleUtf8.length + authValue.length;
        return hash.digest(ByteBuffer.allocate(tokenLength)
                .put(roleUtf8)