From 968f2b3eebe8435326595dafafc63c65c7a10c8a Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Thu, 1 Jun 2023 20:52:24 +0200 Subject: [PATCH] LibCrypto: Don't return reference to stack frame in PBKDF A reference to the current stack frame becomes invalid after returning, so returning Bytes is pointless. I don't understand why this wasn't discovered earlier, but it caused some CI problems for me, so I fixed it. Don't take this as encouragement to break master! :^) --- Userland/Libraries/LibCrypto/Hash/PBKDF2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibCrypto/Hash/PBKDF2.h b/Userland/Libraries/LibCrypto/Hash/PBKDF2.h index ae940eb31a..766ee1728e 100644 --- a/Userland/Libraries/LibCrypto/Hash/PBKDF2.h +++ b/Userland/Libraries/LibCrypto/Hash/PBKDF2.h @@ -15,7 +15,7 @@ namespace Crypto::Hash { class PBKDF2 { public: template - static ErrorOr derive_key(ReadonlyBytes password, ReadonlyBytes salt, u32 iterations, u32 key_length_bytes) + static ErrorOr derive_key(ReadonlyBytes password, ReadonlyBytes salt, u32 iterations, u32 key_length_bytes) requires requires(PRF t) { t.digest_size(); }