Skip to content

Commit 084338d

Browse files
committed
ASN Template: GetASN_UTF8String optional
Allow UTF8String checking to be disabled with WOLFSSL_NO_ASN_STRICT.
1 parent faea635 commit 084338d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

wolfcrypt/src/asn.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,7 @@ static int GetASN_BitString(const byte* input, word32 idx, int length)
11161116
return 0;
11171117
}
11181118

1119+
#ifndef WOLFSSL_NO_ASN_STRICT
11191120
/* Check a UTF8STRING's data is valid.
11201121
*
11211122
* @param [in] input BER encoded data.
@@ -1173,6 +1174,7 @@ static int GetASN_UTF8String(const byte* input, word32 idx, int length)
11731174

11741175
return ret;
11751176
}
1177+
#endif
11761178

11771179
/* Check an OBJECT IDENTIFIER's data is valid.
11781180
*
@@ -1673,13 +1675,15 @@ int GetASN_Items(const ASNItem* asn, ASNGetData *data, int count, int complete,
16731675
idx++;
16741676
len--;
16751677
}
1678+
#ifndef WOLFSSL_NO_ASN_STRICT
16761679
else if ((asn[i].tag == ASN_UTF8STRING) ||
16771680
(data[i].tag == ASN_UTF8STRING)) {
16781681
/* Check validity of data. */
16791682
err = GetASN_UTF8String(input, idx, len);
16801683
if (err != 0)
16811684
return err;
16821685
}
1686+
#endif
16831687
else if (asn[i].tag == ASN_OBJECT_ID) {
16841688
/* Check validity of data. */
16851689
err = GetASN_ObjectId(input, idx, len);

0 commit comments

Comments
 (0)