LibWeb: Remove dead write in HKDF/PBKDF importKey operation

This corresponds to a recent change in the spec:
https://github.com/w3c/webcrypto/pull/379
This commit is contained in:
Ben Wiederhake 2024-10-25 21:56:38 +02:00 committed by Jelle Raaijmakers
parent ee3b86c3f8
commit efad0b5676
Notes: github-actions[bot] 2024-10-25 21:51:26 +00:00

View file

@ -995,19 +995,16 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<CryptoKey>> HKDF::import_key(AlgorithmParam
// 4. Set the [[type]] internal slot of key to "secret". // 4. Set the [[type]] internal slot of key to "secret".
key->set_type(Bindings::KeyType::Secret); key->set_type(Bindings::KeyType::Secret);
// 5. Set the [[extractable]] internal slot of key to false. // 5. Let algorithm be a new KeyAlgorithm object.
key->set_extractable(false);
// 6. Let algorithm be a new KeyAlgorithm object.
auto algorithm = KeyAlgorithm::create(m_realm); auto algorithm = KeyAlgorithm::create(m_realm);
// 7. Set the name attribute of algorithm to "HKDF". // 6. Set the name attribute of algorithm to "HKDF".
algorithm->set_name("HKDF"_string); algorithm->set_name("HKDF"_string);
// 8. Set the [[algorithm]] internal slot of key to algorithm. // 7. Set the [[algorithm]] internal slot of key to algorithm.
key->set_algorithm(algorithm); key->set_algorithm(algorithm);
// 9. Return key. // 8. Return key.
return key; return key;
} }
@ -1035,19 +1032,16 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<CryptoKey>> PBKDF2::import_key(AlgorithmPar
// 5. Set the [[type]] internal slot of key to "secret". // 5. Set the [[type]] internal slot of key to "secret".
key->set_type(Bindings::KeyType::Secret); key->set_type(Bindings::KeyType::Secret);
// 6. Set the [[extractable]] internal slot of key to false. // 6. Let algorithm be a new KeyAlgorithm object.
key->set_extractable(false);
// 7. Let algorithm be a new KeyAlgorithm object.
auto algorithm = KeyAlgorithm::create(m_realm); auto algorithm = KeyAlgorithm::create(m_realm);
// 8. Set the name attribute of algorithm to "PBKDF2". // 7. Set the name attribute of algorithm to "PBKDF2".
algorithm->set_name("PBKDF2"_string); algorithm->set_name("PBKDF2"_string);
// 9. Set the [[algorithm]] internal slot of key to algorithm. // 8. Set the [[algorithm]] internal slot of key to algorithm.
key->set_algorithm(algorithm); key->set_algorithm(algorithm);
// 10. Return key. // 9. Return key.
return key; return key;
} }