mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-07 21:30:49 +02:00
50428d2d92
Copilot fixes: - atmel.c: ATCA_ENABLE_DEPRECATED I2C path now uses ATECC_I2C_ADDR instead of slave_address=1 (matches the non-deprecated path). - atmel.c: capture and propagate atmel_createHandles() return value; abort init via WC_HW_E if handle creation fails. - atmel.h: include calib_aes_gcm.h with the same <calib/...> form used for calib_command.h so a single -I (.../include or .../include/cryptoauthlib) resolves both. - configure.ac: drop the duplicated AM_CONDITIONAL([BUILD_CRYPTOAUTHLIB]) (kept only in the consolidated section near the end). - settings.h: remove leftover commented-out '#ifdef WOLFSSL_ATECC508A'. - benchmark.c: drop the broken TA100 wc_RsaSSL_Verify branch (it passed message/enc as if they were sig/out). - test.c: stop calling atmel_ecc_free() with the slot-TYPE enum constants; wc_ecc_free(userA/userB) already releases the allocated slots. - ecc.c (microchip_curve_id_for_key): switch on key->dp->id, not size, so SECP256K1 / BRAINPOOLP256R1 are not silently mapped to SECP256R1. Helper is now defined for ATECC508A/608A as well, fixing the TA100-only gating that broke ATECC builds. - ecc.c (_ecc_make_key_ex): keep ATECC508A/608A's curve check at SECP256R1-only (hardware does not support the wider curve set); TA100 retains the multi-curve list. Fenrir fixes: - ecc.c (wc_ecc_init_ex): under TA100 + ALT_ECC_SIZE the pubkey x/y/z pointers must be aimed at key->pubkey.xyz[] (with alt_fp_init) before mp_init_multi - otherwise mp_init_multi dereferenced NULL. - atmel.c (atmel_get_rev_info): check atcab_wakeup return and bail out via atmel_ecc_translate_err before calling atcab_info. - atmel.c (atmel_ecc_create_pms, TA100+ECDH_ENC): pass MAP_TO_HANDLE(slotId) (the ephemeral private-key handle) into talib_ecdh_compat instead of MAP_TO_HANDLE(slotIdEnc). - atmel.c (wc_Microchip_rsa_create_key): on any failure after the first talib_create_element succeeds, delete the previously created handle(s) and clear rKeyH/uKeyH so device elements are not leaked. - aes.c (wc_AesGcmEncrypt / wc_AesGcmDecrypt TA100 fast paths): replace '(authInSz + sz) <= MAX' with bounds on each operand individually so word32 wraparound cannot bypass the 996-byte hardware limit. - rsa.c (RsaPrivateDecryptEx): drop the TA100 RSA_PUBLIC_DECRYPT short-circuit. wc_Microchip_rsa_verify expects (digest, digestLen, sig, sigLen, ...) and the verified flag must be honored; the proper TA100 fast-path already lives in wc_RsaPSS_CheckPadding_ex2.