mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-06-05 21:04:49 +00:00
Replace "&curve_secp256r1" with "uECC_secp256r1()" for uECC operation
This commit is contained in:
committed by
Shen Wei Long
parent
d69d8789f9
commit
9b20b462e7
@@ -303,11 +303,11 @@ static void prov_dh_key_gen(void)
|
||||
#if !CONFIG_BT_NIMBLE_CRYPTO_STACK_MBEDTLS
|
||||
if (MYNEWT_VAL(BLE_MESH_PROV_OOB_PUBLIC_KEY) &&
|
||||
atomic_test_bit(bt_mesh_prov_link.flags, OOB_PUB_KEY)) {
|
||||
if (uECC_valid_public_key(remote_pk, &curve_secp256r1)) {
|
||||
if (uECC_valid_public_key(remote_pk, uECC_secp256r1())) {
|
||||
BT_ERR("Public key is not valid");
|
||||
} else if (uECC_shared_secret(remote_pk, bt_mesh_prov->private_key_be,
|
||||
bt_mesh_prov_link.dhkey,
|
||||
&curve_secp256r1) != TC_CRYPTO_SUCCESS) {
|
||||
uECC_secp256r1()) != TC_CRYPTO_SUCCESS) {
|
||||
BT_ERR("DHKey generation failed");
|
||||
} else {
|
||||
dh_key_gen_complete();
|
||||
|
||||
@@ -598,11 +598,11 @@ exit:
|
||||
}
|
||||
|
||||
#else
|
||||
if (uECC_valid_public_key(pk, &curve_secp256r1) < 0) {
|
||||
if (uECC_valid_public_key(pk, uECC_secp256r1()) < 0) {
|
||||
return BLE_HS_EUNKNOWN;
|
||||
}
|
||||
|
||||
rc = uECC_shared_secret(pk, priv, dh, &curve_secp256r1);
|
||||
rc = uECC_shared_secret(pk, priv, dh, uECC_secp256r1());
|
||||
if (rc == TC_CRYPTO_FAIL) {
|
||||
return BLE_HS_EUNKNOWN;
|
||||
}
|
||||
@@ -711,7 +711,7 @@ ble_sm_alg_gen_key_pair(uint8_t *pub, uint8_t *priv)
|
||||
return BLE_HS_EUNKNOWN;
|
||||
}
|
||||
#else
|
||||
if (uECC_make_key(pk, priv, &curve_secp256r1) != TC_CRYPTO_SUCCESS) {
|
||||
if (uECC_make_key(pk, priv, uECC_secp256r1()) != TC_CRYPTO_SUCCESS) {
|
||||
return BLE_HS_EUNKNOWN;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user