File tree Expand file tree Collapse file tree 4 files changed +11
-1
lines changed Expand file tree Collapse file tree 4 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -306,6 +306,7 @@ MAXQ_EXPORT_TLS_KEYS
306306MAXQ_SHA1
307307MAXSEG_64K
308308MAX_WOLFSSL_FILE_SIZE
309+ MAX_OID_SZ
309310MDK_CONF_BARE_METAL
310311MDK_CONF_FS
311312MDK_CONF_RTX_TCP_FS
Original file line number Diff line number Diff line change @@ -19592,6 +19592,7 @@ static int test_wolfSSL_d2i_ASN1_INTEGER(void)
1959219592 reEncoded = NULL;
1959319593 wolfSSL_ASN1_INTEGER_free(a);
1959419594 a = NULL;
19595+ p2 = NULL;
1959519596 }
1959619597#endif /* OPENSSL_EXTRA */
1959719598 return EXPECT_RESULT();
Original file line number Diff line number Diff line change @@ -6856,6 +6856,12 @@ word32 wc_oid_sum(const byte* input, int length)
68566856 int shift = 0;
68576857#endif
68586858
6859+ /* Check for valid input. */
6860+ if (input == NULL || length > MAX_OID_SZ) {
6861+ WOLFSSL_MSG("wc_oid_sum: invalid args");
6862+ return 0;
6863+ }
6864+
68596865 /* Sum it up for now. */
68606866 for (i = 0; i < length; i++) {
68616867 #ifdef WOLFSSL_OLD_OID_SUM
Original file line number Diff line number Diff line change @@ -1145,10 +1145,12 @@ enum Misc_ASN {
11451145 #endif
11461146 /* Max total extensions, id + len + others */
11471147#endif
1148+ #ifndef MAX_OID_SZ
1149+ MAX_OID_SZ = 32 , /* Max DER length of OID*/
1150+ #endif
11481151#if defined(WOLFSSL_CERT_EXT ) || defined(OPENSSL_EXTRA ) || \
11491152 defined(HAVE_PKCS7 ) || defined(OPENSSL_EXTRA_X509_SMALL ) || \
11501153 defined(HAVE_OID_DECODING ) || defined(HAVE_OID_ENCODING )
1151- MAX_OID_SZ = 32 , /* Max DER length of OID*/
11521154 MAX_OID_STRING_SZ = 64 , /* Max string length representation of OID*/
11531155#endif
11541156#ifdef WOLFSSL_CERT_EXT
You can’t perform that action at this time.
0 commit comments