File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Expand file tree Collapse file tree 3 files changed +10
-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 @@ -6852,6 +6852,12 @@ word32 wc_oid_sum(const byte* input, int length)
68526852 int shift = 0;
68536853#endif
68546854
6855+ /* Check for valid input. */
6856+ if (input == NULL || length > MAX_OID_SZ) {
6857+ WOLFSSL_MSG("wc_oid_sum: invalid args");
6858+ return 0;
6859+ }
6860+
68556861 /* Sum it up for now. */
68566862 for (i = 0; i < length; i++) {
68576863 #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