LibCrypto+LibWeb: Reorganize OID ASN1 constants

I have divided ANS1 constants by length so that they don't have
trailing zeros that need to be removed.

Also moved OIDs lists to the only place they are used for clarity.

Fixed a couple of WPT tests by adding SECP521r1 to the list of known
curves.
This commit is contained in:
devgianlu 2024-11-29 14:54:32 +01:00 committed by Andreas Kling
commit ab2960e49f
Notes: github-actions[bot] 2024-11-30 10:19:21 +00:00
8 changed files with 75 additions and 103 deletions

View file

@ -597,9 +597,9 @@ ErrorOr<Vector<Certificate>> DefaultRootCACertificates::parse_pem_root_certifica
ErrorOr<SupportedGroup> oid_to_curve(Vector<int> curve)
{
if (curve == Crypto::Certificate::curve_ansip384r1)
if (curve == Crypto::Certificate::secp384r1_oid)
return SupportedGroup::SECP384R1;
if (curve == Crypto::Certificate::curve_prime256)
if (curve == Crypto::Certificate::secp256r1_oid)
return SupportedGroup::SECP256R1;
return AK::Error::from_string_literal("Unknown curve oid");