You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
3.2 KiB

  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. Exit:
  23. if (cctx != NULL)
  24. - EVP_CIPHER_CTX_cleanup(cctx);
  25. + EVP_CIPHER_CTX_reset(cctx);
  26. if (hctx != NULL)
  27. HMAC_CTX_free(hctx);
  28. return ret;
  29. @@ -1011,7 +1012,7 @@ int ptls_openssl_decrypt_ticket(ptls_buf
  30. Exit:
  31. if (cctx != NULL)
  32. - EVP_CIPHER_CTX_cleanup(cctx);
  33. + EVP_CIPHER_CTX_reset(cctx);
  34. if (hctx != NULL)
  35. HMAC_CTX_free(hctx);
  36. return ret;
  37. --- a/src/main.c
  38. +++ b/src/main.c
  39. @@ -45,6 +45,7 @@
  40. #include <sys/types.h>
  41. #include <sys/un.h>
  42. #include <sys/wait.h>
  43. +#include <openssl/dh.h>
  44. #include <openssl/crypto.h>
  45. #include <openssl/err.h>
  46. #include <openssl/ssl.h>
  47. @@ -1827,7 +1828,7 @@ static h2o_iovec_t on_extra_status(void
  48. " \"listeners\": %zu,\n"
  49. " \"worker-threads\": %zu,\n"
  50. " \"num-sessions\": %lu",
  51. - SSLeay_version(SSLEAY_VERSION), current_time, restart_time, (uint64_t)(now - conf.launch_time), generation,
  52. + OpenSSL_version(OPENSSL_VERSION), current_time, restart_time, (uint64_t)(now - conf.launch_time), generation,
  53. num_connections(0), conf.max_connections, conf.num_listeners, conf.num_threads, num_sessions(0));
  54. assert(ret.len < BUFSIZE);
  55. @@ -2008,7 +2009,7 @@ int main(int argc, char **argv)
  56. break;
  57. case 'v':
  58. printf("h2o version " H2O_VERSION "\n");
  59. - printf("OpenSSL: %s\n", SSLeay_version(SSLEAY_VERSION));
  60. + printf("OpenSSL: %s\n", OpenSSL_version(OPENSSL_VERSION));
  61. #if H2O_USE_MRUBY
  62. printf(
  63. "mruby: YES\n"); /* TODO determine the way to obtain the version of mruby (that is being linked dynamically) */
  64. --- a/src/ssl.c
  65. +++ b/src/ssl.c
  66. @@ -911,6 +911,7 @@ void ssl_setup_session_resumption(SSL_CT
  67. #endif
  68. }
  69. +#if OPENSSL_VERSION_NUMBER < 0x1010000fL && !defined(LIBRESSL_VERSION_NUMBER)
  70. static pthread_mutex_t *mutexes;
  71. static void lock_callback(int mode, int n, const char *file, int line)
  72. @@ -937,9 +938,11 @@ static int add_lock_callback(int *num, i
  73. return __sync_add_and_fetch(num, amount);
  74. }
  75. +#endif
  76. void init_openssl(void)
  77. {
  78. +#if OPENSSL_VERSION_NUMBER < 0x1010000fL && !defined(LIBRESSL_VERSION_NUMBER)
  79. int nlocks = CRYPTO_num_locks(), i;
  80. mutexes = h2o_mem_alloc(sizeof(*mutexes) * nlocks);
  81. for (i = 0; i != nlocks; ++i)
  82. @@ -953,6 +956,7 @@ void init_openssl(void)
  83. SSL_load_error_strings();
  84. SSL_library_init();
  85. OpenSSL_add_all_algorithms();
  86. +#endif
  87. cache_init_defaults();
  88. #if H2O_USE_SESSION_TICKETS