Merge branch 'bugfix/supplicant_crypto_code_correction_v5.5' into 'release/v5.5'

fix(wpa_supplicant): Correct some functions in crypto porting layer (v5.5)

See merge request espressif/esp-idf!50879
This commit is contained in:
Jiang Jiang Jian
2026-07-29 19:53:13 +08:00
@@ -332,8 +332,8 @@ int crypto_ec_get_affine_coordinates(struct crypto_ec *e, struct crypto_ec_point
int ret = -1;
mbedtls_ecp_point *point = (mbedtls_ecp_point *)pt;
if (!mbedtls_ecp_is_zero(point) && (mbedtls_mpi_cmp_int(&point->MBEDTLS_PRIVATE(Z), 1) == 0)) {
// Affine coordinates mean that z should be 1,
if (!mbedtls_ecp_is_zero(point) && (mbedtls_mpi_cmp_int(&point->MBEDTLS_PRIVATE(Z), 1) != 0)) {
// For non-zero points, affine coordinates mean Z should be 1,
wpa_printf(MSG_ERROR, "Z coordinate is neither 0 or 1");
return -1;
}
@@ -1685,7 +1685,7 @@ int crypto_ecdsa_get_sign(unsigned char *hash,
goto fail;
}
ret = mbedtls_ecdsa_sign(&ctx->MBEDTLS_PRIVATE(grp), (mbedtls_mpi *)r, (mbedtls_mpi *)s,
&ctx->MBEDTLS_PRIVATE(d), hash, SHA256_MAC_LEN, mbedtls_esp_random, NULL);
&ctx->MBEDTLS_PRIVATE(d), hash, hash_len, mbedtls_esp_random, NULL);
fail:
mbedtls_ecdsa_free(ctx);