[key-manager] add MasterKey class (wrapper over otMasterKey) (#4150)

The `MasterKey` class mainly provides overloads of operators `==`
and `!=` which help simplfy the code comparing keys.
This commit is contained in:
Abtin Keshavarzian
2019-09-09 18:07:41 -07:00
committed by Jonathan Hui
parent 472a03af88
commit 0b220613ab
7 changed files with 61 additions and 30 deletions
+1 -1
View File
@@ -131,7 +131,7 @@ otError otThreadSetMasterKey(otInstance *aInstance, const otMasterKey *aKey)
VerifyOrExit(aKey != NULL, error = OT_ERROR_INVALID_ARGS);
VerifyOrExit(instance.Get<Mle::MleRouter>().GetRole() == OT_DEVICE_ROLE_DISABLED, error = OT_ERROR_INVALID_STATE);
error = instance.Get<KeyManager>().SetMasterKey(*aKey);
error = instance.Get<KeyManager>().SetMasterKey(*static_cast<const MasterKey *>(aKey));
instance.Get<MeshCoP::ActiveDataset>().Clear();
instance.Get<MeshCoP::PendingDataset>().Clear();