Skip to content

Commit bfacbf9

Browse files
Update ASN original to also allow larger pathLen values in Basic Constraints.
1 parent f0459eb commit bfacbf9

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

wolfcrypt/src/asn.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2744,7 +2744,7 @@ int GetASNInt(const byte* input, word32* inOutIdx, int* len,
27442744
}
27452745

27462746
#ifndef WOLFSSL_ASN_TEMPLATE
2747-
#ifndef NO_CERTS
2747+
#if !defined(NO_CERTS) && defined(WOLFSSL_CUSTOM_CURVES)
27482748
/* Get the DER/BER encoding of an ASN.1 INTEGER that has a value of no more than
27492749
* 7 bits.
27502750
*
@@ -2776,7 +2776,7 @@ static int GetInteger7Bit(const byte* input, word32* inOutIdx, word32 maxIdx)
27762776
}
27772777
#endif /* !NO_CERTS */
27782778

2779-
#if defined(WC_RSA_PSS) && !defined(NO_RSA)
2779+
#if ((defined(WC_RSA_PSS) && !defined(NO_RSA)) || !defined(NO_CERTS))
27802780
/* Get the DER/BER encoding of an ASN.1 INTEGER that has a value of no more than
27812781
* 16 bits.
27822782
*
@@ -20611,7 +20611,7 @@ static int DecodeBasicCaConstraint(const byte* input, int sz, DecodedCert* cert)
2061120611
return 0;
2061220612
}
2061320613

20614-
ret = GetInteger7Bit(input, &idx, (word32)sz);
20614+
ret = GetInteger16Bit(input, &idx, (word32)sz);
2061520615
if (ret < 0)
2061620616
return ret;
2061720617
cert->pathLength = (byte)ret;

wolfssl/wolfcrypt/asn.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1943,7 +1943,7 @@ struct Signer {
19431943
word32 pubKeySize;
19441944
word32 keyOID; /* key type */
19451945
word16 keyUsage;
1946-
word16 maxPathLen;
1946+
word16 maxPathLen;
19471947
WC_BITFIELD selfSigned:1;
19481948
const byte* publicKey;
19491949
int nameLen;

0 commit comments

Comments
 (0)