File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ struct bt_mesh_prov_link {
118
118
uint8_t dhkey [BT_DH_KEY_LEN ]; /* Calculated DHKey */
119
119
uint8_t expect ; /* Next expected PDU */
120
120
121
- uint8_t conf [16 ]; /* Remote Confirmation */
121
+ uint8_t conf [16 ]; /* Local/ Remote Confirmation */
122
122
uint8_t rand [16 ]; /* Local Random */
123
123
124
124
uint8_t conf_salt [16 ]; /* ConfirmationSalt */
Original file line number Diff line number Diff line change @@ -297,12 +297,14 @@ static void send_confirm(void)
297
297
298
298
if (bt_mesh_prov_conf (bt_mesh_prov_link .conf_key ,
299
299
bt_mesh_prov_link .rand , bt_mesh_prov_link .auth ,
300
- net_buf_simple_add ( & cfm , 16 ) )) {
300
+ bt_mesh_prov_link . conf )) {
301
301
BT_ERR ("Unable to generate confirmation value" );
302
302
prov_fail (PROV_ERR_UNEXP_ERR );
303
303
return ;
304
304
}
305
305
306
+ net_buf_simple_add_mem (& cfm , bt_mesh_prov_link .conf , 16 );
307
+
306
308
if (bt_mesh_prov_send (& cfm , NULL )) {
307
309
BT_ERR ("Failed to send Provisioning Confirm" );
308
310
return ;
@@ -610,6 +612,12 @@ static void prov_confirm(const uint8_t *data)
610
612
{
611
613
BT_DBG ("Remote Confirm: %s" , bt_hex (data , 16 ));
612
614
615
+ if (!memcmp (data , bt_mesh_prov_link .conf , 16 )) {
616
+ BT_ERR ("Confirm value is identical to ours, rejecting." );
617
+ prov_fail (PROV_ERR_CFM_FAILED );
618
+ return ;
619
+ }
620
+
613
621
memcpy (bt_mesh_prov_link .conf , data , 16 );
614
622
615
623
send_random ();
You can’t perform that action at this time.
0 commit comments