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

Resolved "private resolvable address" does not match Android tablet (central) MAC address

Hi all,

I use nRF52832-QFAA, S132 2.0.0, SDK 11.0.0, IAR 7.5 under Windows

Upon connection, I am trying to resolve the peer "random private resolvable" address (not for whitelisting, just to check who I am connected to).

I have most information needed, including the IRKs array. 

I have used a few different "resolving" functions, including im_address_resolve() in id_manager.c (belongs to the peer manager in sdk 11).

This example function actually just checks 3 bytes... 

It successfully decrypts the higher 3 bytes of the address and compares it with the original lower 3 bytes.

But...

1) They are not partly nor wholly the Bluetooth MAC address of the Android tablet I am using as central.

2) How do I obtain that address?  I still don't know.

I have also modified the function to handle all 6 bytes...

The Android tablet's Bluetooth MAC address is 80 4E 70 0F 05 9C

The passed structure:

The received randomized address is (ten 00 then) 7E 82 66 88 8F D8

The received key is 25 29 EF 50 0B 2C 45 66 85 16 95 65 0C D3 AE 1C

The result is (ten "don't care" then) 00 8B D1 34 EA BF .. which does not match the MAC

Can someone help?

Thanks,

Gil

Parents
  • This does the whole 6-byte decryption and returns the address at p_real:

    void decypher_address(uint8_t * p_random, uint8_t * p_real, uint8_t * p_irk_array)
    {
      nrf_ecb_hal_data_t encryption_data = {0};
      uint32_t errcode;
      uint8_t i;
    
      /* Reverse the array as the ECB expect it in big endian format */
      for (i=0; i<sizeof(encryption_data.key); i++)
      {
        encryption_data.key[i] = p_irk_array[sizeof(encryption_data.key)-1-i];
        if (i < 6)
        {
          encryption_data.cleartext[15-i] = p_random[i];
        }
      }
    
      errcode = sd_ecb_block_encrypt(&encryption_data);
      if(errcode)
      {
        ASSERT(false);
      }
      
      for (i=0; i<6; i++)
      {
        p_real[i] = encryption_data.ciphertext[15-i];
      }
    }
    

Reply
  • This does the whole 6-byte decryption and returns the address at p_real:

    void decypher_address(uint8_t * p_random, uint8_t * p_real, uint8_t * p_irk_array)
    {
      nrf_ecb_hal_data_t encryption_data = {0};
      uint32_t errcode;
      uint8_t i;
    
      /* Reverse the array as the ECB expect it in big endian format */
      for (i=0; i<sizeof(encryption_data.key); i++)
      {
        encryption_data.key[i] = p_irk_array[sizeof(encryption_data.key)-1-i];
        if (i < 6)
        {
          encryption_data.cleartext[15-i] = p_random[i];
        }
      }
    
      errcode = sd_ecb_block_encrypt(&encryption_data);
      if(errcode)
      {
        ASSERT(false);
      }
      
      for (i=0; i<6; i++)
      {
        p_real[i] = encryption_data.ciphertext[15-i];
      }
    }
    

Children
No Data
Related