]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
fscrypt-crypt-util: fix KDF contexts for SM8650
authorEric Biggers <ebiggers@google.com>
Sat, 18 Jan 2025 07:23:36 +0000 (23:23 -0800)
committerZorro Lang <zlang@kernel.org>
Tue, 11 Feb 2025 10:05:47 +0000 (18:05 +0800)
Update the KDF contexts to match those actually used on SM8650.  This
turns out to be needed for the hardware-wrapped key tests generic/368
and generic/369 to pass on the SM8650 HDK (now that I have one to
actually test it).  Apparently the contexts changed between the
prototype version I tested a couple years ago and the final version.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
src/fscrypt-crypt-util.c

index 4dde1d4acff2702f7ef62699f2d478d242a586c3..f51b366924639568b936e199d4dd5b142405482d 100644 (file)
@@ -2280,7 +2280,7 @@ static void derive_inline_encryption_key(const u8 *master_key,
                                         u8 inlinecrypt_key[INLINECRYPT_KEY_SIZE])
 {
        static const u8 ctx[36] =
-               "inline encryption key\0\0\0\0\0\0\x03\x43\0\x82\x50\0\0\0\0";
+               "inline encryption key\0\0\0\0\0\0\x02\x43\0\x82\x50\0\0\0\0";
 
        hw_kdf(master_key, master_key_size, ctx, sizeof(ctx),
               inlinecrypt_key, INLINECRYPT_KEY_SIZE);
@@ -2290,7 +2290,7 @@ static void derive_sw_secret(const u8 *master_key, size_t master_key_size,
                             u8 sw_secret[SW_SECRET_SIZE])
 {
        static const u8 ctx[28] =
-               "raw secret\0\0\0\0\0\0\0\0\0\x03\x17\0\x80\x50\0\0\0\0";
+               "raw secret\0\0\0\0\0\0\0\0\0\x02\x17\0\x80\x50\0\0\0\0";
 
        hw_kdf(master_key, master_key_size, ctx, sizeof(ctx),
               sw_secret, SW_SECRET_SIZE);