dnsdist: update to 1.9.0
[feed/packages.git] / libs / h2o / patches / 500-openssl.patch
1 --- a/deps/neverbleed/neverbleed.c
2 +++ b/deps/neverbleed/neverbleed.c
3 @@ -36,6 +36,7 @@
4 #include <sys/types.h>
5 #include <sys/uio.h>
6 #include <unistd.h>
7 +#include <openssl/engine.h>
8 #include <openssl/rand.h>
9 #include <openssl/ssl.h>
10 #include <openssl/rsa.h>
11 --- a/deps/picotls/lib/openssl.c
12 +++ b/deps/picotls/lib/openssl.c
13 @@ -36,6 +36,7 @@
14 #include <openssl/evp.h>
15 #include <openssl/objects.h>
16 #include <openssl/rand.h>
17 +#include <openssl/rsa.h>
18 #include <openssl/x509.h>
19 #include <openssl/x509v3.h>
20 #include <openssl/x509_vfy.h>
21 @@ -941,7 +942,7 @@ int ptls_openssl_encrypt_ticket(ptls_buf
22
23 Exit:
24 if (cctx != NULL)
25 - EVP_CIPHER_CTX_cleanup(cctx);
26 + EVP_CIPHER_CTX_reset(cctx);
27 if (hctx != NULL)
28 HMAC_CTX_free(hctx);
29 return ret;
30 @@ -1011,7 +1012,7 @@ int ptls_openssl_decrypt_ticket(ptls_buf
31
32 Exit:
33 if (cctx != NULL)
34 - EVP_CIPHER_CTX_cleanup(cctx);
35 + EVP_CIPHER_CTX_reset(cctx);
36 if (hctx != NULL)
37 HMAC_CTX_free(hctx);
38 return ret;
39 --- a/src/main.c
40 +++ b/src/main.c
41 @@ -45,6 +45,7 @@
42 #include <sys/types.h>
43 #include <sys/un.h>
44 #include <sys/wait.h>
45 +#include <openssl/dh.h>
46 #include <openssl/crypto.h>
47 #include <openssl/err.h>
48 #include <openssl/ssl.h>
49 @@ -1827,7 +1828,7 @@ static h2o_iovec_t on_extra_status(void
50 " \"listeners\": %zu,\n"
51 " \"worker-threads\": %zu,\n"
52 " \"num-sessions\": %lu",
53 - SSLeay_version(SSLEAY_VERSION), current_time, restart_time, (uint64_t)(now - conf.launch_time), generation,
54 + OpenSSL_version(OPENSSL_VERSION), current_time, restart_time, (uint64_t)(now - conf.launch_time), generation,
55 num_connections(0), conf.max_connections, conf.num_listeners, conf.num_threads, num_sessions(0));
56 assert(ret.len < BUFSIZE);
57
58 @@ -2008,7 +2009,7 @@ int main(int argc, char **argv)
59 break;
60 case 'v':
61 printf("h2o version " H2O_VERSION "\n");
62 - printf("OpenSSL: %s\n", SSLeay_version(SSLEAY_VERSION));
63 + printf("OpenSSL: %s\n", OpenSSL_version(OPENSSL_VERSION));
64 #if H2O_USE_MRUBY
65 printf(
66 "mruby: YES\n"); /* TODO determine the way to obtain the version of mruby (that is being linked dynamically) */
67 --- a/src/ssl.c
68 +++ b/src/ssl.c
69 @@ -911,6 +911,7 @@ void ssl_setup_session_resumption(SSL_CT
70 #endif
71 }
72
73 +#if OPENSSL_VERSION_NUMBER < 0x1010000fL && !defined(LIBRESSL_VERSION_NUMBER)
74 static pthread_mutex_t *mutexes;
75
76 static void lock_callback(int mode, int n, const char *file, int line)
77 @@ -937,9 +938,11 @@ static int add_lock_callback(int *num, i
78
79 return __sync_add_and_fetch(num, amount);
80 }
81 +#endif
82
83 void init_openssl(void)
84 {
85 +#if OPENSSL_VERSION_NUMBER < 0x1010000fL && !defined(LIBRESSL_VERSION_NUMBER)
86 int nlocks = CRYPTO_num_locks(), i;
87 mutexes = h2o_mem_alloc(sizeof(*mutexes) * nlocks);
88 for (i = 0; i != nlocks; ++i)
89 @@ -953,6 +956,7 @@ void init_openssl(void)
90 SSL_load_error_strings();
91 SSL_library_init();
92 OpenSSL_add_all_algorithms();
93 +#endif
94
95 cache_init_defaults();
96 #if H2O_USE_SESSION_TICKETS