mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-21 02:08:12 +03:00
LibTLS: Rename parse_version to parse_certificate_version
This is not a generic version, but specifically for certificates.
This commit is contained in:
parent
0c95564533
commit
77080fbade
Notes:
sideshowbarker
2024-07-17 06:29:49 +09:00
Author: https://github.com/stelar7 Commit: https://github.com/SerenityOS/serenity/commit/77080fbade Pull-request: https://github.com/SerenityOS/serenity/pull/18292 Reviewed-by: https://github.com/gmta ✅
@ -85,7 +85,7 @@ static ErrorOr<SupportedGroup> oid_to_curve(Vector<int> curve)
|
||||
return Error::from_string_view("Unknown curve oid"sv);
|
||||
}
|
||||
|
||||
static ErrorOr<Crypto::UnsignedBigInteger> parse_version(Crypto::ASN1::Decoder& decoder, Vector<StringView> current_scope)
|
||||
static ErrorOr<Crypto::UnsignedBigInteger> parse_certificate_version(Crypto::ASN1::Decoder& decoder, Vector<StringView> current_scope)
|
||||
{
|
||||
// Version ::= INTEGER {v1(0), v2(1), v3(2)}
|
||||
if (auto tag = decoder.peek(); !tag.is_error() && tag.value().type == Crypto::ASN1::Type::Constructed) {
|
||||
@ -695,7 +695,7 @@ static ErrorOr<Certificate> parse_tbs_certificate(Crypto::ASN1::Decoder& decoder
|
||||
|
||||
Certificate certificate;
|
||||
certificate.tbs_asn1 = asn1_data;
|
||||
certificate.version = TRY(parse_version(decoder, current_scope)).to_u64();
|
||||
certificate.version = TRY(parse_certificate_version(decoder, current_scope)).to_u64();
|
||||
certificate.serial_number = TRY(parse_serial_number(decoder, current_scope));
|
||||
certificate.algorithm = TRY(parse_algorithm_identifier(decoder, current_scope));
|
||||
certificate.issuer = TRY(parse_name(decoder, current_scope));
|
||||
|
Loading…
Reference in New Issue
Block a user