sm: request signing key only when bonding and ENABLE_LE_SIGNED_WRITE

This commit is contained in:
Matthias Ringwald 2018-03-30 22:22:19 +02:00
parent 27ef8bc836
commit bb09604f2e

View File

@ -1146,10 +1146,14 @@ static void sm_done_for_handle(hci_con_handle_t con_handle){
}
static int sm_key_distribution_flags_for_auth_req(void){
int flags = SM_KEYDIST_ID_KEY | SM_KEYDIST_SIGN;
int flags = SM_KEYDIST_ID_KEY;
if (sm_auth_req & SM_AUTHREQ_BONDING){
// encryption information only if bonding requested
// encryption and signing information only if bonding requested
flags |= SM_KEYDIST_ENC_KEY;
#ifdef ENABLE_LE_SIGNED_WRITE
flags | = SM_KEYDIST_SIGN;
#endif
}
return flags;
}