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

Commit 12db8972 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

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



Change-Id: I1a8aaa02e44680f9ff3351d658299a0c8480bf6f
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents eee2d7d9 ffc308aa
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)