mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-04 08:01:51 +00:00
LibWeb: Always return a KeyAlgorithm
from RsaHashedKeyAlgorithm
The spec never mentions the possibility for the `hash` member of `RsaHashedKeyAlgorithm` to be a string, it should be a `KeyAlgorithm` object containing a `name` string member. Spec: https://w3c.github.io/webcrypto/#dfn-RsaHashedKeyAlgorithm
This commit is contained in:
parent
999f456ba4
commit
991cb8942d
Notes:
github-actions[bot]
2025-01-17 11:44:02 +00:00
Author: https://github.com/devgianlu
Commit: 991cb8942d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3252
Reviewed-by: https://github.com/gmta ✅
4 changed files with 529 additions and 528 deletions
|
@ -179,7 +179,10 @@ JS_DEFINE_NATIVE_FUNCTION(RsaHashedKeyAlgorithm::hash_getter)
|
|||
auto hash = TRY(Bindings::throw_dom_exception_if_needed(vm, [&] { return impl->hash(); }));
|
||||
return hash.visit(
|
||||
[&](String const& hash_string) -> JS::Value {
|
||||
return JS::PrimitiveString::create(vm, hash_string);
|
||||
auto& realm = *vm.current_realm();
|
||||
auto object = KeyAlgorithm::create(realm);
|
||||
object->set_name(hash_string);
|
||||
return object;
|
||||
},
|
||||
[&](GC::Root<JS::Object> const& hash) -> JS::Value {
|
||||
return hash;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue