From 7b27c1ce6cd8025336a59b4ea54af9283b414029 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Thu, 14 Mar 2024 21:54:51 -0600 Subject: [PATCH] LibTLS: Export parse_subject_public_key_info LibWeb wants to call this for Web Crypto. --- Userland/Libraries/LibTLS/Certificate.cpp | 5 +---- Userland/Libraries/LibTLS/Certificate.h | 2 ++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibTLS/Certificate.cpp b/Userland/Libraries/LibTLS/Certificate.cpp index 0d21ec074c9..444fbae19ba 100644 --- a/Userland/Libraries/LibTLS/Certificate.cpp +++ b/Userland/Libraries/LibTLS/Certificate.cpp @@ -349,7 +349,7 @@ static ErrorOr parse_validity(Crypto::ASN1::Decoder& decoder, Vector parse_subject_public_key_info(Crypto::ASN1::Decoder& decoder, Vector current_scope) +ErrorOr parse_subject_public_key_info(Crypto::ASN1::Decoder& decoder, Vector current_scope) { // SubjectPublicKeyInfo ::= Sequence { // algorithm AlgorithmIdentifier, @@ -387,9 +387,6 @@ static ErrorOr parse_subject_public_key_info(Crypto::ASN1::Dec String algo_oid = TRY(String::join("."sv, public_key.algorithm.identifier)); ERROR_WITH_SCOPE(TRY(String::formatted("Unhandled algorithm {}", algo_oid))); - - EXIT_SCOPE(); - return public_key; } static ErrorOr parse_unique_identifier(Crypto::ASN1::Decoder& decoder, Vector current_scope) diff --git a/Userland/Libraries/LibTLS/Certificate.h b/Userland/Libraries/LibTLS/Certificate.h index f7bd33b5f4d..24eb951e1fc 100644 --- a/Userland/Libraries/LibTLS/Certificate.h +++ b/Userland/Libraries/LibTLS/Certificate.h @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -244,6 +245,7 @@ public: AlgorithmIdentifier algorithm; ByteBuffer raw_key; }; +ErrorOr parse_subject_public_key_info(Crypto::ASN1::Decoder& decoder, Vector current_scope = {}); class Certificate { public: