Force WOLFSSL_OLD_OID_SUM for WC_16BIT_CPU

This commit is contained in:
gojimmypi
2025-08-07 11:23:34 -07:00
parent 5a8b86da5d
commit 256836fe6f
3 changed files with 14 additions and 0 deletions

View File

@@ -560,6 +560,7 @@ USE_STSAFE_VERBOSE
USE_TLSV13
USE_WOLF_STRNSTR
USS_API
WC_16BIT_CPU
WC_AESXTS_STREAM_NO_REQUEST_ACCOUNTING
WC_AES_BS_WORD_SIZE
WC_AES_GCM_DEC_AUTH_EARLY

View File

@@ -26,6 +26,10 @@
#ifndef WOLF_CRYPT_OID_SUM_H
#define WOLF_CRYPT_OID_SUM_H
/* Note for some CPUs smaller than 32 bit, the upper 16 bits of new OID
* values may be ignored. If collisions are encountered, consider WC_16BIT_CPU
* and/or WOLFSSL_OLD_OID_SUM to force smaller, old OID values. */
enum Hash_Sum {
#ifdef WOLFSSL_OLD_OID_SUM
/* 0x2a,0x86,0x48,0x86,0xf7,0x0d,0x02,0x02 */

View File

@@ -4389,6 +4389,15 @@ extern void uITRON4_free(void *p) ;
#undef XREALLOC
#endif
/* There's currently no 100% reliable "smaller than 32 bit" detection.
* The user can specify: WC_16BIT_CPU
* Lower 16 bits of new OID values may collide on some 16 bit platforms.
* e.g Arduino Mega, fqbn=arduino:avr:mega */
#if defined(WC_16BIT_CPU)
/* Force the old, 16 bit OIDs to be used in wolfcrypt/oid_sum.h */
#undef WOLFSSL_OLD_OID_SUM
#define WOLFSSL_OLD_OID_SUM
#endif
/* ---------------------------------------------------------------------------
* Deprecated Algorithm Handling