[error] add missing IgnoreError (#4931)

This commit is contained in:
Abtin Keshavarzian
2020-05-06 22:05:25 -07:00
committed by Jonathan Hui
parent 64dfe6349c
commit 612e10e664
9 changed files with 40 additions and 38 deletions
+6 -6
View File
@@ -68,13 +68,13 @@ void TestMacBeaconFrame(void)
VerifyOrQuit(instance != NULL, "Null OpenThread instance");
aesCcm.SetKey(key, sizeof(key));
aesCcm.Init(headerLength, payloadLength, tagLength, nonce, sizeof(nonce));
SuccessOrQuit(aesCcm.Init(headerLength, payloadLength, tagLength, nonce, sizeof(nonce)), "AesCcm::Init() failed");
aesCcm.Header(test, headerLength);
aesCcm.Finalize(test + headerLength, &tagLength);
VerifyOrQuit(memcmp(test, encrypted, sizeof(encrypted)) == 0, "TestMacBeaconFrame encrypt failed");
aesCcm.Init(headerLength, payloadLength, tagLength, nonce, sizeof(nonce));
SuccessOrQuit(aesCcm.Init(headerLength, payloadLength, tagLength, nonce, sizeof(nonce)), "AesCcm::Init() failed");
aesCcm.Header(test, headerLength);
aesCcm.Finalize(test + headerLength, &tagLength);
@@ -119,18 +119,18 @@ void TestMacCommandFrame()
ot::Crypto::AesCcm aesCcm;
aesCcm.SetKey(key, sizeof(key));
aesCcm.Init(headerLength, payloadLength, tagLength, nonce, sizeof(nonce));
SuccessOrQuit(aesCcm.Init(headerLength, payloadLength, tagLength, nonce, sizeof(nonce)), "AesCcm::Init() failed");
aesCcm.Header(test, headerLength);
aesCcm.Payload(test + headerLength, test + headerLength, payloadLength, true);
aesCcm.Finalize(test + headerLength + payloadLength, &tagLength);
VerifyOrQuit(memcmp(test, encrypted, sizeof(encrypted)) == 0, "TestMacCommandFrame encrypt failed\n");
VerifyOrQuit(memcmp(test, encrypted, sizeof(encrypted)) == 0, "TestMacCommandFrame encrypt failed");
aesCcm.Init(headerLength, payloadLength, tagLength, nonce, sizeof(nonce));
SuccessOrQuit(aesCcm.Init(headerLength, payloadLength, tagLength, nonce, sizeof(nonce)), "AesCcm::Init() failed");
aesCcm.Header(test, headerLength);
aesCcm.Payload(test + headerLength, test + headerLength, payloadLength, false);
aesCcm.Finalize(test + headerLength + payloadLength, &tagLength);
VerifyOrQuit(memcmp(test, decrypted, sizeof(decrypted)) == 0, "TestMacCommandFrame decrypt failed\n");
VerifyOrQuit(memcmp(test, decrypted, sizeof(decrypted)) == 0, "TestMacCommandFrame decrypt failed");
}
int main(void)