Skip to content

Commit 1a6a88a

Browse files
committed
fix ci for feather52832
1 parent 0391eca commit 1a6a88a

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

libraries/Bluefruit52Lib/examples/Central/central_pairing/central_pairing.ino

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
#include <bluefruit.h>
4040
#include <Adafruit_LittleFS.h>
4141
#include <InternalFileSystem.h>
42-
#include <Adafruit_nRFCrypto.h>
4342

4443
#ifdef USE_ARCADA
4544
#include <Adafruit_Arcada.h>

libraries/Bluefruit52Lib/examples/Peripheral/pairing_passkey/pairing_passkey.ino

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
#include <bluefruit.h>
3838
#include <Adafruit_LittleFS.h>
3939
#include <InternalFileSystem.h>
40-
#include <Adafruit_nRFCrypto.h>
4140

4241
#ifdef USE_ARCADA
4342
#include <Adafruit_Arcada.h>

libraries/Bluefruit52Lib/src/BLEPairing.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ BLEPairing::BLEPairing(void)
8686

8787
bool BLEPairing::begin(void)
8888
{
89-
9089
#ifdef NRF_CRYPTOCELL
9190
// Initalize Crypto lib for LESC (safe to call multiple times)
9291
nRFCrypto.begin();
@@ -275,22 +274,21 @@ void BLEPairing::_eventHandler(ble_evt_t* evt)
275274
.p_enc_key = &_bond_keys.own_enc,
276275
.p_id_key = NULL,
277276
.p_sign_key = NULL,
278-
.p_pk = (ble_gap_lesc_p256_pk_t*) (_pubkey+1)
277+
.p_pk = NULL
279278
},
280279

281280
.keys_peer = {
282281
.p_enc_key = &_bond_keys.peer_enc,
283282
.p_id_key = &_bond_keys.peer_id,
284283
.p_sign_key = NULL,
285-
.p_pk = (ble_gap_lesc_p256_pk_t*) (_peer_pubkey+1)
284+
.p_pk = NULL
286285
}
287286
};
288287

289-
// use LESC when both support it
290-
if ( peer->lesc && _sec_param.lesc )
291-
{
292-
// keyset.
293-
}
288+
#ifdef NRF_CRYPTOCELL
289+
keyset.keys_own.p_pk = (ble_gap_lesc_p256_pk_t*) (_pubkey+1);
290+
keyset.keys_peer.p_pk = (ble_gap_lesc_p256_pk_t*) (_peer_pubkey+1);
291+
#endif
294292

295293
VERIFY_STATUS(sd_ble_gap_sec_params_reply(conn_hdl, BLE_GAP_SEC_STATUS_SUCCESS,
296294
conn->getRole() == BLE_GAP_ROLE_PERIPH ? &_sec_param : NULL, &keyset), );
@@ -310,6 +308,7 @@ void BLEPairing::_eventHandler(ble_evt_t* evt)
310308
}
311309
break;
312310

311+
#ifdef NRF_CRYPTOCELL
313312
case BLE_GAP_EVT_LESC_DHKEY_REQUEST:
314313
{
315314
ble_gap_evt_lesc_dhkey_request_t* dhkey_req = &evt->evt.gap_evt.params.lesc_dhkey_request;
@@ -348,6 +347,7 @@ void BLEPairing::_eventHandler(ble_evt_t* evt)
348347
sd_ble_gap_lesc_dhkey_reply(conn_hdl, &dhkey);
349348
}
350349
break;
350+
#endif
351351

352352
// Pairing process completed
353353
case BLE_GAP_EVT_AUTH_STATUS:

libraries/Bluefruit52Lib/src/BLEPairing.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,11 @@ class BLEPairing
7373
private:
7474
ble_gap_sec_params_t _sec_param;
7575

76+
#ifdef NRF_CRYPTOCELL
7677
nRFCrypto_ECC_PrivateKey _private_key;
77-
7878
uint8_t _pubkey[1+BLE_GAP_LESC_P256_PK_LEN]; // our public key: 1 header + 64 data
7979
uint8_t _peer_pubkey[1+BLE_GAP_LESC_P256_PK_LEN]; // peer public key when using LESC
80+
#endif
8081

8182
bond_keys_t _bond_keys; // Shared keys with bonded device during securing connection, size ~ 80 bytes
8283

0 commit comments

Comments
 (0)