87792cf9d07f3780f68f35195f68b0db19060976
[openwrt/openwrt.git] / package / libs / openssl / patches / 510-e_devcrypto-ignore-error-when-closing-session.patch
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 @@ -195,9 +195,8 @@ static int cipher_init(EVP_CIPHER_CTX *c
14 get_cipher_data(EVP_CIPHER_CTX_nid(ctx));
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;