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.

76 lines
2.2 KiB

  1. Must be rebased for 8.16
  2. --- a/sendmail/main.c
  3. +++ b/sendmail/main.c
  4. @@ -17,6 +17,9 @@
  5. #include <sm/xtrap.h>
  6. #include <sm/signal.h>
  7. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  8. +#define OpenSSL_version_num SSLeay
  9. +#endif
  10. #ifndef lint
  11. SM_UNUSED(static char copyright[]) =
  12. "@(#) Copyright (c) 1998-2013 Proofpoint, Inc. and its suppliers.\n\
  13. @@ -650,7 +653,7 @@ main(argc, argv, envp)
  14. sm_dprintf(" OpenSSL: compiled 0x%08x\n",
  15. (uint) OPENSSL_VERSION_NUMBER);
  16. sm_dprintf(" OpenSSL: linked 0x%08x\n",
  17. - (uint) SSLeay());
  18. + (uint) OpenSSL_version_num());
  19. }
  20. #endif /* STARTTLS */
  21. --- a/sendmail/tls.c
  22. +++ b/sendmail/tls.c
  23. @@ -16,9 +16,25 @@ SM_RCSID("@(#)$Id: tls.c,v 8.127 2013-11-27 02:51:11 gshapiro Exp $")
  24. # include <openssl/err.h>
  25. # include <openssl/bio.h>
  26. # include <openssl/pem.h>
  27. +# include <openssl/bn.h>
  28. +# include <openssl/dh.h>
  29. +# include <openssl/dsa.h>
  30. +# include <openssl/rsa.h>
  31. # ifndef HASURANDOMDEV
  32. # include <openssl/rand.h>
  33. # endif /* ! HASURANDOMDEV */
  34. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  35. +#define OpenSSL_version_num SSLeay
  36. +#endif
  37. +
  38. +#ifndef CRYPTO_thread_id
  39. +#define CRYPTO_thread_id() (0UL)
  40. +#endif
  41. +
  42. +#ifndef SSL_CTX_set_tmp_rsa_callback
  43. +#define SSL_CTX_set_tmp_rsa_callback(ctx, cb) while(0) (cb)(NULL, 0, 0)
  44. +#endif
  45. +
  46. # if !TLS_NO_RSA
  47. static RSA *rsa_tmp = NULL; /* temporary RSA key */
  48. static RSA *tmp_rsa_key __P((SSL *, int, int));
  49. @@ -380,6 +396,7 @@ init_tls_library(fipsmode)
  50. {
  51. bool bv;
  52. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  53. /* basic TLS initialization, ignore result for now */
  54. SSL_library_init();
  55. SSL_load_error_strings();
  56. @@ -388,6 +405,7 @@ init_tls_library(fipsmode)
  57. /* this is currently a macro for SSL_library_init */
  58. SSLeay_add_ssl_algorithms();
  59. # endif /* 0 */
  60. +#endif /* OPENSSL_VERSION_NUMBER */
  61. bv = tls_rand_init(RandFile, 7);
  62. # if _FFR_FIPSMODE
  63. @@ -1207,7 +1225,7 @@ inittls(ctx, req, options, srv, certfile, keyfile, cacertpath, cacertfile, dhpar
  64. ** just the compile time version.
  65. */
  66. - rt_version = SSLeay();
  67. + rt_version = OpenSSL_version_num();
  68. if (rt_version >= 0x00908000L && rt_version <= 0x0090802fL)
  69. {
  70. comp_methods = SSL_COMP_get_compression_methods();