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.

61 lines
1.8 KiB

  1. diff --git a/imap/src/osdep/unix/ssl_unix.c b/imap/src/osdep/unix/ssl_unix.c
  2. index 4c4d6ef..f2df2f2 100644
  3. --- a/imap/src/osdep/unix/ssl_unix.c
  4. +++ b/imap/src/osdep/unix/ssl_unix.c
  5. @@ -33,9 +33,9 @@
  6. #include <bio.h>
  7. #include <crypto.h>
  8. #include <rand.h>
  9. -#ifdef OPENSSL_1_1_0
  10. #include <rsa.h>
  11. #include <bn.h>
  12. +#ifdef OPENSSL_1_1_0
  13. #ifdef TLSv1_1_client_method
  14. #undef TLSv1_1_client_method
  15. #endif /* TLSv1_1_client_method */
  16. @@ -862,22 +862,16 @@ static RSA *ssl_genkey (SSL_CTX_TYPE *con,int export,int keylength)
  17. static RSA *key = NIL;
  18. if (!key) { /* if don't have a key already */
  19. /* generate key */
  20. -#ifdef OPENSSL_1_1_0
  21. BIGNUM *e = BN_new();
  22. if (!RSA_generate_key_ex (key, export ? keylength : 1024, e,NIL)) {
  23. -#else
  24. - if (!(key = RSA_generate_key (export ? keylength : 1024,RSA_F4,NIL,NIL))) {
  25. -#endif /* OPENSSL_1_1_0 */
  26. syslog (LOG_ALERT,"Unable to generate temp key, host=%.80s",
  27. tcp_clienthost ());
  28. while ((i = ERR_get_error ()) != 0L)
  29. syslog (LOG_ALERT,"SSL error status: %s",ERR_error_string (i,NIL));
  30. exit (1);
  31. }
  32. -#ifdef OPENSSL_1_1_0
  33. BN_free(e);
  34. e = NULL;
  35. -#endif /* OPENSSL_1_1_0 */
  36. }
  37. return key;
  38. }
  39. diff --git a/pith/smkeys.h b/pith/smkeys.h
  40. index e37eea3..a6c143b 100644
  41. --- a/pith/smkeys.h
  42. +++ b/pith/smkeys.h
  43. @@ -32,6 +32,8 @@
  44. #include <openssl/safestack.h>
  45. #include <openssl/conf.h>
  46. #include <openssl/x509v3.h>
  47. +#include <openssl/bn.h>
  48. +#include <openssl/rsa.h>
  49. #ifndef OPENSSL_1_1_0
  50. #define X509_get0_notBefore(x) ((x) && (x)->cert_info \
  51. @@ -47,9 +49,6 @@
  52. ? (x)->cert_info->validity->notAfter \
  53. : NULL)
  54. #define X509_REQ_get0_pubkey(x) (X509_REQ_get_pubkey((x)))
  55. -#else
  56. -#include <openssl/rsa.h>
  57. -#include <openssl/bn.h>
  58. #endif /* OPENSSL_1_1_0 */
  59. #define EMAILADDRLEADER "emailAddress="