[key-manager] add Pskc::Clear() method (#4315)

This commit is contained in:
Abtin Keshavarzian
2019-12-04 12:42:33 -08:00
committed by Jonathan Hui
parent 56d3a469b2
commit 57f5044c9a
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ KeyManager::KeyManager(Instance &aInstance)
, mIsPskcSet(false)
{
mMasterKey = static_cast<const MasterKey &>(kDefaultMasterKey);
memset(&mPskc, 0, sizeof(mPskc));
mPskc.Clear();
ComputeKey(mKeySequence, mKey);
}
+6
View File
@@ -97,6 +97,12 @@ OT_TOOL_PACKED_BEGIN
class Pskc : public otPskc
{
public:
/**
* This method clears the PSKc (sets all bytes to zero).
*
*/
void Clear(void) { memset(this, 0, sizeof(*this)); }
/**
* This method evaluates whether or not the Thread PSKc values match.
*