Mistake on this page?
Report an issue in GitHub or email us
dm_sec.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief DM security module.
6  *
7  * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved.
8  *
9  * Copyright (c) 2019 Packetcraft, Inc.
10  *
11  * Licensed under the Apache License, Version 2.0 (the "License");
12  * you may not use this file except in compliance with the License.
13  * You may obtain a copy of the License at
14  *
15  * http://www.apache.org/licenses/LICENSE-2.0
16  *
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS,
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permissions and
21  * limitations under the License.
22  */
23 /*************************************************************************************************/
24 #ifndef DM_SEC_H
25 #define DM_SEC_H
26 
27 #include "wsf_os.h"
28 #include "smp_api.h"
29 #include "dm_main.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 /**************************************************************************************************
36  Macros
37 **************************************************************************************************/
38 
39 /* DM sec event handler messages */
40 enum
41 {
42  DM_SEC_MSG_API_ENCRYPT_REQ = DM_MSG_START(DM_ID_SEC),
43  DM_SEC_MSG_API_LTK_RSP
44 };
45 
46 /* DM lesc sec event handler messages */
47 enum
48 {
49  DM_SEC_MSG_CALC_OOB_CNF = DM_MSG_START(DM_ID_LESC),
50  DM_SEC_MSG_ECC_KEY_CNF
51 };
52 
53 /**************************************************************************************************
54  Data types
55 **************************************************************************************************/
56 
57 /* Data type for DM_SEC_MSG_API_ENCRYPT_REQ */
58 typedef struct
59 {
60  wsfMsgHdr_t hdr;
61  dmSecLtk_t ltk;
62  uint8_t secLevel;
64 
65 /* Data type for DM_SEC_MSG_API_LTK_RSP */
66 typedef struct
67 {
68  wsfMsgHdr_t hdr;
69  uint8_t key[SMP_KEY_LEN];
70  bool_t keyFound;
71  uint8_t secLevel;
73 
74 typedef union
75 {
76  wsfMsgHdr_t hdr;
77  dmSecApiEncryptReq_t encryptReq;
78  dmSecApiLtkRsp_t ltkRsp;
79 } dmSecMsg_t;
80 
81 /* Security control block type */
82 typedef struct
83 {
84  uint8_t *pIrk;
85  uint8_t *pCsrk;
86 } dmSecCb_t;
87 
88 /**************************************************************************************************
89  Global Variables
90 **************************************************************************************************/
91 
92 /* Control block */
93 extern dmSecCb_t dmSecCb;
94 
95 /**************************************************************************************************
96  Function declarations
97 **************************************************************************************************/
98 
99 /* component interface */
100 void dmSecHciHandler(hciEvt_t *pEvent);
101 void dmSecMsgHandler(dmSecMsg_t *pMsg);
102 void dmSecReset(void);
103 
104 /* component interface */
105 void dmSecLescMsgHandler(dmSecMsg_t *pMsg);
106 
107 #ifdef __cplusplus
108 };
109 #endif
110 
111 #endif /* DM_SEC_H */
#define SMP_KEY_LEN
Key length.
Definition: smp_defs.h:183
Union of all event types.
Definition: hci_api.h:931
LTK data type.
Definition: dm_api.h:600
DM main module.
SMP subsystem API.
Software foundation OS API.
Common message structure passed to event handler.
Definition: wsf_os.h:106
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.