File tree Expand file tree Collapse file tree 3 files changed +40
-0
lines changed
features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 1
1
/* Copyright (c) 2009-2019 Arm Limited
2
+ * Copyright (c) 2019-2020 Packetcraft, Inc.
2
3
* SPDX-License-Identifier: Apache-2.0
3
4
*
4
5
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -252,6 +253,17 @@ void SmpDmMsgSend(smpDmMsg_t *pMsg);
252
253
/*************************************************************************************************/
253
254
void SmpDmEncryptInd (wsfMsgHdr_t * pMsg );
254
255
256
+ /*************************************************************************************************/
257
+ /*!
258
+ * \brief Check if LE Secure Connections is enabled on the connection.
259
+ *
260
+ * \param connId Connection identifier.
261
+ *
262
+ * \return TRUE is Secure Connections is enabled, else FALSE
263
+ */
264
+ /*************************************************************************************************/
265
+ bool_t SmpDmLescEnabled (dmConnId_t connId );
266
+
255
267
/*************************************************************************************************/
256
268
/*!
257
269
* \brief Return the STK for the given connection.
Original file line number Diff line number Diff line change 1
1
/* Copyright (c) 2009-2019 Arm Limited
2
+ * Copyright (c) 2019-2020 Packetcraft, Inc.
2
3
* SPDX-License-Identifier: Apache-2.0
3
4
*
4
5
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -117,6 +118,12 @@ void dmSecHciHandler(hciEvt_t *pEvent)
117
118
return ;
118
119
}
119
120
}
121
+ else if (SmpDmLescEnabled (pCcb -> connId ) == TRUE)
122
+ {
123
+ /* EDIV and Rand must be zero in LE Secure Connections */
124
+ HciLeLtkReqNegReplCmd (pEvent -> hdr .param );
125
+ return ;
126
+ }
120
127
121
128
/* call callback to get key from app */
122
129
Original file line number Diff line number Diff line change @@ -695,6 +695,27 @@ uint8_t smpGetScSecLevel(smpCcb_t *pCcb)
695
695
return secLevel ;
696
696
}
697
697
698
+ /*************************************************************************************************/
699
+ /*!
700
+ * \brief Check if LE Secure Connections is enabled on the connection.
701
+ *
702
+ * \param connId Connection identifier.
703
+ *
704
+ * \return TRUE is Secure Connections is enabled, else FALSE
705
+ */
706
+ /*************************************************************************************************/
707
+ bool_t SmpDmLescEnabled (dmConnId_t connId )
708
+ {
709
+ smpCcb_t * pCcb = smpCcbByConnId (connId );
710
+
711
+ if (pCcb == NULL || pCcb -> pScCcb == NULL )
712
+ {
713
+ return FALSE;
714
+ }
715
+
716
+ return pCcb -> pScCcb -> lescEnabled ;
717
+ }
718
+
698
719
/*************************************************************************************************/
699
720
/*!
700
721
* \brief Return the STK for the given connection.
You can’t perform that action at this time.
0 commit comments