diff --git a/ChangeLog.md b/ChangeLog.md index 586adaa45..140d73063 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,7 @@ +# wolfSSL Release X.Y.Z (TBD) + +NOTE: This release switches the default ASN.1 parser to the new ASN template code. If the original ASN.1 code is preferred define `WOLFSSL_ASN_ORIGINAL` to use it. See PR #7199. + # wolfSSL Release 5.6.6 (Dec 19, 2023) Release 5.6.6 has been developed according to wolfSSL's development and QA diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 3b61f6fb5..40ab40300 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -1384,9 +1384,8 @@ int GetASN_Items(const ASNItem* asn, ASNGetData *data, int count, int complete, int len; /* Current index into buffer. */ word32 idx = *inOutIdx; - /* Initialize the end index at each depth to be the length. */ - word32 endIdx[GET_ASN_MAX_DEPTH] = { length, length, length, length, length, - length, length }; + /* Declare the end index array. */ + word32 endIdx[GET_ASN_MAX_DEPTH]; /* Set choices to -1 to indicate they haven't been seen or found. */ signed char choiceMet[GET_ASN_MAX_CHOICES] = { -1, -1 }; /* Not matching a choice right now. */ @@ -1402,6 +1401,11 @@ int GetASN_Items(const ASNItem* asn, ASNGetData *data, int count, int complete, WOLFSSL_ENTER("GetASN_Items"); #endif + /* Set the end index at each depth to be the length. */ + for (i=0; i