LibWeb: Set key extractability in SubtleCrypto::derive_key()

None of the algorithms actually set the `extractable` internal slot in
their implementations, and looking at `SubtleCrypto::import_key()` it
seems likely that a step is missing here.
This commit is contained in:
Jelle Raaijmakers 2024-11-15 10:36:34 +01:00 committed by Andreas Kling
parent f8c853712e
commit f7993495bd
Notes: github-actions[bot] 2024-11-15 11:32:57 +00:00

View file

@ -719,8 +719,13 @@ JS::ThrowCompletionOr<JS::NonnullGCPtr<WebIDL::Promise>> SubtleCrypto::derive_ke
return;
}
// AD-HOC: Set the [[extractable]] internal slot of key to be extractable.
// See: https://github.com/w3c/webcrypto/issues/383
auto key = result.release_value();
key->set_extractable(extractable);
// 17. Resolve promise with result.
WebIDL::resolve_promise(realm, promise, result.release_value());
WebIDL::resolve_promise(realm, promise, key);
}));
return promise;