summaryrefslogtreecommitdiff
path: root/unit
diff options
context:
space:
mode:
Diffstat (limited to 'unit')
-rw-r--r--unit/test-ecc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/unit/test-ecc.c b/unit/test-ecc.c
index 98400a253..d9136814d 100644
--- a/unit/test-ecc.c
+++ b/unit/test-ecc.c
@@ -94,7 +94,10 @@ static int test_sample(uint8_t priv_a[32], uint8_t priv_b[32],
uint8_t dhkey_a[32], dhkey_b[32];
int fails = 0;
+ memset(dhkey_a, 0, sizeof(dhkey_a));
ecdh_shared_secret(pub_b, priv_a, dhkey_a);
+
+ memset(dhkey_b, 0, sizeof(dhkey_b));
ecdh_shared_secret(pub_a, priv_b, dhkey_b);
if (g_test_verbose()) {
@@ -110,6 +113,7 @@ static int test_sample(uint8_t priv_a[32], uint8_t priv_b[32],
tester_debug("DHKey A matches :)");
}
+
if (memcmp(dhkey_b, dhkey, 32)) {
tester_debug("DHKey B doesn't match!");
fails++;