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)
33663366{
33673367 u8_t err ;
33683368
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+
33693375 err = sc_send_public_key (smp );
33703376 if (err ) {
33713377 return err ;
@@ -3428,6 +3434,12 @@ static u8_t smp_public_key(struct bt_smp *smp, struct net_buf *buf)
34283434
34293435 if (IS_ENABLED (CONFIG_BT_CENTRAL ) &&
34303436 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+
34313443 switch (smp -> method ) {
34323444 case PASSKEY_CONFIRM :
34333445 case JUST_WORKS :
You can’t perform that action at this time.
0 commit comments