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.

45 lines
1.2 KiB

  1. From a9f883cbc28b865d312918368772627cf9610a2f Mon Sep 17 00:00:00 2001
  2. From: Mark Andrews <marka@isc.org>
  3. Date: Tue, 16 Mar 2021 21:58:55 +0000
  4. Subject: [PATCH] Stop using deprecated calls in lib/isc/tls.c
  5. from Rosen Penev @neheb
  6. ---
  7. lib/isc/tls.c | 10 ++++++++++
  8. 1 file changed, 10 insertions(+)
  9. --- a/lib/isc/tls.c
  10. +++ b/lib/isc/tls.c
  11. @@ -12,10 +12,12 @@
  12. #include <inttypes.h>
  13. #include <nghttp2/nghttp2.h>
  14. +#include <openssl/bn.h>
  15. #include <openssl/conf.h>
  16. #include <openssl/err.h>
  17. #include <openssl/opensslv.h>
  18. #include <openssl/rand.h>
  19. +#include <openssl/rsa.h>
  20. #include <isc/atomic.h>
  21. #include <isc/log.h>
  22. @@ -274,11 +276,19 @@ isc_tlsctx_createserver(const char *keyf
  23. rsa = NULL;
  24. ASN1_INTEGER_set(X509_get_serialNumber(cert), 1);
  25. +#if OPENSSL_VERSION_NUMBER < 0x10101000L
  26. X509_gmtime_adj(X509_get_notBefore(cert), 0);
  27. +#else
  28. + X509_gmtime_adj(X509_getm_notBefore(cert), 0);
  29. +#endif
  30. /*
  31. * We set the vailidy for 10 years.
  32. */
  33. +#if OPENSSL_VERSION_NUMBER < 0x10101000L
  34. X509_gmtime_adj(X509_get_notAfter(cert), 3650 * 24 * 3600);
  35. +#else
  36. + X509_gmtime_adj(X509_getm_notAfter(cert), 3650 * 24 * 3600);
  37. +#endif
  38. X509_set_pubkey(cert, pkey);