From 41e831f5588fe5ebfd879f4e570e85e12770b360 Mon Sep 17 00:00:00 2001 From: Filip Tehlar Date: Mon, 24 Feb 2020 21:06:38 +0000 Subject: crypto-openssl: fix coverity warnings Type: fix Change-Id: Ia42ff39a0a33f89901b8333a9e6ca82ca9805cc6 Signed-off-by: Filip Tehlar --- src/plugins/crypto_openssl/main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/plugins/crypto_openssl') diff --git a/src/plugins/crypto_openssl/main.c b/src/plugins/crypto_openssl/main.c index 7775958f9cd..1dea1756df5 100644 --- a/src/plugins/crypto_openssl/main.c +++ b/src/plugins/crypto_openssl/main.c @@ -73,7 +73,7 @@ openssl_ops_enc_cbc (vlib_main_t * vm, vnet_crypto_op_t * ops[], { vnet_crypto_op_t *op = ops[i]; vnet_crypto_key_t *key = vnet_crypto_get_key (op->key_index); - int out_len; + int out_len = 0; int iv_len; if (op->op == VNET_CRYPTO_OP_3DES_CBC_ENC) @@ -140,7 +140,7 @@ openssl_ops_dec_cbc (vlib_main_t * vm, vnet_crypto_op_t * ops[], { vnet_crypto_op_t *op = ops[i]; vnet_crypto_key_t *key = vnet_crypto_get_key (op->key_index); - int out_len; + int out_len = 0; EVP_DecryptInit_ex (ctx, cipher, NULL, key->data, op->iv); @@ -196,7 +196,7 @@ openssl_ops_enc_gcm (vlib_main_t * vm, vnet_crypto_op_t * ops[], { vnet_crypto_op_t *op = ops[i]; vnet_crypto_key_t *key = vnet_crypto_get_key (op->key_index); - int len; + int len = 0; if (op->flags & VNET_CRYPTO_OP_FLAG_INIT_IV) RAND_bytes (op->iv, 8); @@ -238,7 +238,7 @@ openssl_ops_dec_gcm (vlib_main_t * vm, vnet_crypto_op_t * ops[], { vnet_crypto_op_t *op = ops[i]; vnet_crypto_key_t *key = vnet_crypto_get_key (op->key_index); - int len; + int len = 0; EVP_DecryptInit_ex (ctx, cipher, 0, 0, 0); EVP_CIPHER_CTX_ctrl (ctx, EVP_CTRL_GCM_SET_IVLEN, 12, 0); @@ -284,7 +284,7 @@ openssl_ops_hmac (vlib_main_t * vm, vnet_crypto_op_t * ops[], { vnet_crypto_op_t *op = ops[i]; vnet_crypto_key_t *key = vnet_crypto_get_key (op->key_index); - unsigned int out_len; + unsigned int out_len = 0; size_t sz = op->digest_len ? op->digest_len : EVP_MD_size (md); HMAC_Init_ex (ctx, key->data, vec_len (key->data), md, NULL); -- cgit 1.2.3-korg