mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-08-16 23:17:53 +00:00
Merge branch 'bugfix/x_component_key_check' into 'nimble-1.3.0-idf'
NimBLE: Compare only x component of public key to avoid impersonation attack. See merge request espressif/esp-nimble!106
This commit is contained in:
@@ -611,9 +611,9 @@ 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 peer public key is same as our generated public key.
|
||||
* Return fail if the public keys match. */
|
||||
if (memcmp(cmd, ble_sm_sc_pub_key, 64) == 0) {
|
||||
/* 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->x, ble_sm_sc_pub_key, 32) == 0) {
|
||||
res->enc_cb = 1;
|
||||
res->sm_err = BLE_SM_ERR_AUTHREQ;
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user