Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nimble: Added support of encrypted advertising data #1504

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

IshaESP
Copy link

@IshaESP IshaESP commented May 23, 2023

Added support of encrypted advertising data.

@sjanc
Copy link
Contributor

sjanc commented Jun 1, 2023

Hi,

This requires some explanation of design, functionality etc in commit message (and preferably split into multiple functional commits). Otherwise it might be hard to review 1.2k lines of code...

Also, while NimBLE supports ports our main platform is Mynewt and thus you should at least validate compilation and testsuite passing (newt test) when upstreaming code

@IshaESP IshaESP force-pushed the feature/enc_adv_data branch 8 times, most recently from 0f9088a to 3cd8c3d Compare June 14, 2023 06:36
@IshaESP
Copy link
Author

IshaESP commented Jun 14, 2023

Hi,
Pipeline has passed.
Regarding different commits, it's very hard to split the code into multiple commits as everything is dependent on each other.

Description:

  • Added key material characteristic. This characteristic returns the session key and IV(Initialization vector) when read. This session key and IV are important for client to decrypt the advertising data.
  • Similarly, on server side, encryption of advertising data is done using session key and IV.
  • A new structure enc_adv_data is being added to store encrypted advertising data.
  • If an advertising packet has code 0x31, it means it contains encrypted advertising data. (Macro used : BLE_GAP_ENC_ADV_DATA)
  • The file ble_ead.h has API's for encrypting and decrypting data, ble_ead_encrypt and ble_ead_decrypt respectfully. These API's are called by application layer.
  • The file ble_aes_ccm.h is a helper file for ble_ead.h. It actually calls the mbedtls API's for encrypting/decrypting data.
  • New structure ble_store_value_ead has been added in ble_store_config files to store the ead data across reboots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants