ble_sec.h
Go to the documentation of this file.
1 /**
2  ****************************************************************************************
3  *
4  * @file ble_sec.h
5  *
6  * @brief BLE SEC API
7  *
8  ****************************************************************************************
9  * @attention
10  #####Copyright (c) 2019 GOODIX
11  All rights reserved.
12 
13  Redistribution and use in source and binary forms, with or without
14  modification, are permitted provided that the following conditions are met:
15  * Redistributions of source code must retain the above copyright
16  notice, this list of conditions and the following disclaimer.
17  * Redistributions in binary form must reproduce the above copyright
18  notice, this list of conditions and the following disclaimer in the
19  documentation and/or other materials provided with the distribution.
20  * Neither the name of GOODIX nor the names of its contributors may be used
21  to endorse or promote products derived from this software without
22  specific prior written permission.
23 
24  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27  ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  POSSIBILITY OF SUCH DAMAGE.
35  *****************************************************************************************
36  */
37 
38 /**
39  * @addtogroup BLE
40  * @{
41  */
42 
43  /**
44  @addtogroup BLE_SEC Security Manager(SM)
45  @{
46  @brief Definitions and prototypes for the BLE_SEC interface.
47  */
48 
49 #ifndef __BLE_SEC_H__
50 #define __BLE_SEC_H__
51 
52 #include "ble_error.h"
53 #include <stdbool.h>
54 
55 /**@addtogroup BLE_SM_DEFINES Defines
56  * @{
57  */
58 /**@defgroup SEC_AUTH_FLAG SEC Auth Flag
59 * @{
60 */
61 #define AUTH_NONE 0 /**< No auth requirement. */
62 #define AUTH_BOND (1 << 0) /**< Bond flag. */
63 #define AUTH_MITM (1 << 2) /**< MITM flag. */
64 #define AUTH_SEC_CON (1 << 3) /**< Security connection flag. */
65 #define AUTH_KEY_PRESS_NOTIFY (1 << 4) /**< Key press notify flag. */
66 #define AUTH_ALL (AUTH_BOND | AUTH_MITM | AUTH_SEC_CON | AUTH_KEY_PRESS_NOTIFY) /**< All authentication flags are on. */
67 /**@} */
68 
69 /**@defgroup SEC_KEY_DIST_FLAG SEC Key Distribution Flag
70 * @{
71 */
72 #define KDIST_NONE 0 /**< No key needs to be distributed. */
73 #define KDIST_ENCKEY (1 << 0) /**< Distribute encryption and master identification info. */
74 #define KDIST_IDKEY (1 << 1) /**< Distribute identity and address info. */
75 #define KDIST_SIGNKEY (1 << 2) /**< Distribute signing info. */
76 #define KDIST_ALL (KDIST_ENCKEY | KDIST_IDKEY | KDIST_SIGNKEY) /**< Distribute all info. */
77 
78 /**@} */
79 /**@} */
80 
81 /**@addtogroup BLE_SEC_ENUMERATIONS Enumerations
82  * @{ */
83 /**@brief SEC IO Capability. */
84 typedef enum
85 {
86  IO_DISPLAY_ONLY = 0x00, /**< Display only. */
87  IO_DISPLAY_YES_NO = 0x01, /**< Display and input yes or no. */
88  IO_KEYBOARD_ONLY = 0x02, /**< Keyboard only. */
89  IO_NO_INPUT_NO_OUTPUT = 0x03, /**< No input and no output. */
90  IO_KEYBOARD_DISPLAY = 0x04 /**< Keyboard and display. */
92 
93 /**@brief SEC Encryption Request Type.
94  *@note These types indicate some operations need to interact with app during pair process.
95  */
96 typedef enum
97 {
98  PAIR_REQ, /**< Pair request. Apps need to decide whether to accept this request. */
99  TK_REQ, /**< TK request. Apps need to set the TK value. */
100  OOB_REQ, /**< OOB request. Apps need to set the OOB value. */
101  NC_REQ /**< Number comparison request. Apps need to check if it is the same number displayed in Master and Slave. */
103 
104 /**@brief SEC Key Press Notify. */
105 typedef enum
106 {
107  KEY_PRESS_STARTED = 0x00, /**< Passkey entry started. */
108  KEY_PRESS_ENTERED = 0x01, /**< Passkey digit entered. */
109  KEY_PRESS_ERASED = 0x02, /**< Passkey digit erased. */
110  KEY_PRESS_CLEARED = 0x03, /**< Passkey cleared. */
111  KEY_PRESS_COMPLETED = 0x04 /**< Passkey entry completed. */
113 
114 /**@brief SEC pair result. */
115 typedef enum
116 {
117  ENC_SUCCESS = 0x00, /**< Encrypt success. */
118  ENC_FAIL_PASSKEY_ENTRY_FAIL = 0x01, /**< The user input of passkey failed, for example, the user cancelled the operation. */
119  ENC_FAIL_OOB_NOT_AVAILBL = 0x02, /**< The OOB data is not available. */
120  ENC_FAIL_AUTH_REQ = 0x03, /**< The pairing procedure cannot be performed as authentication requirements cannot be met
121  due to IO incapability of one or both devices. */
122  ENC_FAIL_CONFIRM_VAL_FAIL = 0x04, /**< The confirm value does not match the calculated compare value. */
123  ENC_FAIL_PAIRING_NOT_SUPPORT = 0x05, /**< Pairing is not supported by the device. */
124  ENC_FAIL_ENCRPT_KEY_SIZE = 0x06, /**< The resultant encryption key size is insufficient for the security requirements of this device. */
125  ENC_FAIL_COMMAND_NOT_SUPPORT = 0x07, /**< The SMP command received is not supported on this device. */
126  ENC_FAIL_UNSPECIFIED = 0x08, /**< Pairing failed due to an unspecified reason. */
127  ENC_FAIL_REPEAT_ATTEMPT = 0x09, /**< Pairing or authentication procedure is disallowed because too little time has elapsed
128  since last pairing request or security request. */
129  ENC_FAIL_INVALID_PARAM = 0x0A, /**< The Invalid Parameters error code indicates that the command length is invalid
130  or that a parameter is outside of the specified range. */
131  ENC_FAIL_DHKEY_CHECK_FAIL = 0x0B, /**< Indicate to the remote device that the DHKey Check value received doesn't match the one calculated
132  by the local device. */
133  ENC_FAIL_NUM_CMP_FAIL = 0x0C, /**< Indicate that the confirm values in the numeric comparison protocol do not match. */
134  ENC_FAIL_BR_EDR_IN_PROGRESS = 0x0D, /**< Indicate that the pairing over the LE transport failed due to
135  a Pairing Request sent over the BR/EDR transport in process. */
136  ENC_FAIL_KEY_DRIV_GEN_NOT_ALLOW = 0x0E, /**< Indicate that the BR/EDR Link Key generated on the BR/EDR transport
137  cannot be used to derive and distribute keys for the LE transport. */
138  ENC_FAIL_LTK_MISSING = 0x0F, /**< Indicate the LTK of peer devices missing. */
139 } sec_enc_ind_t;
140 
141 /**@brief SEC mode and level. */
142 typedef enum
143 {
144  SEC_MODE1_LEVEL1 = 0x00, /**< No security is needed. */
145  SEC_MODE1_LEVEL2 = 0x01, /**< Encrypted link is required. Unnecessary: MITM and SC. */
146  SEC_MODE1_LEVEL3 = 0x02, /**< Encrypted link is required. Necessary: MITM; unnecessary: SC. */
147  SEC_MODE1_LEVEL4 = 0x03, /**< Encrypted link is required. Necessary: MITM and SC. */
148  SEC_MODE2_LEVEL1 = 0x04, /**< Data signing is required. Unnecessary: MITM and SC. */
149  SEC_MODE2_LEVEL2 = 0x05, /**< Data signing is required. Necessary: MITM; unnecessary: SC. */
151 
152 /**@brief SEC TK type. */
153 typedef enum
154 {
155  SEC_TK_OOB = 0x00, /**<TK got from OOB (out of band) method. */
156  SEC_TK_DISPLAY, /**<TK generated and shall be displayed by local device. */
157  SEC_TK_KEY_ENTRY /**<TK shall be entered by user using device keyboard. */
159 
160 /**@brief Key missing reason. */
161 typedef enum
162 {
163  BOND_INFO_LOAD_FAILED = 0x00, /**<Bond information load failed. */
164  LTK_VALID_MASK_ERR, /**<LTK valid mask flag is false. */
165  EDIV_RAND_VALUE_ERR /**<Ediv and rand value not match. */
167 /** @} */
168 
169 /**@addtogroup BLE_SEC_STRUCTURES Structures
170  * @{ */
171 /**@brief SEC Parameter. */
172 typedef struct
173 {
174  sec_mode_level_t level; /**< Set the minimum security level of the device, see @ref sec_mode_level_t. */
175  sec_io_cap_t io_cap; /**< Set the IO capability, see @ref sec_io_cap_t. */
176  bool oob; /**< Indicate whether OOB is supported. */
177  uint8_t auth; /**< Set the auth, see @ref SEC_AUTH_FLAG. */
178  uint8_t key_size; /**< Indicate the supported maximum LTK size (range: 7-16). */
179  uint8_t ikey_dist; /**< Set the initial key distribution, see @ref SEC_KEY_DIST_FLAG. */
180  uint8_t rkey_dist; /**< Set the response key distribution, see @ref SEC_KEY_DIST_FLAG. */
181 } sec_param_t;
182 
183 /**@brief TK value. */
184 typedef struct
185 {
186  uint8_t key[16]; /**< TK value. */
187 } sec_tk_t;
188 
189 /**@brief SEC OOB value. */
190 typedef struct
191 {
192  uint8_t conf[16]; /**< Confirm value. */
193  uint8_t rand[16]; /**< Random value. */
194 } sec_oob_t;
195 
196 /**@brief SEC Confirm encryption data. */
197 typedef union
198 {
199  sec_tk_t tk; /**< TK value, see @ref sec_tk_t. */
200  sec_oob_t oob; /**< OOB value, see @ref sec_oob_t. */
202 
203 /**@brief SEC Confirm encryption. */
204 typedef struct
205 {
206  sec_enc_req_type_t req_type; /**< Request type, see @ref sec_enc_req_type_t. */
207  bool accept; /**< Indicate whether to accept the request. */
208  sec_cfm_enc_data_t data; /**< SEC Confirm encryption data, see @ref sec_cfm_enc_data_t. */
209 } sec_cfm_enc_t;
210 
211 /**@brief SEC number comparison value. */
212 typedef struct
213 {
214  uint8_t value[4]; /**< Number comparison value (000000~999999). */
215 } sec_nc_t;
216 
217 /**@brief SEC encryption request data. */
218 typedef union
219 {
220  sec_tk_type_t tk_type; /**<TK type, see @ref sec_tk_type_t. */
221  sec_oob_t oob_data; /**<OOB data, see @ref sec_oob_t. */
222  sec_nc_t nc_data; /**<Number comparison data, see @ref sec_nc_t. */
224 
225 /**@brief SEC encryption request. */
226 typedef struct
227 {
228  sec_enc_req_type_t req_type; /**< Indicate the request type, @ref sec_enc_req_type_t. */
229  sec_enc_req_data_t data; /**< SEC encryption request data, @ref sec_enc_req_data_t. */
230 } sec_enc_req_t;
231 
232 /**@brief SEC register call back. */
233 typedef struct
234 {
235  void (*app_sec_enc_req_cb)(uint8_t conn_idx, sec_enc_req_t *p_enc_req); /**< Security manager module receives encryption request callback. */
236  void (*app_sec_enc_ind_cb)(uint8_t conn_idx, sec_enc_ind_t enc_ind, uint8_t auth); /**< Security manager module receives encryption indication callback, see @ref SEC_AUTH_FLAG. */
237  void (*app_sec_keypress_notify_cb)(uint8_t conn_idx, sec_keypress_notify_t notify_type); /**< Security manager module receives key press notify callback. */
238  void (*app_sec_key_missing_cb)(uint8_t conn_idx, sec_key_missing_reason_t reason); /**< Security manager module receives key missing callback, see @ref sec_key_missing_reason_t. */
239 } sec_cb_fun_t;
240 /** @} */
241 
242 /** @addtogroup BLE_SEC_FUNCTIONS Functions
243  * @{ */
244 /**
245  ****************************************************************************************
246  * @brief Set security parameter.
247  *
248  * @param[in] p_sec_param Pointer to the security parameter structure, @ref sec_param_t.
249  *
250  * @retval ::SDK_SUCCESS: The security parameter is successfully set to the BLE stack.
251  * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
252  * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
253  ****************************************************************************************
254  */
255 uint16_t ble_sec_params_set(sec_param_t *p_sec_param);
256 
257 /**
258  ****************************************************************************************
259  * @brief Start security encryption, this interface is used by both slave and master
260  *
261  * @note If the local device role is master, it will check that if the peer device is bonded firstly. If the peer device is bonded,
262  * the stack will encrypt the link directly, otherwise the stack will send a pair request to the peer device.
263  * During the pairing, the callback @ref sec_cb_fun_t::app_sec_enc_req_cb may be called.
264  * After the link has been encrypted, the callback @ref sec_cb_fun_t::app_sec_enc_ind_cb will be called.
265  * @note If the local device role is slave, the stack will send a security request to the peer device.
266  *
267  * @param[in] conn_idx ACL connection index, the first ACL connection index is 0, and increased one by one.
268  *
269  * @retval ::SDK_SUCCESS: The security encryption is successfully set to the BLE stack.
270  * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
271  ****************************************************************************************
272  */
273 uint16_t ble_sec_enc_start(uint8_t conn_idx);
274 
275 /**
276  ****************************************************************************************
277  * @brief Send the encrypt confirm information
278  * @note This function should be called in the handle of callback @ref sec_cb_fun_t::app_sec_enc_req_cb.
279  *
280  * @param[in] conn_idx ACL connection index, the first ACL connection index is 0, and increased one by one.
281  * @param[in] p_cfm_enc Pointer to the confirm encryption structure, see @ref sec_cfm_enc_t.
282  *
283  * @retval ::SDK_SUCCESS: The confirm encryption is successfully set to the BLE stack.
284  * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
285  * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
286  * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
287  ****************************************************************************************
288  */
289 uint16_t ble_sec_enc_cfm(uint8_t conn_idx, const sec_cfm_enc_t *p_cfm_enc);
290 
291 /**
292  ****************************************************************************************
293  * @brief Send key press notify
294  *
295  * @param[in] conn_idx ACL connection index. The first ACL connection index is 0, and the index will be increased one by one.
296  * @param[in] notify_type Key press notify type, see @ref sec_keypress_notify_t.
297  *
298  * @retval ::SDK_SUCCESS: The key press notify type is successfully set to the BLE stack.
299  * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
300  * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
301  ****************************************************************************************
302  */
303 uint16_t ble_sec_keypress_notify_send(uint8_t conn_idx, uint8_t notify_type);
304 /** @} */
305 
306 #endif
307 
308 /** @} */
309 /** @} */
SEC_MODE1_LEVEL2
@ SEC_MODE1_LEVEL2
Encrypted link is required.
Definition: ble_sec.h:145
sec_enc_req_data_t::oob_data
sec_oob_t oob_data
OOB data, see sec_oob_t.
Definition: ble_sec.h:221
sec_cfm_enc_t::req_type
sec_enc_req_type_t req_type
Request type, see sec_enc_req_type_t.
Definition: ble_sec.h:206
sec_param_t::oob
bool oob
Indicate whether OOB is supported.
Definition: ble_sec.h:176
ENC_FAIL_CONFIRM_VAL_FAIL
@ ENC_FAIL_CONFIRM_VAL_FAIL
The confirm value does not match the calculated compare value.
Definition: ble_sec.h:122
KEY_PRESS_STARTED
@ KEY_PRESS_STARTED
Passkey entry started.
Definition: ble_sec.h:107
SEC_MODE1_LEVEL1
@ SEC_MODE1_LEVEL1
No security is needed.
Definition: ble_sec.h:144
sec_enc_req_type_t
sec_enc_req_type_t
SEC Encryption Request Type.
Definition: ble_sec.h:97
ENC_FAIL_UNSPECIFIED
@ ENC_FAIL_UNSPECIFIED
Pairing failed due to an unspecified reason.
Definition: ble_sec.h:126
ble_sec_enc_cfm
uint16_t ble_sec_enc_cfm(uint8_t conn_idx, const sec_cfm_enc_t *p_cfm_enc)
Send the encrypt confirm information.
sec_param_t::auth
uint8_t auth
Set the auth, see SEC Auth Flag.
Definition: ble_sec.h:177
PAIR_REQ
@ PAIR_REQ
Pair request.
Definition: ble_sec.h:98
sec_tk_t
TK value.
Definition: ble_sec.h:185
ENC_FAIL_PAIRING_NOT_SUPPORT
@ ENC_FAIL_PAIRING_NOT_SUPPORT
Pairing is not supported by the device.
Definition: ble_sec.h:123
sec_keypress_notify_t
sec_keypress_notify_t
SEC Key Press Notify.
Definition: ble_sec.h:106
sec_nc_t
SEC number comparison value.
Definition: ble_sec.h:213
sec_cfm_enc_t
SEC Confirm encryption.
Definition: ble_sec.h:205
sec_enc_req_t::data
sec_enc_req_data_t data
SEC encryption request data, sec_enc_req_data_t.
Definition: ble_sec.h:229
sec_oob_t
SEC OOB value.
Definition: ble_sec.h:191
SEC_TK_DISPLAY
@ SEC_TK_DISPLAY
TK generated and shall be displayed by local device.
Definition: ble_sec.h:156
sec_cfm_enc_data_t::oob
sec_oob_t oob
OOB value, see sec_oob_t.
Definition: ble_sec.h:200
ble_sec_keypress_notify_send
uint16_t ble_sec_keypress_notify_send(uint8_t conn_idx, uint8_t notify_type)
Send key press notify.
sec_param_t::key_size
uint8_t key_size
Indicate the supported maximum LTK size (range: 7-16).
Definition: ble_sec.h:178
sec_cfm_enc_data_t::tk
sec_tk_t tk
TK value, see sec_tk_t.
Definition: ble_sec.h:199
IO_DISPLAY_YES_NO
@ IO_DISPLAY_YES_NO
Display and input yes or no.
Definition: ble_sec.h:87
KEY_PRESS_ERASED
@ KEY_PRESS_ERASED
Passkey digit erased.
Definition: ble_sec.h:109
sec_io_cap_t
sec_io_cap_t
SEC IO Capability.
Definition: ble_sec.h:85
KEY_PRESS_CLEARED
@ KEY_PRESS_CLEARED
Passkey cleared.
Definition: ble_sec.h:110
ENC_SUCCESS
@ ENC_SUCCESS
Encrypt success.
Definition: ble_sec.h:117
ble_sec_params_set
uint16_t ble_sec_params_set(sec_param_t *p_sec_param)
Set security parameter.
sec_enc_req_data_t::nc_data
sec_nc_t nc_data
Number comparison data, see sec_nc_t.
Definition: ble_sec.h:222
SEC_TK_KEY_ENTRY
@ SEC_TK_KEY_ENTRY
TK shall be entered by user using device keyboard.
Definition: ble_sec.h:157
LTK_VALID_MASK_ERR
@ LTK_VALID_MASK_ERR
LTK valid mask flag is false.
Definition: ble_sec.h:164
ENC_FAIL_REPEAT_ATTEMPT
@ ENC_FAIL_REPEAT_ATTEMPT
Pairing or authentication procedure is disallowed because too little time has elapsed since last pair...
Definition: ble_sec.h:127
SEC_MODE2_LEVEL1
@ SEC_MODE2_LEVEL1
Data signing is required.
Definition: ble_sec.h:148
sec_tk_type_t
sec_tk_type_t
SEC TK type.
Definition: ble_sec.h:154
IO_KEYBOARD_ONLY
@ IO_KEYBOARD_ONLY
Keyboard only.
Definition: ble_sec.h:88
sec_cfm_enc_data_t
SEC Confirm encryption data.
Definition: ble_sec.h:198
sec_key_missing_reason_t
sec_key_missing_reason_t
Key missing reason.
Definition: ble_sec.h:162
ble_error.h
File that contains error codes.
SEC_MODE1_LEVEL4
@ SEC_MODE1_LEVEL4
Encrypted link is required.
Definition: ble_sec.h:147
sec_param_t
SEC Parameter.
Definition: ble_sec.h:173
TK_REQ
@ TK_REQ
TK request.
Definition: ble_sec.h:99
ENC_FAIL_LTK_MISSING
@ ENC_FAIL_LTK_MISSING
Indicate the LTK of peer devices missing.
Definition: ble_sec.h:138
sec_cb_fun_t
SEC register call back.
Definition: ble_sec.h:234
SEC_TK_OOB
@ SEC_TK_OOB
TK got from OOB (out of band) method.
Definition: ble_sec.h:155
sec_enc_req_data_t
SEC encryption request data.
Definition: ble_sec.h:219
sec_param_t::ikey_dist
uint8_t ikey_dist
Set the initial key distribution, see SEC Key Distribution Flag.
Definition: ble_sec.h:179
sec_param_t::rkey_dist
uint8_t rkey_dist
Set the response key distribution, see SEC Key Distribution Flag.
Definition: ble_sec.h:180
EDIV_RAND_VALUE_ERR
@ EDIV_RAND_VALUE_ERR
Ediv and rand value not match.
Definition: ble_sec.h:165
SEC_MODE1_LEVEL3
@ SEC_MODE1_LEVEL3
Encrypted link is required.
Definition: ble_sec.h:146
sec_enc_req_data_t::tk_type
sec_tk_type_t tk_type
TK type, see sec_tk_type_t.
Definition: ble_sec.h:220
ENC_FAIL_COMMAND_NOT_SUPPORT
@ ENC_FAIL_COMMAND_NOT_SUPPORT
The SMP command received is not supported on this device.
Definition: ble_sec.h:125
SEC_MODE2_LEVEL2
@ SEC_MODE2_LEVEL2
Data signing is required.
Definition: ble_sec.h:149
sec_enc_req_t::req_type
sec_enc_req_type_t req_type
Indicate the request type, sec_enc_req_type_t.
Definition: ble_sec.h:228
ble_sec_enc_start
uint16_t ble_sec_enc_start(uint8_t conn_idx)
Start security encryption, this interface is used by both slave and master.
ENC_FAIL_AUTH_REQ
@ ENC_FAIL_AUTH_REQ
The pairing procedure cannot be performed as authentication requirements cannot be met due to IO inca...
Definition: ble_sec.h:120
sec_cfm_enc_t::accept
bool accept
Indicate whether to accept the request.
Definition: ble_sec.h:207
ENC_FAIL_INVALID_PARAM
@ ENC_FAIL_INVALID_PARAM
The Invalid Parameters error code indicates that the command length is invalid or that a parameter is...
Definition: ble_sec.h:129
KEY_PRESS_ENTERED
@ KEY_PRESS_ENTERED
Passkey digit entered.
Definition: ble_sec.h:108
sec_cfm_enc_t::data
sec_cfm_enc_data_t data
SEC Confirm encryption data, see sec_cfm_enc_data_t.
Definition: ble_sec.h:208
sec_enc_req_t
SEC encryption request.
Definition: ble_sec.h:227
ENC_FAIL_ENCRPT_KEY_SIZE
@ ENC_FAIL_ENCRPT_KEY_SIZE
The resultant encryption key size is insufficient for the security requirements of this device.
Definition: ble_sec.h:124
IO_DISPLAY_ONLY
@ IO_DISPLAY_ONLY
Display only.
Definition: ble_sec.h:86
ENC_FAIL_BR_EDR_IN_PROGRESS
@ ENC_FAIL_BR_EDR_IN_PROGRESS
Indicate that the pairing over the LE transport failed due to a Pairing Request sent over the BR/EDR ...
Definition: ble_sec.h:134
sec_mode_level_t
sec_mode_level_t
SEC mode and level.
Definition: ble_sec.h:143
sec_enc_ind_t
sec_enc_ind_t
SEC pair result.
Definition: ble_sec.h:116
sec_param_t::level
sec_mode_level_t level
Set the minimum security level of the device, see sec_mode_level_t.
Definition: ble_sec.h:174
ENC_FAIL_DHKEY_CHECK_FAIL
@ ENC_FAIL_DHKEY_CHECK_FAIL
Indicate to the remote device that the DHKey Check value received doesn't match the one calculated by...
Definition: ble_sec.h:131
NC_REQ
@ NC_REQ
Number comparison request.
Definition: ble_sec.h:101
BOND_INFO_LOAD_FAILED
@ BOND_INFO_LOAD_FAILED
Bond information load failed.
Definition: ble_sec.h:163
ENC_FAIL_NUM_CMP_FAIL
@ ENC_FAIL_NUM_CMP_FAIL
Indicate that the confirm values in the numeric comparison protocol do not match.
Definition: ble_sec.h:133
KEY_PRESS_COMPLETED
@ KEY_PRESS_COMPLETED
Passkey entry completed.
Definition: ble_sec.h:111
sec_param_t::io_cap
sec_io_cap_t io_cap
Set the IO capability, see sec_io_cap_t.
Definition: ble_sec.h:175
IO_NO_INPUT_NO_OUTPUT
@ IO_NO_INPUT_NO_OUTPUT
No input and no output.
Definition: ble_sec.h:89
IO_KEYBOARD_DISPLAY
@ IO_KEYBOARD_DISPLAY
Keyboard and display.
Definition: ble_sec.h:90
ENC_FAIL_OOB_NOT_AVAILBL
@ ENC_FAIL_OOB_NOT_AVAILBL
The OOB data is not available.
Definition: ble_sec.h:119
ENC_FAIL_KEY_DRIV_GEN_NOT_ALLOW
@ ENC_FAIL_KEY_DRIV_GEN_NOT_ALLOW
Indicate that the BR/EDR Link Key generated on the BR/EDR transport cannot be used to derive and dist...
Definition: ble_sec.h:136
ENC_FAIL_PASSKEY_ENTRY_FAIL
@ ENC_FAIL_PASSKEY_ENTRY_FAIL
The user input of passkey failed, for example, the user cancelled the operation.
Definition: ble_sec.h:118
OOB_REQ
@ OOB_REQ
OOB request.
Definition: ble_sec.h:100