sm.h (192365fe946dbe3e26ccb56693fe89136846edf6) sm.h (c59d0c922ec07b51eaa2e772aaa1603bba92fa2e)
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 228 unchanged lines hidden (view full) ---

237 * without entry for Central device stored in LE Device DB
238 * @note BTstack in Peripheral Role (Responder) supports LE Legacy Pairing without a persistent LE Device DB as
239 * the LTK is reconstructed from a local secret IRK and EDIV + Random stored on Central (Initiator) device
240 * On the downside, it's not really possible to delete a pairing if this is enabled.
241 * @param allow encryption using reconstructed LTK without stored entry (Default: 1)
242 */
243void sm_allow_ltk_reconstruction_without_le_device_db_entry(int allow);
244
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 228 unchanged lines hidden (view full) ---

237 * without entry for Central device stored in LE Device DB
238 * @note BTstack in Peripheral Role (Responder) supports LE Legacy Pairing without a persistent LE Device DB as
239 * the LTK is reconstructed from a local secret IRK and EDIV + Random stored on Central (Initiator) device
240 * On the downside, it's not really possible to delete a pairing if this is enabled.
241 * @param allow encryption using reconstructed LTK without stored entry (Default: 1)
242 */
243void sm_allow_ltk_reconstruction_without_le_device_db_entry(int allow);
244
245/**
246 * @brief Generate OOB data for LE Secure Connections
247 * @note This generates a 128 bit random number ra and then calculates Ca = f4(PKa, PKa, ra, 0)
248 * New OOB data should be generated for each pairing
249 * @param callback
250 * @returns status
251 */
252uint8_t sm_generate_sc_oob_data(void (*callback)(const uint8_t * confirm_value, const uint8_t * random_value));
253
245/* API_END */
246
247// PTS testing
248void sm_test_set_irk(sm_key_t irk);
249void sm_test_use_fixed_local_csrk(void);
250void sm_test_use_fixed_ec_keypair(void);
251
252#ifdef ENABLE_TESTING_SUPPORT
253void sm_test_set_pairing_failure(int reason);
254#endif
255
256#if defined __cplusplus
257}
258#endif
259
260#endif // __SM_H
254/* API_END */
255
256// PTS testing
257void sm_test_set_irk(sm_key_t irk);
258void sm_test_use_fixed_local_csrk(void);
259void sm_test_use_fixed_ec_keypair(void);
260
261#ifdef ENABLE_TESTING_SUPPORT
262void sm_test_set_pairing_failure(int reason);
263#endif
264
265#if defined __cplusplus
266}
267#endif
268
269#endif // __SM_H