Skip to content

Commit 35b0fc2

Browse files
committed
Correctly treat NULL in the parameters of a SubjectPublicKeyInfo
The NULL is optional. Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
1 parent 762707f commit 35b0fc2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/pk/asn1/x509/x509_decode_subject_public_key_info.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ int x509_decode_subject_public_key_info(const unsigned char *in, unsigned long i
7575
alg_id_num = 1;
7676
} else {
7777
LTC_SET_ASN1(alg_id, 1, parameters_type, parameters, *_parameters_len);
78+
if (parameters_type == LTC_ASN1_NULL)
79+
alg_id[1].optional = 1;
7880
alg_id_num = 2;
7981
}
8082

0 commit comments

Comments
 (0)