This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Enforcing LESC Encryption

Additional Information: 

1.  SDK: v15.3

2.  Softdevice: v6.1.1

3.  IDE: IAR v7.80.1

 

Problem Statement:

Is there a way I could enforce Secure connections just works? I want to use LESC for encrypting the link. But as I see, it also gets connected with legacy pairing with devices which doesn't support BLE v4.2.

Is it possible to configure the stack in such a way that it always declines a connection when tried to encrypt anything other than LESC? Could the device just disconnect if legacy pairing is triggered by host? 
I know I can do that in the application by checking in the AUTH_STATUS event, but I wanted to know if I can do it by configuring the stack in some way?

Parents Reply
  • Hello Amanda,

    I see that "sd_ble_gap_sec_params_reply" is called in security_dispatcher.c file. 

    And in BLE_GAP_EVT_SEC_PARAMS_REQUEST event, I can read whether LESC is requested or not from the device side by reading the LESC flag. 

    So what would be the right way to handle if LESC is 0? I want to disconnect from the device in such case. What should be the process?

    Disconnecting the connection in BLE_GAP_EVT_SEC_PARAMS_REQUEST doesn't seem to be right to me as a sec_params_reply must be sent to the device requesting encryption. Thus, what is the right way to achieve it?

Children
Related