Skip to content

Commit 1fa2d2d

Browse files
committed
ASN: move DecodedCert.extSubjKeyIdSz and .extAuthKeyIdSz out of the OPENSSL_EXTRA gate. fixes test.c:certext_test(), broken by f8c968d for some valid configs.
1 parent 21484ec commit 1fa2d2d

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

wolfcrypt/src/asn.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19717,13 +19717,14 @@ static int DecodeAuthKeyId(const byte* input, word32 sz, DecodedCert* cert)
1971719717
return ASN_PARSE_E;
1971819718
}
1971919719

19720+
cert->extAuthKeyIdSz = length;
19721+
1972019722
#if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
1972119723
#ifdef WOLFSSL_AKID_NAME
1972219724
cert->extRawAuthKeyIdSrc = input;
1972319725
cert->extRawAuthKeyIdSz = sz;
1972419726
#endif
1972519727
cert->extAuthKeyIdSrc = &input[idx];
19726-
cert->extAuthKeyIdSz = length;
1972719728
#endif /* OPENSSL_EXTRA */
1972819729

1972919730
return GetHashId(input + idx, length, cert->extAuthKeyId,
@@ -19819,9 +19820,9 @@ static int DecodeSubjKeyId(const byte* input, word32 sz, DecodedCert* cert)
1981919820

1982019821
ret = GetOctetString(input, &idx, &length, sz);
1982119822
if (ret > 0) {
19823+
cert->extSubjKeyIdSz = (word32)length;
1982219824
#if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
1982319825
cert->extSubjKeyIdSrc = &input[idx];
19824-
cert->extSubjKeyIdSz = (word32)length;
1982519826
#endif /* OPENSSL_EXTRA */
1982619827

1982719828
/* Get the hash or hash of the hash if wrong size. */

wolfssl/wolfcrypt/asn.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1724,7 +1724,9 @@ struct DecodedCert {
17241724
const byte* extCrlInfo; /* CRL Distribution Points */
17251725
int extCrlInfoSz; /* length of the URI */
17261726
byte extSubjKeyId[KEYID_SIZE]; /* Subject Key ID */
1727+
word32 extSubjKeyIdSz;
17271728
byte extAuthKeyId[KEYID_SIZE]; /* Authority Key ID */
1729+
word32 extAuthKeyIdSz;
17281730
#ifdef WOLFSSL_AKID_NAME
17291731
const byte* extAuthKeyIdIssuer; /* Authority Key ID authorityCertIssuer */
17301732
word32 extAuthKeyIdIssuerSz; /* Authority Key ID authorityCertIssuer length */
@@ -1751,9 +1753,7 @@ struct DecodedCert {
17511753
word32 extRawAuthKeyIdSz;
17521754
#endif
17531755
const byte* extAuthKeyIdSrc;
1754-
word32 extAuthKeyIdSz;
17551756
const byte* extSubjKeyIdSrc;
1756-
word32 extSubjKeyIdSz;
17571757
#endif
17581758
#ifdef OPENSSL_ALL
17591759
const byte* extSubjAltNameSrc;

0 commit comments

Comments
 (0)