[key-manager] add Pskc class (#4174)

This commit adds a `Pskc` as a wrapper over `otPskc` and also
renames all the uses of `PSK` into `Psk` to follow our variable
and type naming convention which treats an acronym as a whole
word.
This commit is contained in:
Abtin Keshavarzian
2019-09-18 19:11:07 -07:00
committed by Jonathan Hui
parent 1ac791b79d
commit 1555b21910
30 changed files with 167 additions and 124 deletions
+2 -2
View File
@@ -45,7 +45,7 @@ void TestMinimumPassphrase(void)
0xcc, 0xd1, 0xe4, 0xc0, 0x1d, 0x01, 0x54, 0xf8};
const char passphrase[] = "123456";
otInstance * instance = testInitInstance();
SuccessOrQuit(ot::MeshCoP::Commissioner::GeneratePSKc(passphrase, "OpenThread",
SuccessOrQuit(ot::MeshCoP::Commissioner::GeneratePskc(passphrase, "OpenThread",
static_cast<const ot::Mac::ExtendedPanId &>(sXPanId), pskc),
"TestMinimumPassphrase failed to generate PSKc");
VerifyOrQuit(memcmp(pskc, expectedPskc, sizeof(pskc)) == 0, "TestMinimumPassphrase got wrong pskc");
@@ -75,7 +75,7 @@ void TestMaximumPassphrase(void)
"123456781234567";
otInstance *instance = testInitInstance();
SuccessOrQuit(ot::MeshCoP::Commissioner::GeneratePSKc(passphrase, "OpenThread",
SuccessOrQuit(ot::MeshCoP::Commissioner::GeneratePskc(passphrase, "OpenThread",
static_cast<const ot::Mac::ExtendedPanId &>(sXPanId), pskc),
"TestMaximumPassphrase failed to generate PSKc");
VerifyOrQuit(memcmp(pskc, expectedPskc, sizeof(pskc)) == 0, "TestMaximumPassphrase got wrong pskc");