![]() |
![]() |
|
TI BLE5-Stack API Documentation
9.11.01
|
This file contains the interface to the SM.
Go to the source code of this file.
Data Structures | |
| struct | authReq_t |
| struct | keyDist_t |
| struct | smDhKeyEvt_t |
| struct | smEccKeys_t |
| struct | smEccKeysEvt_t |
| struct | smEventHdr_t |
| struct | smIdentityInfo_t |
| struct | smLinkSecurityReq_t |
| struct | smNewRandKeyEvent_t |
| struct | smSecurityInfo_t |
| struct | smSigningInfo_t |
Macros | |
| #define | DISPLAY_ONLY 0x00 |
| Display Only Device. More... | |
| #define | DISPLAY_YES_NO 0x01 |
| Display and Yes and No Capable. More... | |
| #define | KEYBOARD_DISPLAY 0x04 |
| Both Keyboard and Display Capable. More... | |
| #define | KEYBOARD_ONLY 0x02 |
| Keyboard Only. More... | |
| #define | NO_INPUT_NO_OUTPUT 0x03 |
| No Display or Input Device. More... | |
| #define | PASSKEY_LEN 6 |
| Passkey Character Length (ASCII Characters) More... | |
| #define | SM_AUTH_MITM_MASK(a) (((a) & 0x04) >> 2) |
| MITM Mask. More... | |
| #define | SM_AUTH_REQ_BONDING 0x01 |
| Bonding. More... | |
| #define | SM_AUTH_REQ_NO_BONDING 0x00 |
| No bonding. More... | |
| #define | SM_AUTH_STATE_AUTHENTICATED 0x04 |
| Authenticate requested. More... | |
| #define | SM_AUTH_STATE_BONDING 0x01 |
| Bonding requested. More... | |
| #define | SM_AUTH_STATE_SECURECONNECTION 0x08 |
| Secure Connection requested. More... | |
| #define | SM_DH_KEY_EVENT 0x01 |
| Diffie-Hellman key. More... | |
| #define | SM_ECC_KEY_LEN 32 |
| ECC Key length in bytes. More... | |
| #define | SM_ECC_KEYS_EVENT 0x00 |
| ECC Keys. More... | |
| #define | SM_ECC_KEYS_NOT_AVAILABLE 0xFF |
| Initial state of recycled keys before they exist. More... | |
| #define | SM_ECC_KEYS_REGENERATE_ALWAYS 0x00 |
| Always regenerate the keys. More... | |
| #define | SM_ECC_KEYS_REGNENERATE_NEVER 0xFF |
| Never regenerate the keys. More... | |
| #define | SM_PASSKEY_TYPE_DISPLAY 0x02 |
| Display the passkey. More... | |
| #define | SM_PASSKEY_TYPE_INPUT 0x01 |
| Input the passkey. More... | |
Typedefs | |
| typedef void(* | smCB_t) (uint8 *secretKey, uint8 *publicKeyX, uint8 *publicKeyY) |
Functions | |
| bStatus_t | SM_Encrypt (uint8 *pKey, uint8 *pPlainText, uint8 *pResult) |
| Encrypt the plain text data with the key.. More... | |
| bStatus_t | SM_GenerateAuthenSig (uint8 *pData, uint16 len, uint8 *pAuthenSig, uint16 connHandle) |
| void | SM_GenerateRandBuf (uint8 *random, uint8 len) |
| uint8 | SM_GetAllowDebugKeysMode (void) |
| Get the device debug keys allownce policy. If not allowed, the pairing will be rejected with code of invalid parameters. If allowed, pairing will continue noramlly. More... | |
| uint8 | SM_GetAuthenPairingOnlyMode (void) |
| Get the device into Authenticated Pairing Only Mode. If enabled and the key generation method does not result in a key that provides Authenticated MITM protection then the device will send the Pairing Failed command with the error code Authentication Requirements. More... | |
| bStatus_t | SM_GetDHKey (uint8 *secretKey, uint8 *publicKeyX, uint8 *publicKeyY) |
| Request a Diffie-Hellman key from the ECC engine. Key is returned through a SM_DH_KEY_EVENT event passed in the task the Security Manager has been registered into using SM_RegisterTask(). More... | |
| bStatus_t | SM_GetEccKeys (void) |
| Get ECC private and public keys. Keys are returned through a SM_ECC_KEYS_EVENT event passed in the task the Security Manager has been registered into using SM_RegisterTask(). More... | |
| bStatus_t | SM_GetScConfirmOob (uint8 *publicKey, uint8 *oob, uint8 *pOut) |
| Generate a confirm value for OOB data. More... | |
| bStatus_t | SM_InitiatorInit (void) |
| Initialize SM Initiator on a central device. More... | |
| bStatus_t | SM_NewRandKey (uint8 taskID) |
| Generate a key with a random value. More... | |
| bStatus_t | SM_PasskeyUpdate (uint8 *pPasskey, uint16 connectionHandle) |
| Update the passkey for the pairing process. More... | |
| void | SM_RegisterTask (uint8 taskID) |
| Register Task with the Security Manager to receive ECC keys or a ECDH shared secret. More... | |
| bStatus_t | SM_ResponderInit (void) |
| Initialize SM Responder on a peripheral device. More... | |
| void | SM_SetAllowDebugKeysMode (uint8 state) |
| void | SM_SetAuthenPairingOnlyMode (uint8 state) |
| void | SM_SetECCRegenerationCount (uint8 count) |
| Update the regeneration count for ECC key re-usage. More... | |
| bStatus_t | SM_StartEncryption (uint16 connHandle, uint8 *pLTK, uint16 div, uint8 *pRandNum, uint8 keyLen) |
| Send Start Encrypt through HCI. More... | |
| bStatus_t | SM_StartPairing (uint8 initiator, uint8 taskID, uint16 connectionHandle, smLinkSecurityReq_t *pSecReqs) |
| Start the pairing process. More... | |
| bStatus_t | SM_VerifyAuthenSig (uint16 connHandle, uint8 authentication, uint8 *pData, uint16 len, uint8 *pAuthenSig) |
| Verify an Authentication Signature. More... | |
| typedef void(* smCB_t) (uint8 *secretKey, uint8 *publicKeyX, uint8 *publicKeyY) |
Application callback to the SM for ECC keys and Diffie-Hellman Shared Secret (ECDH).
| bStatus_t SM_Encrypt | ( | uint8 * | pKey, |
| uint8 * | pPlainText, | ||
| uint8 * | pResult | ||
| ) |
Encrypt the plain text data with the key..
| pKey | - key data |
| pPlainText | - Plain text data |
| pResult | - place to put the encrypted result |
| bStatus_t SM_GenerateAuthenSig | ( | uint8 * | pData, |
| uint16 | len, | ||
| uint8 * | pAuthenSig, | ||
| uint16 | connHandle | ||
| ) |
Generate an outgoing Authentication Signature.
| pData | message data |
| len | length of pData |
| pAuthenSig | place to put new signature |
| connHandle | connection handle |
| void SM_GenerateRandBuf | ( | uint8 * | random, |
| uint8 | len | ||
| ) |
| SM_GetAllowDebugKeysMode | ( | void | ) |
Get the device debug keys allownce policy. If not allowed, the pairing will be rejected with code of invalid parameters. If allowed, pairing will continue noramlly.
| none |
| SM_GetAuthenPairingOnlyMode | ( | void | ) |
Get the device into Authenticated Pairing Only Mode. If enabled and the key generation method does not result in a key that provides Authenticated MITM protection then the device will send the Pairing Failed command with the error code Authentication Requirements.
| none |
| bStatus_t SM_GetDHKey | ( | uint8 * | secretKey, |
| uint8 * | publicKeyX, | ||
| uint8 * | publicKeyY | ||
| ) |
Request a Diffie-Hellman key from the ECC engine. Key is returned through a SM_DH_KEY_EVENT event passed in the task the Security Manager has been registered into using SM_RegisterTask().
| secretKey | - the local private key |
| publicKeyX | - the remote public key, X-Coordinate. |
| publicKeyY | - the remote public key, Y-Coordinate. |
| bStatus_t SM_GetEccKeys | ( | void | ) |
Get ECC private and public keys. Keys are returned through a SM_ECC_KEYS_EVENT event passed in the task the Security Manager has been registered into using SM_RegisterTask().
| bStatus_t SM_GetScConfirmOob | ( | uint8 * | publicKey, |
| uint8 * | oob, | ||
| uint8 * | pOut | ||
| ) |
Generate a confirm value for OOB data.
| publicKey | - the local public key X-coordinate |
| oob | - the random string to be sent to the remote device via oob |
| pOut | - pointer to the generated confirm value. The calling application must copy this data into its own buffer. |
| bStatus_t SM_InitiatorInit | ( | void | ) |
Initialize SM Initiator on a central device.
| bStatus_t SM_NewRandKey | ( | uint8 | taskID | ) |
Generate a key with a random value.
| taskID | - task ID to send results. |
| bStatus_t SM_PasskeyUpdate | ( | uint8 * | pPasskey, |
| uint16 | connectionHandle | ||
| ) |
Update the passkey for the pairing process.
| pPasskey | - pointer to the 6 digit passkey |
| connectionHandle | - connection handle to link. |
| void SM_RegisterTask | ( | uint8 | taskID | ) |
Register Task with the Security Manager to receive ECC keys or a ECDH shared secret.
| taskID | - Application's task ID. |
| bStatus_t SM_ResponderInit | ( | void | ) |
Initialize SM Responder on a peripheral device.
| void SM_SetAllowDebugKeysMode | ( | uint8 | state | ) |
| void SM_SetAuthenPairingOnlyMode | ( | uint8 | state | ) |
| void SM_SetECCRegenerationCount | ( | uint8 | count | ) |
Update the regeneration count for ECC key re-usage.
| count | - number of times a keypair can be reused before regeneration. |
| bStatus_t SM_StartEncryption | ( | uint16 | connHandle, |
| uint8 * | pLTK, | ||
| uint16 | div, | ||
| uint8 * | pRandNum, | ||
| uint8 | keyLen | ||
| ) |
Send Start Encrypt through HCI.
| connHandle | - Connection Handle |
| pLTK | - pointer to 16 byte lkt |
| div | - div or ediv |
| pRandNum | - pointer to 8 byte random number |
| keyLen | - length of LTK (bytes) |
| bStatus_t SM_StartPairing | ( | uint8 | initiator, |
| uint8 | taskID, | ||
| uint16 | connectionHandle, | ||
| smLinkSecurityReq_t * | pSecReqs | ||
| ) |
Start the pairing process.
This function is also called if the device is already bound.
| initiator | - TRUE to start pairing as Initiator. |
| taskID | - task ID to send results. |
| connectionHandle | - Link's connection handle |
| pSecReqs | - Security parameters for pairing |
| bStatus_t SM_VerifyAuthenSig | ( | uint16 | connHandle, |
| uint8 | authentication, | ||
| uint8 * | pData, | ||
| uint16 | len, | ||
| uint8 * | pAuthenSig | ||
| ) |
Verify an Authentication Signature.
| connHandle | - connection to verify against. |
| authentication | - TRUE if requires an authenticated CSRK, FALSE if not |
| pData | - message data |
| len | - length of pData |
| pAuthenSig | - message signature to verify |