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.

34 lines
1.2 KiB

  1. --- a/src/libopensc/sc-ossl-compat.h
  2. +++ b/src/libopensc/sc-ossl-compat.h
  3. @@ -76,6 +76,21 @@ extern "C" {
  4. })
  5. #endif /* OPENSSL_VERSION_NUMBER =< 0x00907000L */
  6. +/*
  7. + * 1.1.0 depracated ERR_load_crypto_strings(), SSL_load_error_strings(), ERR_free_strings()
  8. + * and ENGINE_load_dynamic.EVP_CIPHER_CTX_cleanup and EVP_CIPHER_CTX_init are replaced
  9. + * by EVP_CIPHER_CTX_reset.
  10. + * But for compatability with LibreSSL and older OpenSSL. OpenSC uses the older functions
  11. + */
  12. +#if OPENSSL_API_COMPAT >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
  13. +#define ERR_load_crypto_strings(x) {}
  14. +#define SSL_load_error_strings(x) {}
  15. +#define ERR_free_strings(x) {}
  16. +#define ENGINE_load_dynamic(x) {}
  17. +#define EVP_CIPHER_CTX_cleanup(x) EVP_CIPHER_CTX_reset(x)
  18. +#define EVP_CIPHER_CTX_init(x) EVP_CIPHER_CTX_reset(x)
  19. +#endif
  20. +
  21. /*
  22. * 1.1 renames RSA_PKCS1_SSLeay to RSA_PKCS1_OpenSSL
  23. * use RSA_PKCS1_OpenSSL
  24. --- a/src/pkcs15init/pkcs15-oberthur-awp.c
  25. +++ b/src/pkcs15init/pkcs15-oberthur-awp.c
  26. @@ -37,6 +37,7 @@
  27. #include "libopensc/asn1.h"
  28. #ifdef ENABLE_OPENSSL
  29. +#include "libopensc/sc-ossl-compat.h"
  30. struct awp_lv zero_lv = { 0, NULL };
  31. struct awp_lv x30_lv = { 0x10, (unsigned char *)"0000000000000000" };