Merge branch 'bugfix/x_comp_key_exchange_v4.3-afr' into 'nimble-1.3.0-idf-v4.3-afr'

Nimble: x_component_key_exchange check v4.3-afr

See merge request espressif/esp-nimble!110
This commit is contained in:
Rahul Tank
2021-09-16 10:15:08 +00:00
+8
View File
@@ -612,6 +612,14 @@ ble_sm_sc_public_key_rx(uint16_t conn_handle, struct os_mbuf **om,
cmd = (struct ble_sm_public_key *)(*om)->om_data;
/* Check if the X component of peer public key is same as X component of our generated public key.
* Return fail if they match. */
if (memcmp(cmd, ble_sm_sc_pub_key, 32) == 0) {
res->enc_cb = 1;
res->sm_err = BLE_SM_ERR_AUTHREQ;
return;
}
ble_hs_lock();
proc = ble_sm_proc_find(conn_handle, BLE_SM_PROC_STATE_PUBLIC_KEY, -1,
NULL);