Move PSKc generation functionality to Commissioner role. (#1327)

This commit is contained in:
Jonathan Hui
2017-02-15 23:10:44 -08:00
committed by GitHub
parent bf21420cd0
commit 87bbf4a83a
14 changed files with 83 additions and 107 deletions
+19
View File
@@ -222,6 +222,25 @@ OTAPI ThreadError OTCALL otSendMgmtCommissionerSet(otInstance *, const otCommiss
*/
OTAPI uint16_t OTCALL otCommissionerGetSessionId(otInstance *);
/**
* This method generates PSKc.
*
* PSKc is used to establish the Commissioner Session.
*
* @param[in] aInstance A pointer to an OpenThread instance.
* @param[in] aPassPhrase The commissioning passphrase.
* @param[in] aNetworkName The network name for PSKc computation.
* @param[in] aExtPanId The extended pan id for PSKc computation.
* @param[out] aPSKc A pointer to where the generated PSKc will be placed.
*
* @retval kThreadErrorNone Successfully generate PSKc.
* @retval kThreadError_InvalidArgs If any of the input arguments is invalid.
*
*/
OTAPI ThreadError OTCALL otCommissionerGeneratePSKc(otInstance *aInstance, const char *aPassPhrase,
const char *aNetworkName, const uint8_t *aExtPanId,
uint8_t *aPSKc);
/**
* @}
*
-1
View File
@@ -249,7 +249,6 @@ typedef struct otMeshLocalPrefix
#define OT_COMMISSIONING_PASSPHRASE_MIN_SIZE 6 ///< Minimum size of the Commissioning Passphrase
#define OT_COMMISSIONING_PASSPHRASE_MAX_SIZE 255 ///< Maximum size of the Commissioning Passphrase
#define OT_COMMISSIONING_PASSPHRASE_DEFAULT "OpenThreadPassphrase" ///< The default commissioning passphrase
/**
* This structure represents PSKc.
-18
View File
@@ -639,24 +639,6 @@ OTAPI const uint8_t *OTCALL otGetMasterKey(otInstance *aInstance, uint8_t *aKeyL
*/
OTAPI ThreadError OTCALL otSetMasterKey(otInstance *aInstance, const uint8_t *aKey, uint8_t aKeyLength);
/**
* This method generates PSKc.
*
* PSKc is used to establish the Commissioner Session.
*
* @param[in] aInstance A pointer to an OpenThread instance.
* @param[in] aPassPhrase The commissioning passphrase.
* @param[in] aNetworkName The network name for PSKc computation.
* @param[in] aExtPanId The extended pan id for PSKc computation.
* @param[out] aPSKc A pointer to where the generated PSKc will be placed.
*
* @retval kThreadErrorNone Successfully generate PSKc.
* @retval kThreadError_InvalidArgs If any of the input arguments is invalid.
*
*/
OTAPI ThreadError OTCALL otGeneratePSKc(otInstance *aInstance, const char *aPassPhrase, const char *aNetworkName,
const uint8_t *aExtPanId, uint8_t *aPSKc);
/**
* This function returns the maximum transmit power setting in dBm.
*