Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

LESC_DEBUG_MODE define in ble_app_multirole_lesc, nRF5 SDK 15.0.0

Device: nRF52832

SDK: nRF5 SDK 15.0.0

SoftDevice 6.0.0

Hello. I'm using using the ble_app_multirole_lesc example with nRF5 SDK 15.0.0. I'm trying to debug using my sniffer, and want to use the debug private key. The following define exists in the main.c code which seems like it should set the private key to the debug key:

#define LESC_DEBUG_MODE 1 /**< Set to 1 to use LESC debug keys, allows you to use a sniffer to inspect traffic. */

The problem, though, is that this define doesn't appear to do anything. The LESC_DEBUG_MODE symbol is not used anywhere else in the code. I went back to the 14.2.0 SDK and found some code in the sample application that made use of the LESC_DEBUG_MODE flag:

#if LESC_DEBUG_MODE

/**@brief Bluetooth SIG debug mode Private Key */
#error Generated private key is not supported.
__ALIGN(4) static const ble_gap_lesc_p256_sk_t m_lesc_private_key =
{{
0xbd,0x1a,0x3c,0xcd,0xa6,0xb8,0x99,0x58,0x99,0xb7,0x40,0xeb,0x7b,0x60,0xff,0x4a,
0x50,0x3f,0x10,0xd2,0xe3,0xb3,0xc9,0x74,0x38,0x5f,0xc5,0xa3,0xd4,0xf6,0x49,0x3f
}};

#else

#endif

Unfortunately, even with the above code I don't quite understand how the debug key works because the m_lesc_private_key structure is not actually used anywhere. I would think that 

In any case, what I really need is to use the private key with SDK 15.0.0, not 14.2.0. From my understanding of the code I would have though that the code related to the debug private key would need to be in ble_lesc.c rather than in the application code (since the key generation and management are handled by that module rather than the application).

Could you please provide guidance for using the debug key?

Thanks.

Related