LibWeb: Make SubtleCrypto use the correct algorithm name for SHA-1

The spec defines "SHA-1" as a recognized algorithm name, not "SHA1".

This makes SHA-1 hash values show up on string.248.no.
This commit is contained in:
Johannes Røsvik 2024-03-02 15:38:49 +01:00 committed by Andreas Kling
commit d89e617a42
Notes: sideshowbarker 2024-07-17 11:30:54 +09:00

View file

@ -304,7 +304,7 @@ SubtleCrypto::SupportedAlgorithmsMap SubtleCrypto::supported_algorithms()
// https://w3c.github.io/webcrypto/#algorithm-conventions
// https://w3c.github.io/webcrypto/#sha
define_an_algorithm("digest"_string, "SHA1"_string, ""_string);
define_an_algorithm("digest"_string, "SHA-1"_string, ""_string);
define_an_algorithm("digest"_string, "SHA-256"_string, ""_string);
define_an_algorithm("digest"_string, "SHA-384"_string, ""_string);
define_an_algorithm("digest"_string, "SHA-512"_string, ""_string);