diff options
author | Neale Ranns <nranns@cisco.com> | 2019-04-14 20:48:55 +0000 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-04-16 15:53:26 +0000 |
commit | 58dcf5c5e6728250a61e9a498972d896308d9624 (patch) | |
tree | 8f70ca2a8b9737866a8cdf7c2bd5da38782d0831 /src | |
parent | 8f63c2ebe655e7cd27236f2327d2e9082f782f9b (diff) |
crypto-openssl-gcm: account for failed decrypts
Change-Id: I749c5a9d58128fd6d0fb8284e56b8f89cf91c609
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 1b1d1e9e84b007721a0c2ae2092df7cea662e09d)
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/crypto_openssl/main.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/plugins/crypto_openssl/main.c b/src/plugins/crypto_openssl/main.c index 9a78cb46dd9..71dff03d416 100644 --- a/src/plugins/crypto_openssl/main.c +++ b/src/plugins/crypto_openssl/main.c @@ -136,7 +136,7 @@ openssl_ops_dec_gcm (vlib_main_t * vm, vnet_crypto_op_t * ops[], u32 n_ops, openssl_per_thread_data_t *ptd = vec_elt_at_index (per_thread_data, vm->thread_index); EVP_CIPHER_CTX *ctx = ptd->evp_cipher_ctx; - u32 i; + u32 i, n_fail = 0; for (i = 0; i < n_ops; i++) { vnet_crypto_op_t *op = ops[i]; @@ -152,9 +152,12 @@ openssl_ops_dec_gcm (vlib_main_t * vm, vnet_crypto_op_t * ops[], u32 n_ops, if (EVP_DecryptFinal_ex (ctx, op->dst + len, &len) > 0) op->status = VNET_CRYPTO_OP_STATUS_COMPLETED; else - op->status = VNET_CRYPTO_OP_STATUS_FAIL_DECRYPT; + { + n_fail++; + op->status = VNET_CRYPTO_OP_STATUS_FAIL_DECRYPT; + } } - return n_ops; + return n_ops - n_fail; } static_always_inline u32 |