use 16 as min/max encryption size, use fixed encryption size for re-connections

This commit is contained in:
matthias.ringwald@gmail.com 2014-01-01 19:42:17 +00:00
parent cb220d641c
commit 1664d53b41

View File

@ -1318,7 +1318,7 @@ void sm_init(){
| SM_STK_GENERATION_METHOD_OOB
| SM_STK_GENERATION_METHOD_PASSKEY;
sm_max_encryption_key_size = 16;
sm_min_encryption_key_size = 7;
sm_min_encryption_key_size = 16; // don't accept weaker crypto attempts
sm_aes128_active = 0;
gap_random_adress_update_period = 15 * 60 * 1000;
@ -1400,6 +1400,11 @@ static void packet_handler (void * connection, uint8_t packet_type, uint16_t cha
break;
}
// re-establish used key encryption size
if (sm_max_encryption_key_size == sm_min_encryption_key_size){
sm_encryption_key_size = sm_max_encryption_key_size;
}
log_info("LTK Request: recalculating with ediv 0x%04x", sm_s_ediv);
// dhk = d1(IR, 3, 0) - enc