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

Optional secure pairing with a passkey #886

Merged
merged 1 commit into from
Dec 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/ble/BatteryInformationService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ BatteryInformationService::BatteryInformationService(Controllers::Battery& batte
characteristicDefinition {{.uuid = &batteryLevelUuid.u,
.access_cb = BatteryInformationServiceCallback,
.arg = this,
.flags = BLE_GATT_CHR_F_READ | BLE_GATT_CHR_F_READ_ENC | BLE_GATT_CHR_F_READ_AUTHEN | BLE_GATT_CHR_F_NOTIFY,
.flags = BLE_GATT_CHR_F_READ | BLE_GATT_CHR_F_NOTIFY,
.val_handle = &batteryLevelHandle},
{0}},
serviceDefinition {
Expand Down
6 changes: 2 additions & 4 deletions src/components/ble/NimbleController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,7 @@ void NimbleController::Init() {

RestoreBond();

if (!ble_gap_adv_active() && !bleController.IsConnected()) {
StartAdvertising();
}
StartAdvertising();
}

void NimbleController::StartAdvertising() {
Expand Down Expand Up @@ -274,7 +272,7 @@ int NimbleController::OnGAPEvent(ble_gap_event* event) {
* display capability only so we only handle the "display" action here.
*
* Standards insist that the rand() PRNG be deterministic.
* Use the nimble TRNG here since rand() is predictable.
* Use the tinycrypt prng here since rand() is predictable.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is intentional?

*/
NRF_LOG_INFO("Security event : BLE_GAP_EVENT_PASSKEY_ACTION");
if (event->passkey.params.action == BLE_SM_IOACT_DISP) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ble/NimbleController.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ namespace Pinetime {
ImmediateAlertService immediateAlertService;
HeartRateService heartRateService;
MotionService motionService;
ServiceDiscovery serviceDiscovery;
FSService fsService;
ServiceDiscovery serviceDiscovery;

uint8_t addrType;
uint16_t connectionHandle = BLE_HS_CONN_HANDLE_NONE;
Expand Down