Explorar o código

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! :^)
Ben Wiederhake %!s(int64=2) %!d(string=hai) anos
pai
achega
968f2b3eeb
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      Userland/Libraries/LibCrypto/Hash/PBKDF2.h

+ 1 - 1
Userland/Libraries/LibCrypto/Hash/PBKDF2.h

@@ -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();
              }