Keep input master key checking consistently (#501)

This commit is contained in:
Lu Wang
2016-09-06 11:21:05 +08:00
committed by Jonathan Hui
parent 5fbadbf445
commit 1e9d3c1dbf
+2 -2
View File
@@ -792,9 +792,9 @@ void Interpreter::ProcessMasterKey(int argc, char *argv[])
else
{
int keyLength;
uint8_t key[16];
uint8_t key[OT_MASTER_KEY_SIZE];
VerifyOrExit((keyLength = Hex2Bin(argv[0], key, sizeof(key))) >= 0, error = kThreadError_Parse);
VerifyOrExit((keyLength = Hex2Bin(argv[0], key, sizeof(key))) == OT_MASTER_KEY_SIZE, error = kThreadError_Parse);
SuccessOrExit(error = otSetMasterKey(key, static_cast<uint8_t>(keyLength)));
}