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

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

See merge request espressif/esp-idf!50884
This commit is contained in:
Jiang Jiang Jian
2026-07-29 15:29:55 +08:00
@@ -333,8 +333,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;
}
@@ -1704,7 +1704,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, crypto_rng_wrapper, NULL);
&ctx->MBEDTLS_PRIVATE(d), hash, hash_len, crypto_rng_wrapper, NULL);
fail:
mbedtls_ecdsa_free(ctx);