From 8155cab62ef91316ece9e51d7ec41407f99fbe68 Mon Sep 17 00:00:00 2001 From: "matthias.ringwald@gmail.com" Date: Mon, 6 Jan 2014 11:57:23 +0000 Subject: [PATCH] added function prototypes for encryption, authentication, and authorization --- ble/sm.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ble/sm.h b/ble/sm.h index f1db6f161..b0d3df365 100644 --- a/ble/sm.h +++ b/ble/sm.h @@ -139,6 +139,16 @@ void sm_bonding_decline(uint8_t addr_type, bd_addr_t address); void sm_just_works_confirm(uint8_t addr_type, bd_addr_t address); void sm_passkey_input(uint8_t addr_type, bd_addr_t address, uint32_t passkey); +// @returns 0 if not encrypted, 7-16 otherwise +int sm_encryption_key_size(uint8_t addr_type, bd_addr_t address); + +// @returns 1 if bonded with OOB/Passekey AND MITM protection +int sm_authenticated(uint8_t addr_type, bd_addr_t address); + +// called by client app on authorization request +void sm_authorization_decline(uint8_t addr_type, bd_addr_t address); +void sm_authorization_grant(uint8_t addr_type, bd_addr_t address); + // Support for signed writes int sm_cmac_ready(); void sm_cmac_start(sm_key_t k, uint16_t message_len, uint8_t * message, void (*done_handler)(uint8_t hash[8]));