File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -3366,6 +3366,12 @@ static u8_t smp_public_key_slave(struct bt_smp *smp)
3366
3366
{
3367
3367
u8_t err ;
3368
3368
3369
+ if (!atomic_test_bit (smp -> flags , SMP_FLAG_SC_DEBUG_KEY ) &&
3370
+ memcmp (smp -> pkey , sc_public_key , 64 ) == 0 ) {
3371
+ BT_WARN ("Remote is using identical public key" );
3372
+ return BT_SMP_ERR_UNSPECIFIED ;
3373
+ }
3374
+
3369
3375
err = sc_send_public_key (smp );
3370
3376
if (err ) {
3371
3377
return err ;
@@ -3428,6 +3434,12 @@ static u8_t smp_public_key(struct bt_smp *smp, struct net_buf *buf)
3428
3434
3429
3435
if (IS_ENABLED (CONFIG_BT_CENTRAL ) &&
3430
3436
smp -> chan .chan .conn -> role == BT_HCI_ROLE_MASTER ) {
3437
+ if (!atomic_test_bit (smp -> flags , SMP_FLAG_SC_DEBUG_KEY ) &&
3438
+ memcmp (smp -> pkey , sc_public_key , 64 ) == 0 ) {
3439
+ BT_WARN ("Remote is using identical public key" );
3440
+ return BT_SMP_ERR_UNSPECIFIED ;
3441
+ }
3442
+
3431
3443
switch (smp -> method ) {
3432
3444
case PASSKEY_CONFIRM :
3433
3445
case JUST_WORKS :
You can’t perform that action at this time.
0 commit comments