From dd6ef9cdc7eb1e61683553820232cb071b9472ba Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 3 Oct 2025 10:39:07 +0200 Subject: [PATCH] Correctly treat NULL in the parameters of a SubjectPublicKeyInfo The NULL is optional. Signed-off-by: Steffen Jaeckel --- src/pk/asn1/x509/x509_decode_subject_public_key_info.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pk/asn1/x509/x509_decode_subject_public_key_info.c b/src/pk/asn1/x509/x509_decode_subject_public_key_info.c index 07256111..34c8eac7 100644 --- a/src/pk/asn1/x509/x509_decode_subject_public_key_info.c +++ b/src/pk/asn1/x509/x509_decode_subject_public_key_info.c @@ -75,6 +75,8 @@ int x509_decode_subject_public_key_info(const unsigned char *in, unsigned long i alg_id_num = 1; } else { LTC_SET_ASN1(alg_id, 1, parameters_type, parameters, *_parameters_len); + if (parameters_type == LTC_ASN1_NULL) + alg_id[1].optional = 1; alg_id_num = 2; }