mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-07 13:03:45 +02:00
Self-test fixes for new packet armor/dearmor functions that combine old encrypt and MAC functions.
This commit is contained in:
parent
0dca9964bf
commit
141b858737
1 changed files with 3 additions and 12 deletions
15
selftest.cpp
15
selftest.cpp
|
@ -321,18 +321,9 @@ static int testPacket()
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
a.compress();
|
a.armor(salsaKey,true);
|
||||||
a.encrypt(salsaKey);
|
if (!a.dearmor(salsaKey)) {
|
||||||
a.decrypt(salsaKey);
|
std::cout << "FAIL (encrypt-decrypt/verify)" << std::endl;
|
||||||
a.uncompress();
|
|
||||||
if (a != b) {
|
|
||||||
std::cout << "FAIL (encrypt-decrypt)" << std::endl;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
a.macSet(hmacKey);
|
|
||||||
if (!a.macVerify(hmacKey)) {
|
|
||||||
std::cout << "FAIL (macVerify)" << std::endl;
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue