mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-24 02:09:28 +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:
committed by
Jelle Raaijmakers
parent
999f456ba4
commit
991cb8942d
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user