summaryrefslogtreecommitdiff
path: root/tests/libntp/a_md5encrypt.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libntp/a_md5encrypt.c')
-rw-r--r--tests/libntp/a_md5encrypt.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/tests/libntp/a_md5encrypt.c b/tests/libntp/a_md5encrypt.c
index a87aa796de72e..844be16fa6f8c 100644
--- a/tests/libntp/a_md5encrypt.c
+++ b/tests/libntp/a_md5encrypt.c
@@ -52,11 +52,9 @@ test_Encrypt(void) {
packetPtr = emalloc_zero(totalLength * sizeof(*packetPtr));
memcpy(packetPtr, packet, packetLength);
- cache_secretsize = keyLength;
+ length = MD5authencrypt(keytype, key, keyLength, packetPtr, packetLength);
- length = MD5authencrypt(keytype, key, packetPtr, packetLength);
-
- TEST_ASSERT_TRUE(MD5authdecrypt(keytype, key, packetPtr, packetLength, length));
+ TEST_ASSERT_TRUE(MD5authdecrypt(keytype, key, keyLength, packetPtr, packetLength, length));
TEST_ASSERT_EQUAL(20, length);
TEST_ASSERT_EQUAL_MEMORY(expectedPacket.u8, packetPtr, totalLength);
@@ -66,14 +64,12 @@ test_Encrypt(void) {
void
test_DecryptValid(void) {
- cache_secretsize = keyLength;
- TEST_ASSERT_TRUE(MD5authdecrypt(keytype, key, expectedPacket.u32, packetLength, 20));
+ TEST_ASSERT_TRUE(MD5authdecrypt(keytype, key, keyLength, expectedPacket.u32, packetLength, 20));
}
void
test_DecryptInvalid(void) {
- cache_secretsize = keyLength;
- TEST_ASSERT_FALSE(MD5authdecrypt(keytype, key, invalidPacket.u32, packetLength, 20));
+ TEST_ASSERT_FALSE(MD5authdecrypt(keytype, key, keyLength, invalidPacket.u32, packetLength, 20));
}
void