Default to ASN TEMPLATE library

This commit is contained in:
Lealem Amedie
2024-02-01 14:52:06 -07:00
parent f9bf96d9ba
commit 63f7298be2
3 changed files with 20 additions and 4 deletions

View File

@ -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

View File

@ -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<GET_ASN_MAX_DEPTH; i++) {
endIdx[i] = length;
}
/* Start depth at first items depth. */
minDepth = depth = asn[0].depth;
/* Check every ASN.1 item. */
@ -19551,7 +19555,7 @@ enum {
static int DecodeSubtreeGeneralName(const byte* input, word32 sz, byte tag,
Base_entry** head, void* heap)
{
Base_entry* entry;
Base_entry* entry = NULL;
word32 nameIdx = 0;
word32 len = sz;
int strLen;

View File

@ -2735,6 +2735,14 @@ extern void uITRON4_free(void *p) ;
#define WOLFSSL_IPV6
#endif
/* ---------------------------------------------------------------------------
* ASN Library Selection (default to ASN_TEMPLATE)
* ---------------------------------------------------------------------------
*/
#if !defined(WOLFSSL_ASN_TEMPLATE) && !defined(WOLFSSL_ASN_ORIGINAL) && \
!defined(NO_ASN)
#define WOLFSSL_ASN_TEMPLATE
#endif
#ifdef WOLFSSL_LINUXKM
#ifdef HAVE_CONFIG_H