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! :^)
This commit is contained in:
Ben Wiederhake 2023-06-01 20:52:24 +02:00 committed by Andreas Kling
parent 522809032a
commit 968f2b3eeb

View file

@ -15,7 +15,7 @@ namespace Crypto::Hash {
class PBKDF2 {
public:
template<typename PRF>
static ErrorOr<Bytes> derive_key(ReadonlyBytes password, ReadonlyBytes salt, u32 iterations, u32 key_length_bytes)
static ErrorOr<ByteBuffer> derive_key(ReadonlyBytes password, ReadonlyBytes salt, u32 iterations, u32 key_length_bytes)
requires requires(PRF t) {
t.digest_size();
}