b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| 2 | From: Eneas U de Queiroz <cote2004-github@yahoo.com> |
| 3 | Date: Mon, 11 Mar 2019 10:15:14 -0300 |
| 4 | Subject: e_devcrypto: ignore error when closing session |
| 5 | |
| 6 | In cipher_init, ignore an eventual error when closing the previous |
| 7 | session. It may have been closed by another process after a fork. |
| 8 | |
| 9 | Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com> |
| 10 | |
| 11 | --- a/engines/e_devcrypto.c |
| 12 | +++ b/engines/e_devcrypto.c |
| 13 | @@ -211,9 +211,8 @@ static int cipher_init(EVP_CIPHER_CTX *c |
| 14 | int ret; |
| 15 | |
| 16 | /* cleanup a previous session */ |
| 17 | - if (cipher_ctx->sess.ses != 0 && |
| 18 | - clean_devcrypto_session(&cipher_ctx->sess) == 0) |
| 19 | - return 0; |
| 20 | + if (cipher_ctx->sess.ses != 0) |
| 21 | + clean_devcrypto_session(&cipher_ctx->sess); |
| 22 | |
| 23 | cipher_ctx->sess.cipher = cipher_d->devcryptoid; |
| 24 | cipher_ctx->sess.keylen = cipher_d->keylen; |