How to use nRF sniffer with LE Secure connection?

Dear Support,

I successfully use the nRF sniffer with LE Secure connection providing the LTK key. This works just perfectly for any reconnection. 

However now I'd like to sniff also the pairing and bonding sequence with exchanges occurring immediately after the establishing encryption.

I found 2 possibilities in the manual:

1. put the device into "debug mode" :  Enable Secure Connections debug mode on one or both of the devices. 

or 

2. provide SC Private Key as input key and type the 32-byte Diffie-Hellman private key of your device

I can't find any way or guideline how to do any of those 2 steps. 

I'm using nRF SDK 17. 

Could you please help to properly configure the sniffer to this use case?

Thank you very much!

Regards,

Jiri

Parents Reply Children
  • dear Amanda,

    thanks for your tip. I had to refactor a bit the example to SDK15, but it works!!! 

    too bad it was removed in my opinion. 

    this is how I modified it

    #if LESC_DEBUG_MODE
        UNUSED_VARIABLE(m_ecc_keygen_context);
        NRF_LOG_WARNING("Using debug ECC key pair");
        static const uint8_t LESC_DEBUG_KEY[32] = {0x3f, 0x49, 0xf6, 0xd4, 0xa3, 0xc5, 0x5f, 0x38,
                                                   0x74, 0xc9, 0xb3, 0xe3, 0xd2, 0x10, 0x3f, 0x50,
                                                   0x4a, 0xff, 0x60, 0x7b, 0xeb, 0x40, 0xb7, 0x99,
                                                   0x58, 0x99, 0xb8, 0xa6, 0xcd, 0x3c, 0x1a, 0xbd};
    
        err_code = nrf_crypto_ecc_private_key_from_raw(&g_nrf_crypto_ecc_secp256r1_curve_info,
                                                       &m_local_private_key,
                                                       LESC_DEBUG_KEY,
                                                       sizeof(LESC_DEBUG_KEY));
        VERIFY_SUCCESS(err_code);
    
        nrf_crypto_ecc_public_key_calculate_context_t calc_context;
        err_code = nrf_crypto_ecc_public_key_calculate(
        &calc_context, &m_local_private_key, &m_local_public_key.public_key);
        VERIFY_SUCCESS(err_code);
    
    #else
    
        err_code = nrf_crypto_ecc_key_pair_generate(&m_ecc_keygen_context,
                                                    &g_nrf_crypto_ecc_secp256r1_curve_info,
                                                    &m_local_private_key,
                                                    &m_local_public_key.public_key);
        VERIFY_SUCCESS(err_code);
    #endif

    Thanks a lot for your support!

Related