summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2020-10-20 14:12:20 +0200
committerDamjan Marion <dmarion@me.com>2020-10-20 16:24:31 +0000
commit2531d50101991011fb1c7755d48f11b41f092628 (patch)
tree914a7341d4d65738378f6a1f211b018fa661cba3
parent6c3b2187229c3a685c073ae0909729ed4dffb66d (diff)
wireguard: reset secret data before freeing it
Type: fix Change-Id: I880bdd55ae5da0b9775a3fb548d44512348a7bc6 Signed-off-by: Benoît Ganne <bganne@cisco.com>
-rwxr-xr-xsrc/plugins/wireguard/wireguard_noise.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/wireguard/wireguard_noise.c b/src/plugins/wireguard/wireguard_noise.c
index 00b67109de4..850be2c86c8 100755
--- a/src/plugins/wireguard/wireguard_noise.c
+++ b/src/plugins/wireguard/wireguard_noise.c
@@ -161,8 +161,8 @@ noise_create_initiation (vlib_main_t * vm, noise_remote_t * r,
*s_idx = hs->hs_local_index;
ret = true;
error:
- vnet_crypto_key_del (vm, key_idx);
secure_zero_memory (key, NOISE_SYMMETRIC_KEY_LEN);
+ vnet_crypto_key_del (vm, key_idx);
return ret;
}
@@ -244,8 +244,8 @@ noise_consume_initiation (vlib_main_t * vm, noise_local_t * l,
ret = true;
error:
- vnet_crypto_key_del (vm, key_idx);
secure_zero_memory (key, NOISE_SYMMETRIC_KEY_LEN);
+ vnet_crypto_key_del (vm, key_idx);
secure_zero_memory (&hs, sizeof (hs));
return ret;
}
@@ -297,8 +297,8 @@ noise_create_response (vlib_main_t * vm, noise_remote_t * r, uint32_t * s_idx,
*s_idx = hs->hs_local_index;
ret = true;
error:
- vnet_crypto_key_del (vm, key_idx);
secure_zero_memory (key, NOISE_SYMMETRIC_KEY_LEN);
+ vnet_crypto_key_del (vm, key_idx);
secure_zero_memory (e, NOISE_PUBLIC_KEY_LEN);
return ret;
}
@@ -358,9 +358,9 @@ noise_consume_response (vlib_main_t * vm, noise_remote_t * r, uint32_t s_idx,
ret = true;
}
error:
- vnet_crypto_key_del (vm, key_idx);
secure_zero_memory (&hs, sizeof (hs));
secure_zero_memory (key, NOISE_SYMMETRIC_KEY_LEN);
+ vnet_crypto_key_del (vm, key_idx);
return ret;
}