LibWeb: Store PBKDF2Params' salt field as a ByteBuffer directly

Rather than trying to store a Handle to a WebIDL::BufferSource, let's
look ahead to what the spec wants us to do with this field and get a
copy of the bytes held by the buffer source right away.
This commit is contained in:
Andrew Kaster 2024-03-14 22:11:56 -06:00 committed by Andrew Kaster
parent a0623a47de
commit 497f3ca0fd
Notes: sideshowbarker 2024-07-17 23:07:41 +09:00
2 changed files with 4 additions and 5 deletions

View file

@ -39,7 +39,7 @@ struct AlgorithmParams {
// https://w3c.github.io/webcrypto/#pbkdf2-params
struct PBKDF2Params : public AlgorithmParams {
virtual ~PBKDF2Params() override;
PBKDF2Params(String name, JS::Handle<WebIDL::BufferSource> salt, u32 iterations, HashAlgorithmIdentifier hash)
PBKDF2Params(String name, ByteBuffer salt, u32 iterations, HashAlgorithmIdentifier hash)
: AlgorithmParams(move(name))
, salt(move(salt))
, iterations(iterations)
@ -47,7 +47,7 @@ struct PBKDF2Params : public AlgorithmParams {
{
}
JS::Handle<WebIDL::BufferSource> salt;
ByteBuffer salt;
u32 iterations;
HashAlgorithmIdentifier hash;