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

bonding ble nus example with android phone

Hi

I'm trying to add bonding in nus example, I'd like to add my peripheral in ble table in my android phone with a password, for example 123123

I've changed the security level in my source code from SEC_OPEN to SEC_JUST_WORKS but the problem is same, denied access.

I also added a passkey in "gap_param_init" according to a post in this forum

    // Add static pin 123123
    uint8_t passkey[] = STATIC_PASSKEY;
    m_static_pin_option.gap_opt.passkey.p_passkey = passkey;
    err_code =  sd_ble_opt_set(BLE_GAP_OPT_PASSKEY, &m_static_pin_option);
    APP_ERROR_CHECK(err_code);

could you help me?

Parents
  • Hi Will

    Please note that a static passkey when using legacy pairing will be susceptible to eavesdropping, but a MITM attacker won't be able to decrypt the connections of already bonded devices. The LESC module is not designed to be used with a static passkey, but it should be safe from MITM attacks as long as the static key isn't leaked somehow.

    There shouldn't be any differences in adding this passkey protection to the multiprotocol example you're using. I would suggest checking out the example code my colleague has uploaded in this thread that adds bonding using a static key to the ble_app_uart example. It should not be very different from your project I think.

    Best regards,

    Simon

Reply
  • Hi Will

    Please note that a static passkey when using legacy pairing will be susceptible to eavesdropping, but a MITM attacker won't be able to decrypt the connections of already bonded devices. The LESC module is not designed to be used with a static passkey, but it should be safe from MITM attacks as long as the static key isn't leaked somehow.

    There shouldn't be any differences in adding this passkey protection to the multiprotocol example you're using. I would suggest checking out the example code my colleague has uploaded in this thread that adds bonding using a static key to the ble_app_uart example. It should not be very different from your project I think.

    Best regards,

    Simon

Children
No Data
Related