Diff between b22a2596433ec2ff862b5efc103de0bb35e5a041 and 6811debb9da24f94a417d2bb425d3bdc07cb9e99

Changed Files

File Additions Deletions Status
unit/test-ecc.c +4 -0 modified

Full Patch

diff --git a/unit/test-ecc.c b/unit/test-ecc.c
index 98400a2..d913681 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++;