aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/crypto_ia32/main.c
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2019-04-29 17:27:24 +0200
committerDamjan Marion <dmarion@me.com>2019-10-22 14:06:15 +0000
commit78af0a8c5ff1a33ff8dccb1b2ea6ffadb8ef7b62 (patch)
tree91fd5bd5662b76f8fe79754b99cf912742f3169b /src/plugins/crypto_ia32/main.c
parentc41217ab85f8bdd68db717e95eecb5edc58d620b (diff)
vppinfra: add clib_mem_free_s
IPsec zero-es all allocated key memory including memory sur-allocated by the allocator. Move it to its own function in clib mem infra to make it easier to instrument. Type: refactor Change-Id: Icd1c44d18b741e723864abce75ac93e2eff74b61 Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/plugins/crypto_ia32/main.c')
-rw-r--r--src/plugins/crypto_ia32/main.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/plugins/crypto_ia32/main.c b/src/plugins/crypto_ia32/main.c
index cca5fb4cf64..194182fd57a 100644
--- a/src/plugins/crypto_ia32/main.c
+++ b/src/plugins/crypto_ia32/main.c
@@ -40,9 +40,7 @@ crypto_ia32_key_handler (vlib_main_t * vm, vnet_crypto_key_op_t kop,
if (cm->key_data[idx] == 0)
return;
- clib_memset_u8 (cm->key_data[idx], 0,
- clib_mem_size (cm->key_data[idx]));
- clib_mem_free (cm->key_data[idx]);
+ clib_mem_free_s (cm->key_data[idx]);
cm->key_data[idx] = 0;
return;
}
@@ -51,9 +49,7 @@ crypto_ia32_key_handler (vlib_main_t * vm, vnet_crypto_key_op_t kop,
if (kop == VNET_CRYPTO_KEY_OP_MODIFY && cm->key_data[idx])
{
- clib_memset_u8 (cm->key_data[idx], 0,
- clib_mem_size (cm->key_data[idx]));
- clib_mem_free (cm->key_data[idx]);
+ clib_mem_free_s (cm->key_data[idx]);
}
cm->key_data[idx] = cm->key_fn[key->alg] (key);