From 18cc3e0c92b696af6567abea737c700a5a617ab0 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Sat, 16 Nov 2024 18:23:11 -0600 Subject: [PATCH] add .wolfssl_known_macro_extras; src/wolfio.c: #include if necessary; wolfcrypt/src/asn.c: gate WOLFSSL_MSG_EX() uses on defined(DEBUG_WOLFSSL), for pedantic C89 compatibility (no variadic macros); wolfssl/wolfcrypt/wc_port.h: refine setup for XFENCE(). --- .wolfssl_known_macro_extras | 977 ++++++++++++++++++++++++++++++++++++ src/wolfio.c | 9 + wolfcrypt/src/asn.c | 4 + wolfssl/wolfcrypt/wc_port.h | 5 +- 4 files changed, 994 insertions(+), 1 deletion(-) create mode 100644 .wolfssl_known_macro_extras diff --git a/.wolfssl_known_macro_extras b/.wolfssl_known_macro_extras new file mode 100644 index 0000000000..b98c72e5bc --- /dev/null +++ b/.wolfssl_known_macro_extras @@ -0,0 +1,977 @@ +AES_GCM_GMULT_NCT +AFX_RESOURCE_DLL +AFX_TARG_ENU +ALLOW_BINARY_MISMATCH_INTROSPECTION +ALLOW_V1_EXTENSIONS +ANDROID +APP_ESP_HTTP_CLIENT +APP_ESP_HTTP_CLIENT_EXAMPLE +APSTUDIO_INVOKED +ARCH_sim +ARDUINO +ARDUINO_ARCH_RP2040 +ARDUINO_SAMD_NANO_33_IOT +ARDUINO_SAM_DUE +ASN_DUMP_OID +ASN_TEMPLATE_SKIP_ISCA_CHECK +ATCAPRINTF +ATCA_ENABLE_DEPRECATED +AVR +BASE64_NO_TABLE +BLAKE2B_SELFTEST +BLAKE2S_SELFTEST +BLOCKING +BSP_DEFAULT_IO_CHANNEL_DEFINED +BSP_LED_0 +BSP_LED_1 +BSP_SDCARD_ESDHC_CHANNEL +BSP_SDCARD_SDHC_CHANNEL +BSP_SDCARD_SPI_CHANNEL +CAAM_OUT_INVALIDATE +CIOCASYMFEAT +CIOCGSESSINFO +CMSIS_OS2_H_ +COMPONENT_WOLFSSL +CONFIG_ARCH_CHIP_STM32F746ZG +CONFIG_ARCH_CHIP_STM32H743ZI +CONFIG_ARCH_CHIP_STM32L552ZE +CONFIG_ARCH_POSIX +CONFIG_ARM +CONFIG_ARM64 +CONFIG_BOARD_NATIVE_POSIX +CONFIG_COMPILER_OPTIMIZATION_DEFAULT +CONFIG_COMPILER_OPTIMIZATION_NONE +CONFIG_COMPILER_OPTIMIZATION_PERF +CONFIG_COMPILER_OPTIMIZATION_SIZE +CONFIG_CRYPTO_FIPS +CONFIG_CRYPTO_MANAGER +CONFIG_CSPRNG_ENABLED +CONFIG_ESP32C2_DEFAULT_CPU_FREQ_MHZ +CONFIG_ESP32C3_DEFAULT_CPU_FREQ_MHZ +CONFIG_ESP32H2_DEFAULT_CPU_FREQ_MHZ +CONFIG_ESP32S2_DEFAULT_CPU_FREQ_MHZ +CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ +CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ +CONFIG_ESP8266_XTAL_FREQ_26 +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_160 +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240 +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_80 +CONFIG_ESP_ENABLE_WOLFSSH +CONFIG_ESP_MAIN_TASK_STACK_SIZE +CONFIG_ESP_TLS_USING_WOLFSSL +CONFIG_ESP_WIFI_PASSWORD +CONFIG_ESP_WIFI_SSID +CONFIG_ESP_WOLFSSL_ENABLE_KYBER +CONFIG_ESP_WOLFSSL_ENABLE_WOLFSSH +CONFIG_ESP_WOLFSSL_NO_ESP32_CRYPT +CONFIG_ESP_WOLFSSL_NO_HW_AES +CONFIG_ESP_WOLFSSL_NO_HW_HASH +CONFIG_ESP_WOLFSSL_NO_HW_RSA_PRI +CONFIG_ESP_WOLFSSL_NO_HW_RSA_PRI_EXPTMOD +CONFIG_ESP_WOLFSSL_NO_HW_RSA_PRI_MP_MUL +CONFIG_ESP_WOLFSSL_NO_HW_RSA_PRI_MULMOD +CONFIG_FREERTOS_HZ +CONFIG_FREERTOS_UNICORE +CONFIG_IDF_TARGET +CONFIG_IDF_TARGET_ARCH_RISCV +CONFIG_IDF_TARGET_ARCH_XTENSA +CONFIG_IDF_TARGET_ESP32 +CONFIG_IDF_TARGET_ESP32C2 +CONFIG_IDF_TARGET_ESP32C3 +CONFIG_IDF_TARGET_ESP32C6 +CONFIG_IDF_TARGET_ESP32H2 +CONFIG_IDF_TARGET_ESP32S2 +CONFIG_IDF_TARGET_ESP32S3 +CONFIG_IDF_TARGET_ESP8266 +CONFIG_IDF_TARGET_ESP8684 +CONFIG_MAIN_TASK_STACK_SIZE +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE +CONFIG_MBEDTLS_PSA_CRYPTO_C +CONFIG_MIPS +CONFIG_MODULE_SIG +CONFIG_NET_SOCKETS_SOCKOPT_TLS +CONFIG_NEWLIB_LIBC +CONFIG_NEWLIB_NANO_FORMAT +CONFIG_PICOLIBC +CONFIG_POSIX_API +CONFIG_POSIX_THREADS +CONFIG_PREEMPT_COUNT +CONFIG_PTHREAD_IPC +CONFIG_SMP +CONFIG_SNTP_TIME_SYNC_METHOD_SMOOTH +CONFIG_TIMER_TASK_STACK_DEPTH +CONFIG_TIMER_TASK_STACK_SIZE +CONFIG_TLS_STACK_WOLFSSL +CONFIG_USE_WOLFSSL_ESP_SDK_TIME +CONFIG_USE_WOLFSSL_ESP_SDK_WIFI +CONFIG_WOLFCRYPT_ARMASM +CONFIG_WOLFCRYPT_FIPS +CONFIG_WOLFCRYPT_INTELASM +CONFIG_WOLFSSL +CONFIG_WOLFSSL_ALLOW_TLS13 +CONFIG_WOLFSSL_ALPN +CONFIG_WOLFSSL_ALT_CERT_CHAINS +CONFIG_WOLFSSL_APPLE_HOMEKIT +CONFIG_WOLFSSL_ASN_ALLOW_0_SERIAL +CONFIG_WOLFSSL_CERTIFICATE_BUNDLE +CONFIG_WOLFSSL_CERTIFICATE_BUNDLE_DEFAULT_NONE +CONFIG_WOLFSSL_DTLS +CONFIG_WOLFSSL_ENABLE_KYBER +CONFIG_WOLFSSL_EXAMPLE_NAME_ESP32_SSH_SERVER +CONFIG_WOLFSSL_EXAMPLE_NAME_ESP8266_SSH_SERVER +CONFIG_WOLFSSL_EXAMPLE_NAME_NONE +CONFIG_WOLFSSL_EXAMPLE_NAME_TEMPLATE +CONFIG_WOLFSSL_EXAMPLE_NAME_TLS_CLIENT +CONFIG_WOLFSSL_EXAMPLE_NAME_TLS_SERVER +CONFIG_WOLFSSL_EXAMPLE_NAME_WOLFMQTT_AWS_IOT_MQTT +CONFIG_WOLFSSL_EXAMPLE_NAME_WOLFMQTT_TEMPLATE +CONFIG_WOLFSSL_EXAMPLE_NAME_WOLFSSH_ECHOSERVER +CONFIG_WOLFSSL_EXAMPLE_NAME_WOLFSSH_TEMPLATE +CONFIG_WOLFSSL_HKDF +CONFIG_WOLFSSL_MAX_FRAGMENT_LEN +CONFIG_WOLFSSL_NO_ASN_STRICT +CONFIG_WOLFSSL_PSK +CONFIG_WOLFSSL_RSA_PSS +CONFIG_WOLFSSL_TARGET_HOST +CONFIG_WOLFSSL_TARGET_PORT +CONFIG_WOLFSSL_TLS13_ENABLED +CONFIG_WOLFSSL_TLS_VERSION_1_2 +CONFIG_WOLFSSL_TLS_VERSION_1_3 +CONFIG_WOLFTPM_EXAMPLE_NAME_ESPRESSIF +CONFIG_X86 +CONV_WITH_DIV +CPA_CY_API_VERSION_NUM_MAJOR +CPU_MIMXRT1176DVMAA_cm7 +CPU_MK82FN256VLL15 +CRLDP_VALIDATE_DATA +CRL_REPORT_LOAD_ERRORS +CRL_STATIC_REVOKED_LIST +CRYPTOCELL_KEY_SIZE +CRYP_HEADERWIDTHUNIT_BYTE +CRYP_KEYIVCONFIG_ONCE +CRYP_KEYSIZE_192B +CSM_UNSUPPORTED_ALGS +CTYPE_USER +CURVED448_SMALL +CY_USING_HAL +DCP_USE_DCACHE +DILITHIUM_MUL_11_SLOW +DILITHIUM_MUL_44_SLOW +DILITHIUM_MUL_QINV_SLOW +DILITHIUM_MUL_Q_SLOW +DILITHIUM_MUL_SLOW +DILITHIUM_USE_HINT_CT +DTLS_RECEIVEFROM_NO_TIMEOUT_ON_INVALID_PEER +ECCSI_ORDER_MORE_BITS_THAN_PRIME +ECC_DUMP_OID +ECDHE_SIZE +ENABLE_SECURE_SOCKETS_LOGS +ESP32 +ESP8266 +ESP_ENABLE_WOLFSSH +ESP_IDF_VERSION_MAJOR +ESP_IDF_VERSION_MINOR +ESP_PLATFORM +ESP_TASK_MAIN_STACK +EV_TRIGGER +FP_ECC_CONTROL +FREERTOS_TCP_WINSIM +FREESCALE +FREESCALE_RNGB +FREESCALE_USE_MMCAU_CLASSIC +FSL_FEATURE_HAS_L1CACHE +FSL_FEATURE_LTC_HAS_DES +FSL_FEATURE_LTC_HAS_GCM +FSL_FEATURE_LTC_HAS_PKHA +FSL_FEATURE_LTC_HAS_SHA +FSL_FEATURE_SOC_LTC_COUNT +FSL_FEATURE_SOC_MMCAU_COUNT +FSL_FEATURE_SOC_RNG_COUNT +FSL_FEATURE_SOC_TRNG_COUNT +FUSION_RTOS +GENERATE_MACHINE_PARSEABLE_REPORT +GE_P3_TOBYTES_IMPL +GOAHEAD_WS +HAL_RTC_MODULE_ENABLED +HARDWARE_CACHE_COHERENCY +HASH_AlgoMode_HASH +HASH_BYTE_SWAP +HASH_CR_LKEY +HASH_DIGEST +HASH_DataType_8b +HASH_IMR_DCIE +HASH_IMR_DINIE +HAVE_AESGCM_DECRYPT +HAVE_BYTEREVERSE64 +HAVE_CERTIFICATE_STATUS_V2 +HAVE_COLDFIRE_SEC +HAVE_CSHARP +HAVE_CURL +HAVE_CURVE22519 +HAVE_DANE +HAVE_ECC239 +HAVE_ECC320 +HAVE_ECC512 +HAVE_ECC_CDH_CAST +HAVE_ECC_SM2 +HAVE_ESP_CLK +HAVE_FACON +HAVE_FIPS_VERSION_PORT +HAVE_FUZZER +HAVE_INTEL_MULX +HAVE_INTEL_QAT_SYNC +HAVE_INTEL_SPEEDUP +HAVE_MDK_RTX +HAVE_NETX_BSD +HAVE_PKCS7_RSA_RAW_SIGN_CALLBACK +HAVE_POCO_LIB +HAVE_RTP_SYS +HAVE_SECURE_GETENV +HAVE_STACK_SIZE_VERBOSE_LOG +HAVE_THREADX +HAVE_TM_TYPE +HAVE_VALIDATE_DATE +HAVE_VA_COPY +HAVE_X448 +HONOR_MATH_USED_LENGTH +HSM_KEY_TYPE_HMAC_224 +HSM_KEY_TYPE_HMAC_256 +HSM_KEY_TYPE_HMAC_384 +HSM_KEY_TYPE_HMAC_512 +HSM_OP_KEY_GENERATION_FLAGS_CREATE +HSM_OP_KEY_GENERATION_FLAGS_UPDATE +HSM_SVC_KEY_STORE_FLAGS_UPDATE +IDIRECT_DEV_RANDOM +IDIRECT_DEV_TIME +ID_TRNG +IGNORE_KEY_EXTENSIONS +IGNORE_NETSCAPE_CERT_TYPE +INCLUDE_uxTaskGetStackHighWaterMark +INTEGRITY +INTIMEVER +IOTSAFE_NO_GETDATA +IOTSAFE_SIG_8BIT_LENGTH +KCAPI_USE_XMALLOC +KYBER_NONDETERMINISTIC +K_SERIES +LIBWOLFSSL_VERSION_GIT_BRANCH +LIBWOLFSSL_VERSION_GIT_HASH +LIBWOLFSSL_VERSION_GIT_HASH_DATE +LIBWOLFSSL_VERSION_GIT_ORIGIN +LIBWOLFSSL_VERSION_GIT_SHORT_HASH +LIBWOLFSSL_VERSION_GIT_TAG +LINUXKM_FPU_STATES_FOLLOW_THREADS +LINUXKM_LKCAPI_PRIORITY_ALLOW_MASKING +LINUX_CYCLE_COUNT +LINUX_RUSAGE_UTIME +LP64 +MAX3266X_AESGCM +MAX3266X_RSA +MAXQ10XX_PRODUCTION_KEY +MAXQ_EXPORT_TLS_KEYS +MAXQ_SHA1 +MAXSEG_64K +MAX_WOLFSSL_FILE_SIZE +MDK_CONF_BARE_METAL +MDK_CONF_FS +MDK_CONF_RTX_TCP_FS +MDK_CONF_TCP_FS +MDK_WOLFLIB +MICRIUM_MALLOC +MICROCHIP_MPLAB_HARMONY +MICROCHIP_MPLAB_HARMONY_3 +MICRO_SESSION_CACHEx +MODULE_SOCK_TCP +MP_31BIT +MP_8BIT +MQX_USE_IO_OLD +MULTI_VALUE_STATISTICS +MUTEX_DURING_INIT +NEED_THREADX_TYPES +NETX_DUO +NET_SECURE_MODULE_EN +NOTE_TRIGGER +NO_AES_DECRYPT +NO_ARDUINO_DEFAULT +NO_ASM +NO_ASN_OLD_TYPE_NAMES +NO_CAMELLIA_CBC +NO_CERT +NO_CIPHER_SUITE_ALIASES +NO_CLIENT_CACHE +NO_CLOCK_SPEEDUP +NO_CURVE25519_KEY_EXPORT +NO_CURVE25519_KEY_IMPORT +NO_CURVE25519_SHARED_SECRET +NO_CURVE448_KEY_EXPORT +NO_CURVE448_KEY_IMPORT +NO_CURVE448_SHARED_SECRET +NO_DEV_URANDOM +NO_ECC384 +NO_ECC521 +NO_ECC_CACHE_CURVE +NO_ECC_CHECK_KEY +NO_ECC_KEY_IMPORT +NO_ECC_MAKE_PUB +NO_ED25519_CLIENT_AUTH +NO_ED25519_KEY_EXPORT +NO_ED25519_KEY_IMPORT +NO_ED25519_MAKE_KEY +NO_ED25519_SIGN +NO_ED25519_VERIFY +NO_ED448_CLIENT_AUTH +NO_ED448_KEY_EXPORT +NO_ED448_KEY_IMPORT +NO_ED448_SIGN +NO_ED448_VERIFY +NO_ESP_MP_MUL_EVEN_ALT_CALC +NO_FORCE_SCR_SAME_SUITE +NO_GCM_ENCRYPT_EXTRA +NO_GETENV +NO_HANDSHAKE_DONE_CB +NO_IMX6_CAAM_AES +NO_IMX6_CAAM_HASH +NO_OLD_NAMES +NO_OLD_POLY1305 +NO_OLD_TIMEVAL_NAME +NO_PBKDF1 +NO_PIC32MZ_CRYPT +NO_PIC32MZ_HASH +NO_PIC32MZ_RNG +NO_PKCS11_AES +NO_PKCS11_AESCBC +NO_PKCS11_AESGCM +NO_PKCS11_ECC +NO_PKCS11_ECDH +NO_PKCS11_EC_KEYGEN +NO_PKCS11_HMAC +NO_PKCS11_RNG +NO_PKCS11_RSA +NO_PKCS11_RSA_PKCS +NO_PKCS7 +NO_PKCS7_COMPRESSED_DATA +NO_PKCS7_ENCRYPTED_DATA +NO_PKCS7_STREAM +NO_POLY1305_ASM +NO_PUBLIC_CCM_SET_NONCE +NO_PUBLIC_GCM_SET_IV +NO_RESUME_SUITE_CHECK +NO_RNG +NO_RNG_MUTEX +NO_SESSION_CACHE_ROW_LOCK +NO_SKID +NO_SKIP_PREVIEW +NO_STDIO_FGETS_REMAP +NO_TKERNEL_MEM_POOL +NO_TLSX_PSKKEM_PLAIN_ANNOUNCE +NO_VERIFY_OID +NO_WC_SSIZE_TYPE +NO_WOLFSSL_ALLOC_ALIGN +NO_WOLFSSL_AUTOSAR_CRYIF +NO_WOLFSSL_AUTOSAR_CRYPTO +NO_WOLFSSL_AUTOSAR_CSM +NO_WOLFSSL_BASE64_DECODE +NO_WOLFSSL_MSG_EX +NO_WOLFSSL_RENESAS_FSPSM_AES +NO_WOLFSSL_RENESAS_FSPSM_HASH +NO_WOLFSSL_RENESAS_TSIP_CRYPT_AES +NO_WOLFSSL_SHA256 +NO_WOLFSSL_SHA256_INTERLEAVE +NO_WOLFSSL_SHA512_INTERLEAVE +NO_WOLFSSL_SKIP_TRAILING_PAD +NO_WOLFSSL_SMALL_STACK_STATIC +NO_WOLFSSL_XILINX_TAG_MALLOC +NRF52 +NRF52_SERIES +NRF_ERROR_MODULE_ALREADY_INITIALIZED +OLD_HELLO_ALLOWED +OPENSSL_EXTRA_BSD +OPENSSL_EXTRA_NO_ASN1 +OPENSSL_EXTRA_NO_BN +OPENSSL_NO_PK +OS_WINDOWS +OTHERBOARD +OTHER_BOARD +PEER_INFO +PKA_ECC_SCALAR_MUL_IN_B_COEFF +PLATFORMIO +PLUTON_CRYPTO_ECC +PRINT_SESSION_STATS +PTHREAD_STACK_MIN +QAT_ENABLE_HASH +QAT_ENABLE_RNG +QAT_USE_POLLING_CHECK +RC_NO_RNG +REDIRECTION_IN3_KEYELMID +REDIRECTION_IN3_KEYID +REDIRECTION_OUT1_KEYELMID +REDIRECTION_OUT1_KEYID +REDIRECTION_OUT2_KEYELMID +REDIRECTION_OUT2_KEYID +RENESAS_T4_USE +RTC_ALARMSUBSECONDMASK_ALL +RTE_CMSIS_RTOS_RTX +RTOS_MODULE_NET_AVAIL +RTPLATFORM +SA_INTERRUPT +SCEKEY_INSTALLED +SHA256_MANY_REGISTERS +SHA3_BY_SPEC +SHOW_CERTS +SHOW_GEN +SHOW_SIZES +SHOW_SSID_AND_PASSWORD +SIM_SCGC3_RNGA_MASK +SIM_SCGC5_PORTC_MASK +SIM_SCGC5_PORTD_MASK +SIM_SCGC5_PORTE_MASK +SIM_SCGC6_RNGA_MASK +SL_SE_KEY_TYPE_ECC_P384 +SL_SE_KEY_TYPE_ECC_P521 +SL_SE_KEY_TYPE_ECC_X25519 +SL_SE_KEY_TYPE_ECC_X448 +SL_SE_PRF_HMAC_SHA1 +SOFTDEVICE_PRESENT +SO_NOSIGPIPE +SO_REUSEPORT +SP_INT_NO_ASM +SP_MATH_NEED_ADD_OFF +SP_USE_DIVTI3 +SQRTMOD_USE_MOD_EXP +SSL_SNIFFER_EXPORTS +SSN_BUILDING_LIBYASSL +STATIC_CHUNKS_ONLY +STM32F107xC +STM32F207xx +STM32F217xx +STM32F401xE +STM32F407xx +STM32F437xx +STM32F756xx +STM32F777xx +STM32G071xx +STM32G491xx +STM32H563xx +STM32H723xx +STM32H725xx +STM32H743xx +STM32H753xx +STM32L475xx +STM32L4A6xx +STM32L552xx +STM32L562xx +STM32U575xx +STM32U585xx +STM32U5A9xx +STM32WB55xx +STM32WL55xx +STM32_AESGCM_PARTIAL +STM32_HW_CLOCK_AUTO +STM32_NUTTX_RNG +TASK_EXTRA_STACK_SIZE +TCP_NODELAY +TFM_ALREADY_SET +TFM_SMALL_MONT_SET +THREADED_SNIFFTEST +TIME_T_NOT_LONG +TI_DUMMY_BUILD +TLS13_RSA_PSS_SIGN_CB_NO_PREHASH +UNICODE +USER_CA_CB +USER_CUSTOM_SNIFFX +USER_MATH_LIB +USE_ALT_MPRIME +USE_ANY_ADDR +USE_CERT_BUFFERS_25519 +USE_CERT_BUFFERS_3072 +USE_ECDSA_KEYSZ_HASH_ALGO +USE_FULL_ASSERT +USE_HAL_DRIVER +USE_NXP_LTC +USE_NXP_MMCAU +USE_QAE_THREAD_LS +USE_SECRET_CALLBACK +USE_STSAFE_RNG_SEED +USE_STSAFE_VERBOSE +USE_TLSV13 +USE_WOLF_STRNSTR +USS_API +WC_AESXTS_STREAM_NO_REQUEST_ACCOUNTING +WC_AES_BS_WORD_SIZE +WC_AES_GCM_DEC_AUTH_EARLY +WC_ASN_HASH_SHA256 +WC_ASYNC_ENABLE_3DES +WC_ASYNC_ENABLE_AES +WC_ASYNC_ENABLE_ARC4 +WC_ASYNC_ENABLE_DH +WC_ASYNC_ENABLE_ECC +WC_ASYNC_ENABLE_ECC_KEYGEN +WC_ASYNC_ENABLE_HMAC +WC_ASYNC_ENABLE_MD5 +WC_ASYNC_ENABLE_RSA +WC_ASYNC_ENABLE_RSA_KEYGEN +WC_ASYNC_ENABLE_SHA +WC_ASYNC_ENABLE_SHA224 +WC_ASYNC_ENABLE_SHA256 +WC_ASYNC_ENABLE_SHA3 +WC_ASYNC_ENABLE_SHA384 +WC_ASYNC_ENABLE_SHA512 +WC_ASYNC_NO_CRYPT +WC_ASYNC_NO_HASH +WC_DILITHIUM_CACHE_PRIV_VECTORS +WC_DILITHIUM_CACHE_PUB_VECTORS +WC_DILITHIUM_FIXED_ARRAY +WC_DISABLE_RADIX_ZERO_PAD +WC_ECC_NONBLOCK_ONLY +WC_KDF_NIST_SP_800_56C +WC_LMS_FULL_HASH +WC_NO_RNG_SIMPLE +WC_NO_STATIC_ASSERT +WC_PKCS11_FIND_WITH_ID_ONLY +WC_PROTECT_ENCRYPTED_MEM +WC_RNG_BLOCKING +WC_RSA_DIRECT +WC_RSA_NONBLOCK +WC_RSA_NONBLOCK_TIME +WC_RSA_NO_FERMAT_CHECK +WC_SHA384 +WC_SHA384_DIGEST_SIZE +WC_SHA512 +WC_SHA512_DIGEST_SIZE +WC_SSIZE_TYPE +WC_STRICT_SIG +WC_XMSS_FULL_HASH +WOLFCRYPT_FIPS_CORE_DYNAMIC_HASH_VALUE +WOLFSENTRY_H +WOLFSENTRY_NO_JSON +WOLFSSL_32BIT_MILLI_TIME +WOLFSSL_AESNI_BY4 +WOLFSSL_AESNI_BY6 +WOLFSSL_AFTER_DATE_CLOCK_SKEW +WOLFSSL_ALGO_HW_MUTEX +WOLFSSL_ALLOW_CRIT_AIA +WOLFSSL_ALLOW_CRIT_AKID +WOLFSSL_ALLOW_CRIT_SKID +WOLFSSL_ALLOW_ENCODING_CA_FALSE +WOLFSSL_ALLOW_MAX_FRAGMENT_ADJUST +WOLFSSL_ALLOW_NO_CN_IN_SAN +WOLFSSL_ALLOW_NO_SUITES +WOLFSSL_ALLOW_SERVER_SC_EXT +WOLFSSL_ALLOW_TLS_SHA1 +WOLFSSL_ALTERNATIVE_DOWNGRADE +WOLFSSL_ALT_NAMES_NO_REV +WOLFSSL_ARM_ARCH_NEON_64BIT +WOLFSSL_ASNC_CRYPT +WOLFSSL_ASN_EXTRA +WOLFSSL_ASN_INT_LEAD_0_ANY +WOLFSSL_ASN_TEMPLATE_NEED_SET_INT32 +WOLFSSL_ASN_TEMPLATE_TYPE_CHECK +WOLFSSL_ATECC508 +WOLFSSL_ATECC508A_NOIDLE +WOLFSSL_ATECC508A_NOSOFTECC +WOLFSSL_ATECC508A_TLS +WOLFSSL_ATECC_ECDH_IOENC +WOLFSSL_ATECC_NO_ECDH_ENC +WOLFSSL_ATECC_RNG +WOLFSSL_ATECC_TFLXTLS +WOLFSSL_ATECC_TNGTLS +WOLFSSL_ATMEL +WOLFSSL_ATMEL_TIME +WOLFSSL_BEFORE_DATE_CLOCK_SKEW +WOLFSSL_BIGINT_TYPES +WOLFSSL_BIO_NO_FLOW_STATS +WOLFSSL_BLAKE2B_INIT_EACH_FIELD +WOLFSSL_BLAKE2S_INIT_EACH_FIELD +WOLFSSL_BLIND_PRIVATE_KEY +WOLFSSL_BYTESWAP32_ASM +WOLFSSL_CAAM_BLACK_KEY_AESCCM +WOLFSSL_CAAM_BLACK_KEY_SM +WOLFSSL_CAAM_NO_BLACK_KEY +WOLFSSL_CALLBACKS +WOLFSSL_CHECK_DESKEY +WOLFSSL_CHECK_MEM_ZERO +WOLFSSL_CHIBIOS +WOLFSSL_CLANG_TIDY +WOLFSSL_COMMERCIAL_LICENSE +WOLFSSL_CONTIKI +WOLFSSL_CRL_ALLOW_MISSING_CDP +WOLFSSL_DILITHIUM_ASSIGN_KEY +WOLFSSL_DILITHIUM_MAKE_KEY_SMALL_MEM +WOLFSSL_DILITHIUM_NO_ASN1 +WOLFSSL_DILITHIUM_NO_CHECK_KEY +WOLFSSL_DILITHIUM_NO_LARGE_CODE +WOLFSSL_DILITHIUM_NO_MAKE +WOLFSSL_DILITHIUM_REVERSE_HASH_OID +WOLFSSL_DILITHIUM_SIGN_CHECK_W0 +WOLFSSL_DILITHIUM_SIGN_CHECK_Y +WOLFSSL_DILITHIUM_SIGN_SMALL_MEM_PRECALC +WOLFSSL_DILITHIUM_SIGN_SMALL_MEM_PRECALC_A +WOLFSSL_DILITHIUM_SMALL_MEM_POLY64 +WOLFSSL_DILITHIUM_VERIFY_NO_MALLOC +WOLFSSL_DILITHIUM_VERIFY_SMALL_MEM +WOLFSSL_DISABLE_EARLY_SANITY_CHECKS +WOLFSSL_DTLS_DISALLOW_FUTURE +WOLFSSL_DTLS_DROP_STATS +WOLFSSL_DTLS_RESEND_ONLY_TIMEOUT +WOLFSSL_DUMP_MEMIO_STREAM +WOLFSSL_DUP_CERTPOL +WOLFSSL_ECC_BLIND_K +WOLFSSL_ECC_GEN_REJECT_SAMPLING +WOLFSSL_ECC_NO_SMALL_STACK +WOLFSSL_ECC_SIGALG_PARAMS_NULL_ALLOWED +WOLFSSL_ECDHX_SHARED_NOT_ZERO +WOLFSSL_ECDSA_MATCH_HASH +WOLFSSL_ECDSA_SET_K_ONE_LOOP +WOLFSSL_EC_POINT_CMP_JACOBIAN +WOLFSSL_EDDSA_CHECK_PRIV_ON_SIGN +WOLFSSL_EMNET +WOLFSSL_ESPWROOM32 +WOLFSSL_EVP_PRINT +WOLFSSL_EXPORT_INT +WOLFSSL_EXPORT_SPC_SZ +WOLFSSL_EXTRA +WOLFSSL_FORCE_OCSP_NONCE_CHECK +WOLFSSL_FRDM_K64 +WOLFSSL_FRDM_K64_JENKINS +WOLFSSL_FUNC_TIME +WOLFSSL_FUNC_TIME_LOG +WOLFSSL_GEN_CERT +WOLFSSL_GETRANDOM +WOLFSSL_GNRC +WOLFSSL_HARDEN_TLS_ALLOW_ALL_CIPHERSUITES +WOLFSSL_HARDEN_TLS_ALLOW_OLD_TLS +WOLFSSL_HARDEN_TLS_ALLOW_TRUNCATED_HMAC +WOLFSSL_HARDEN_TLS_NO_PKEY_CHECK +WOLFSSL_HARDEN_TLS_NO_SCR_CHECK +WOLFSSL_HOSTNAME_VERIFY_ALT_NAME_ONLY +WOLFSSL_I2D_ECDSA_SIG_ALLOC +WOLFSSL_IAR_ARM_TIME +WOLFSSL_IGNORE_BAD_CERT_PATH +WOLFSSL_IMX6 +WOLFSSL_IMX6_CAAM +WOLFSSL_IMX6_CAAM_BLOB +WOLFSSL_IMX6_CAAM_RNG +WOLFSSL_IMXRT_DCP +WOLFSSL_ISOTP +WOLFSSL_KEIL +WOLFSSL_KEIL_NET +WOLFSSL_KYBER_INVNTT_UNROLL +WOLFSSL_KYBER_NO_LARGE_CODE +WOLFSSL_KYBER_NTT_UNROLL +WOLFSSL_LIB +WOLFSSL_LMS_CACHE_BITS +WOLFSSL_LMS_FULL_HASH +WOLFSSL_LMS_LARGE_CACHES +WOLFSSL_LMS_MAX_HEIGHT +WOLFSSL_LMS_MAX_LEVELS +WOLFSSL_LMS_NO_SIG_CACHE +WOLFSSL_LMS_ROOT_LEVELS +WOLFSSL_LPC43xx +WOLFSSL_MAKE_SYSTEM_NAME_LINUX +WOLFSSL_MAKE_SYSTEM_NAME_WSL +WOLFSSL_MDK5 +WOLFSSL_MEM_FAIL_COUNT +WOLFSSL_MONT_RED_CT +WOLFSSL_MP_COND_COPY +WOLFSSL_MP_INVMOD_CONSTANT_TIME +WOLFSSL_MULTICIRCULATE_ALTNAMELIST +WOLFSSL_NONBLOCK_OCSP +WOLFSSL_NOSHA3_384 +WOLFSSL_NOT_WINDOWS_API +WOLFSSL_NO_BIO_ADDR_IN +WOLFSSL_NO_CLIENT +WOLFSSL_NO_CLIENT_CERT_ERROR +WOLFSSL_NO_COPY_CERT +WOLFSSL_NO_COPY_KEY +WOLFSSL_NO_CRL_DATE_CHECK +WOLFSSL_NO_CRL_NEXT_DATE +WOLFSSL_NO_DECODE_EXTRA +WOLFSSL_NO_DER_TO_PEM +WOLFSSL_NO_DH186 +WOLFSSL_NO_DTLS_SIZE_CHECK +WOLFSSL_NO_ETM_ALERT +WOLFSSL_NO_FENCE +WOLFSSL_NO_FSEEK +WOLFSSL_NO_INIT_CTX_KEY +WOLFSSL_NO_ISSUERHASH_TDPEER +WOLFSSL_NO_KCAPI_AES_CBC +WOLFSSL_NO_KCAPI_HMAC_SHA1 +WOLFSSL_NO_KCAPI_HMAC_SHA224 +WOLFSSL_NO_KCAPI_HMAC_SHA256 +WOLFSSL_NO_KCAPI_HMAC_SHA384 +WOLFSSL_NO_KCAPI_HMAC_SHA512 +WOLFSSL_NO_KCAPI_SHA224 +WOLFSSL_NO_OCSP_DATE_CHECK +WOLFSSL_NO_OCSP_ISSUER_CHAIN_CHECK +WOLFSSL_NO_OCSP_OPTIONAL_CERTS +WOLFSSL_NO_PUBLIC_FFDHE +WOLFSSL_NO_RSA_KEY_CHECK +WOLFSSL_NO_SERVER_GROUPS_EXT +WOLFSSL_NO_SESSION_STATS +WOLFSSL_NO_SIGALG +WOLFSSL_NO_SOCKADDR_UN +WOLFSSL_NO_SPHINCS +WOLFSSL_NO_STRICT_CIPHER_SUITE +WOLFSSL_NO_TICKET_EXPIRE +WOLFSSL_NO_TRUSTED_CERTS_VERIFY +WOLFSSL_NO_XOR_OPS +WOLFSSL_NRF51_AES +WOLFSSL_OLDTLS_AEAD_CIPHERSUITES +WOLFSSL_OLDTLS_SHA2_CIPHERSUITES +WOLFSSL_OLD_SET_CURVES_LIST +WOLFSSL_OLD_UNSUPPORTED_EXTENSION +WOLFSSL_OPTIONS_IGNORE_SYS +WOLFSSL_PASSTHRU_ERR +WOLFSSL_PB +WOLFSSL_PEER_ADDRESS_CHANGES +WOLFSSL_PKCS11_RW_TOKENS +WOLFSSL_PRCONNECT_PRO +WOLFSSL_PREFIX +WOLFSSL_PSA_NO_AES +WOLFSSL_PSA_NO_HASH +WOLFSSL_PSA_NO_PKCB +WOLFSSL_PSA_NO_PKCBS +WOLFSSL_PSA_NO_RNG +WOLFSSL_PSK_IDENTITY_ALERT +WOLFSSL_PSK_ID_PROTECTION +WOLFSSL_PSK_MULTI_ID_PER_CS +WOLFSSL_PSK_TLS13_CB +WOLFSSL_PSOC6_CRYPTO +WOLFSSL_PYTHON +WOLFSSL_RENESAS_FSPSM_CRYPT_ONLY +WOLFSSL_RENESAS_RA6M3 +WOLFSSL_RENESAS_RA6M3G +WOLFSSL_RENESAS_RSIP +WOLFSSL_RENESAS_RZN2L +WOLFSSL_RENESAS_TLS +WOLFSSL_RENESAS_TSIP_CRYPTONLY +WOLFSSL_RENESAS_TSIP_IAREWRX +WOLFSSL_RSA_CHECK_D_ON_DECRYPT +WOLFSSL_RSA_DECRYPT_TO_0_LEN +WOLFSSL_RW_THREADED +WOLFSSL_SAKKE_SMALL +WOLFSSL_SAKKE_SMALL_MODEXP +WOLFSSL_SE050_CRYPT +WOLFSSL_SE050_HASH +WOLFSSL_SE050_INIT +WOLFSSL_SE050_NO_TRNG +WOLFSSL_SECURE_RENEGOTIATION_ON_BY_DEFAULT +WOLFSSL_SETTINGS_FILE +WOLFSSL_SH224 +WOLFSSL_SHA256_ALT_CH_MAJ +WOLFSSL_SHUTDOWNONCE +WOLFSSL_SILABS_TRNG +WOLFSSL_SM4_EBC +WOLFSSL_SNIFFER_NO_RECOVERY +WOLFSSL_SP_ARM32_UDIV +WOLFSSL_SP_DH +WOLFSSL_SP_FAST_NCT_EXPTMOD +WOLFSSL_SP_INT_SQR_VOLATILE +WOLFSSL_STACK_CHECK +WOLFSSL_STM32F427_RNG +WOLFSSL_STM32_RNG_NOLIB +WOLFSSL_STRONGEST_HASH_SIG +WOLFSSL_STSAFE_TAKES_SLOT +WOLFSSL_TELIT_M2MB +WOLFSSL_THREADED_CRYPT +WOLFSSL_TICKET_DECRYPT_NO_CREATE +WOLFSSL_TICKET_ENC_AES128_GCM +WOLFSSL_TICKET_ENC_AES256_CBC +WOLFSSL_TICKET_ENC_AES256_GCM +WOLFSSL_TICKET_ENC_CBC_HMAC +WOLFSSL_TICKET_ENC_CHACHA20_POLY1305 +WOLFSSL_TICKET_ENC_HMAC_SHA384 +WOLFSSL_TICKET_ENC_HMAC_SHA512 +WOLFSSL_TI_CURRTIME +WOLFSSL_TLS13_DRAFT +WOLFSSL_TLS13_IGNORE_AEAD_LIMITS +WOLFSSL_TLS13_MIDDLEBOX_COMPAT +WOLFSSL_TLS13_SHA512 +WOLFSSL_TLS13_TICKET_BEFORE_FINISHED +WOLFSSL_TRACK_MEMORY_FULL +WOLFSSL_TRAP_MALLOC_SZ +WOLFSSL_UNALIGNED_64BIT_ACCESS +WOLFSSL_USER_FILESYSTEM +WOLFSSL_USER_LOG +WOLFSSL_USER_MUTEX +WOLFSSL_USER_THREADING +WOLFSSL_USE_ESP32C3_CRYPT_HASH_HW +WOLFSSL_USE_FLASHMEM +WOLFSSL_USE_OPTIONS_H +WOLFSSL_USE_POPEN_HOST +WOLFSSL_VALIDATE_DH_KEYGEN +WOLFSSL_WC_XMSS_NO_SHA256 +WOLFSSL_WC_XMSS_NO_SHAKE256 +WOLFSSL_WICED_PSEUDO_UNIX_EPOCH_TIME +WOLFSSL_X509_STORE_CERTS +WOLFSSL_X509_TRUSTED_CERTIFICATE_CALLBACK +WOLFSSL_XFREE_NO_NULLNESS_CHECK +WOLFSSL_XILINX_CRYPTO_OLD +WOLFSSL_XILINX_PATCH +WOLFSSL_XIL_MSG_NO_SLEEP +WOLFSSL_XMSS_LARGE_SECRET_KEY +WOLFSSL_ZEPHYR +WOLFSS_SP_MATH_ALL +WOLF_ALLOW_BUILTIN +WOLF_CONF_IO +WOLF_CONF_KYBER +WOLF_CONF_PK +WOLF_CONF_RESUMPTION +WOLF_CONF_TPM +WOLF_CRYPTO_CB_CMD +WOLF_CRYPTO_CB_FIND +WOLF_CRYPTO_CB_ONLY_ECC +WOLF_CRYPTO_CB_ONLY_RSA +WOLF_CRYPTO_CB_RSA_PAD +WOLF_CRYPTO_DEV +WOLF_NO_TRAILING_ENUM_COMMAS +WOLSSL_OLD_TIMINGPADVERIFY +XGETPASSWD +XMSS_CALL_PRF_KEYGEN +XPAR_VERSAL_CIPS_0_PSPMC_0_PSV_CORTEXA72_0_TIMESTAMP_CLK_FREQ +XSECURE_CACHE_DISABLE +_ABI64 +_ABIO64 +_ARCH_PPC64 +_COMPILER_VERSION +_INTPTR_T_DECLARED +_LP64 +_MSC_VER +_MSVC_LANG +_M_ARM64 +_M_X64 +_NETOS +_POSIX_C_SOURCE +_SDCC_VERSION_PATCHLEVEL +_SH3 +_SILICON_LABS_SECURITY_FEATURE +_SOCKLEN_T +_SYS_DEVCON_LOCAL_H +_TIME_HELPER_H +_UINTPTR_T_DECLARED +_WIN32 +_WIN32_WCE +_WIN64 +__32MZ2048ECH144__ +__32MZ2048ECM144__ +__32MZ2048EFM144__ +__ANDROID__ +__APPLE__ +__ARCH_STRCASECMP_NO_REDIRECT +__ARCH_STRCMP_NO_REDIRECT +__ARCH_STRNCASECMP_NO_REDIRECT +__ARCH_STRNCAT_NO_REDIRECT +__ARCH_STRNCMP_NO_REDIRECT +__ARCH_STRNCPY_NO_REDIRECT +__ARCH_STRSTR_NO_REDIRECT +__ARM_ARCH_7M__ +__ARM_FEATURE_CRYPTO +__ATOMIC_RELAXED +__AVR__ +__BCPLUSPLUS__ +__BIG_ENDIAN__ +__BORLANDC__ +__CCRX__ +__COMPILER_VER__ +__CYGWIN__ +__DATE__ +__DCACHE_PRESENT +__DCC__ +__DECC_VER +__ELF__ +__EMSCRIPTEN__ +__FPU_PRESENT +__FreeBSD__ +__GLIBC__ +__GNUC_MINOR__ +__GNUC__ +__HP_cc +__IAR_SYSTEMS_ICC__ +__ICCARM__ +__ILP32__ +__INCLUDE_NUTTX_CONFIG_H +__INTEGRITY +__INTEL_COMPILER +__KEIL__ +__KEY_DATA_H__ +__LP64 +__LP64__ +__MACH__ +__MICROBLAZE__ +__MINGW32__ +__MINGW64_VERSION_MAJOR +__MINGW64__ +__MWERKS__ +__PIE__ +__POWERPC__ +__PPC__ +__PPU +__QNXNTO__ +__QNX__ +__ROPI__ +__SAM3A4C__ +__SAM3A8C__ +__SAM3A8H__ +__SAM3X4C__ +__SAM3X4E__ +__SAM3X8C__ +__SAM3X8E__ +__SANITIZE_ADDRESS__ +__SDCC_VERSION_MAJOR +__SDCC_VERSION_MINOR +__SDCC_VERSION_PATCH +__SIZEOF_INT128__ +__SIZEOF_LONG_LONG__ +__STDC_VERSION__ +__STDC__ +__STM32__ +__STRICT_ANSI__ +__SUNPRO_C +__SUNPRO_CC +__SVR4 +__TI_COMPILER_VERSION__ +__TURBOC__ +__USE_GNU +__USE_MISC +__USE_XOPEN2K +__WATCOMC__ +__WATCOM_INT64__ +__XC32 +__XTENSA__ +__aarch64__ +__alpha__ +__arch64__ +__arm__ +__clang__ +__clang_major__ +__cplusplus +__ghc__ +__ghs__ +__hpux__ +__i386 +__i386__ +__ia64__ +__linux__ +__llvm__ +__mips +__mips64 +__must_check +__ppc64__ +__ppc__ +__riscv +__riscv_xlen +__s390x__ +__sparc64__ +__sun +__svr4__ +__thumb__ +__ti__ +__x86_64__ +byte +configTICK_RATE_HZ +fallthrough +noinline +ssize_t +sun +versal +wc_Tls13_HKDF_Expand_Label diff --git a/src/wolfio.c b/src/wolfio.c index 3b3e8d491f..8d0b2f089b 100644 --- a/src/wolfio.c +++ b/src/wolfio.c @@ -32,6 +32,15 @@ #ifndef WOLFCRYPT_ONLY +#if defined(HAVE_ERRNO_H) && defined(WOLFSSL_NO_SOCK) && \ + (defined(USE_WOLFSSL_IO) || defined(HAVE_HTTP_CLIENT)) + /* error codes are needed for TranslateIoReturnCode() and + * wolfIO_TcpConnect() even if defined(WOLFSSL_NO_SOCK), which inhibits + * inclusion of errno.h by wolfio.h. + */ + #include +#endif + #ifdef _WIN32_WCE /* On WinCE winsock2.h must be included before windows.h for socket stuff */ #include diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index e5619702c2..ecda0c4a64 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -40842,8 +40842,10 @@ static int DecodeAcertGeneralNames(const byte* input, word32 sz, } if ((word32)length + idx != sz) { + #ifdef DEBUG_WOLFSSL WOLFSSL_MSG_EX("error: acert general names: got %d, expected %d", (word32)length + idx, sz); + #endif return ASN_PARSE_E; } @@ -40854,8 +40856,10 @@ static int DecodeAcertGeneralNames(const byte* input, word32 sz, * therefore observing WOLFSSL_MAX_ALT_NAMES limit. */ numNames++; if (numNames > WOLFSSL_MAX_ALT_NAMES) { + #ifdef DEBUG_WOLFSSL WOLFSSL_MSG_EX("error: acert general names: too many names, %d", numNames); + #endif ret = ASN_ALT_NAME_E; break; } diff --git a/wolfssl/wolfcrypt/wc_port.h b/wolfssl/wolfcrypt/wc_port.h index 2304156740..7bc1dd89eb 100644 --- a/wolfssl/wolfcrypt/wc_port.h +++ b/wolfssl/wolfcrypt/wc_port.h @@ -1436,10 +1436,13 @@ WOLFSSL_ABI WOLFSSL_API int wolfCrypt_Cleanup(void); #elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) #include #define XFENCE() atomic_thread_fence(memory_order_seq_cst) - #elif defined(__GNUC__) && (__GNUC__ >= 4) && (__GNUC__ < 5) + #elif defined(__GNUC__) && (__GNUC__ == 4) && \ + defined(__GNUC_MINOR__) && (__GNUC_MINOR__ >= 1) #define XFENCE() __sync_synchronize() #elif (defined(__GNUC__) && (__GNUC__ >= 5)) || defined (__clang__) #define XFENCE() __atomic_thread_fence(__ATOMIC_SEQ_CST) + #elif defined(WOLFSSL_NO_ASM) + #define XFENCE() WC_DO_NOTHING #elif defined (__i386__) || defined(__x86_64__) #define XFENCE() XASM_VOLATILE("lfence") #elif (defined (__arm__) && (__ARM_ARCH > 6)) || defined(__aarch64__)