100-use-1.0.2k-threadids.patch 727 B

1234567891011121314151617181920212223242526272829303132333435
  1. --- a/lib/crypto.c 2016-12-21 07:57:44.000000000 -0700
  2. +++ b/lib/crypto.c 2017-03-24 13:19:34.188259018 -0600
  3. @@ -51,11 +51,20 @@
  4. }
  5. }
  6. +#if OPENSSL_VERSION_NUMBER < 0x10000000
  7. static unsigned long
  8. ssl_thread_id(void)
  9. {
  10. return (unsigned long) get_thread_id();
  11. }
  12. +
  13. +#else
  14. +static void
  15. +ssl_thread_id2(CRYPTO_THREADID *id)
  16. +{
  17. + CRYPTO_THREADID_set_numeric(id, get_thread_id());
  18. +}
  19. +#endif
  20. static void
  21. crypto_init_threading(void)
  22. @@ -68,7 +76,11 @@
  23. {
  24. g_static_mutex_init(&ssl_locks[i]);
  25. }
  26. +#if OPENSSL_VERSION_NUMBER < 0x10000000
  27. CRYPTO_set_id_callback(ssl_thread_id);
  28. +#else
  29. + CRYPTO_THREADID_set_callback(ssl_thread_id2);
  30. +#endif
  31. CRYPTO_set_locking_callback(ssl_locking_callback);
  32. }