diff --git a/Libraries/LibWeb/Crypto/KeyAlgorithms.cpp b/Libraries/LibWeb/Crypto/KeyAlgorithms.cpp index 999d6d73af3e7..bf645b0907ffa 100644 --- a/Libraries/LibWeb/Crypto/KeyAlgorithms.cpp +++ b/Libraries/LibWeb/Crypto/KeyAlgorithms.cpp @@ -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 = JS::Object::create(realm, realm.intrinsics().object_prototype()); + MUST(object->create_data_property("name", JS::PrimitiveString::create(vm, hash_string))); + return object; }, [&](GC::Root const& hash) -> JS::Value { return hash; diff --git a/Tests/LibWeb/Text/input/Crypto/SubtleCrypto-import-rsaoaep-minimal_jwk.html b/Tests/LibWeb/Text/input/Crypto/SubtleCrypto-import-rsaoaep-minimal_jwk.html index 617d75bb0c686..1d41902bd626f 100644 --- a/Tests/LibWeb/Text/input/Crypto/SubtleCrypto-import-rsaoaep-minimal_jwk.html +++ b/Tests/LibWeb/Text/input/Crypto/SubtleCrypto-import-rsaoaep-minimal_jwk.html @@ -16,7 +16,7 @@ ); println(key.extractable); println(key.algorithm.name); - println(key.algorithm.hash); + println(key.algorithm.hash.name); println(key.algorithm.publicExponent); done(); });