From 97aa4363e1a119b09fc0c57771375f86f9a5d3ac Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Sat, 8 Jun 2019 07:38:20 +0100 Subject: [PATCH] Simplify X.509 CRT version check in UID parsing WHen parsing the CRT version, we already check that version is either 1, 2, or 3, so checking whether version == 2 or version == 3 is equivalent to version != 1. --- library/x509_crt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/x509_crt.c b/library/x509_crt.c index e9672e4dd..b5ad86715 100644 --- a/library/x509_crt.c +++ b/library/x509_crt.c @@ -1295,7 +1295,7 @@ static int x509_crt_parse_frame( unsigned char *start, p += len; frame->pubkey_raw.len = p - frame->pubkey_raw.p; - if( frame->version == 2 || frame->version == 3 ) + if( frame->version != 1 ) { /* * issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL,