fb69599aeb0207a39d39e69a458a307757eef80a
[oweals/openwrt.git] / package / libs / openssl / patches / 510-e_devcrypto-ignore-error-when-closing-session.patch
1 From b6e6d157367bae91a8015434769572e430257d40 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: [PATCH] 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 @@ -197,9 +197,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;