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.

42 lines
1.4 KiB

  1. --- a/src/tls.c
  2. +++ b/src/tls.c
  3. @@ -45,6 +45,10 @@
  4. # include <openssl/err.h>
  5. # include <openssl/rand.h>
  6. # include <openssl/evp.h>
  7. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  8. +#define X509_getm_notBefore X509_get_notBefore
  9. +#define X509_getm_notAfter X509_get_notAfter
  10. +#endif
  11. #endif /* HAVE_LIBSSL */
  12. #ifdef HAVE_LIBIDN
  13. @@ -167,8 +171,10 @@ int tls_lib_init(char **errstr)
  14. #ifdef HAVE_LIBSSL
  15. int e;
  16. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  17. SSL_load_error_strings();
  18. SSL_library_init();
  19. +#endif
  20. if ((e = seed_prng(errstr)) != TLS_EOK)
  21. {
  22. return e;
  23. @@ -518,7 +524,7 @@ int tls_cert_info_get(tls_t *tls, tls_cert_info_t *tci, char **errstr)
  24. *errstr = xasprintf(_("%s: error getting SHA1 fingerprint"), errmsg);
  25. return TLS_ECERT;
  26. }
  27. - asn1time = X509_get_notBefore(x509cert);
  28. + asn1time = X509_getm_notBefore(x509cert);
  29. if (asn1time_to_time_t((char *)asn1time->data,
  30. (asn1time->type != V_ASN1_GENERALIZEDTIME),
  31. &(tci->activation_time)) != 0)
  32. @@ -528,7 +534,7 @@ int tls_cert_info_get(tls_t *tls, tls_cert_info_t *tci, char **errstr)
  33. tls_cert_info_free(tci);
  34. return TLS_ECERT;
  35. }
  36. - asn1time = X509_get_notAfter(x509cert);
  37. + asn1time = X509_getm_notAfter(x509cert);
  38. if (asn1time_to_time_t((char *)asn1time->data,
  39. (asn1time->type != V_ASN1_GENERALIZEDTIME),
  40. &(tci->expiration_time)) != 0)