File: 0006-OpenSSL-related-api-fixes.patch

package info (click to toggle)
c-icap 1%3A0.5.10-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,804 kB
  • sloc: ansic: 27,757; sh: 4,450; makefile: 252; perl: 95; awk: 10
file content (35 lines) | stat: -rw-r--r-- 1,113 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From: Christos Tsantilas <christos@chtsanti.net>
Date: Mon, 10 Apr 2023 10:43:56 +0300
Subject: OpenSSL related api fixes

- The OpenSSL functions ERR_load_*_strings() are deprecated since OpenSSL-1.1.0
- FILE structures returned by popen must be released using the pclose
---
 openssl/net_io_ssl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/openssl/net_io_ssl.c b/openssl/net_io_ssl.c
index 9acc6f1..7e58f72 100644
--- a/openssl/net_io_ssl.c
+++ b/openssl/net_io_ssl.c
@@ -187,7 +187,7 @@ static int openssl_cert_passphrase_cb(char *buf, int size, int rwflag, void *u)
 
     FILE *f = popen(script, "r");
     int bytes = fread(buf, 1, size, f);
-    fclose(f);
+    pclose(f);
 
     if (bytes <= 0) {
         ci_debug_printf(1, "Error reading key passphrase from '%s'\n", script);
@@ -376,9 +376,11 @@ void ci_tls_init()
         return;
 
     SSL_library_init();
+#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
     ERR_load_BIO_strings();
     ERR_load_crypto_strings();
     ERR_load_SSL_strings();
+#endif
     OpenSSL_add_all_algorithms();
 
     if (!init_openssl_mutexes()) {