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.

49 lines
2.1 KiB

  1. From 07fb50eecc3a3a50ac543f53f98c285eb1ceeb1e Mon Sep 17 00:00:00 2001
  2. From: Rosen Penev <rosenp@gmail.com>
  3. Date: Mon, 25 Nov 2019 12:06:16 -0800
  4. Subject: [PATCH] Add X509_STORE_CTX_trusted_stack compatibility macro
  5. Deprecated in 1.1
  6. Signed-off-by: Rosen Penev <rosenp@gmail.com>
  7. ---
  8. src/_cffi_src/openssl/x509_vfy.py | 17 ++++++++++++++++-
  9. 1 file changed, 16 insertions(+), 1 deletion(-)
  10. diff --git a/src/_cffi_src/openssl/x509_vfy.py b/src/_cffi_src/openssl/x509_vfy.py
  11. index a1730738..cd143ea0 100644
  12. --- a/src/_cffi_src/openssl/x509_vfy.py
  13. +++ b/src/_cffi_src/openssl/x509_vfy.py
  14. @@ -157,8 +157,12 @@ int X509_STORE_CTX_init(X509_STORE_CTX *, X509_STORE *, X509 *,
  15. Cryptography_STACK_OF_X509 *);
  16. void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *,
  17. Cryptography_STACK_OF_X509 *);
  18. +void X509_STORE_CTX_set0_trusted_stack(X509_STORE_CTX *,
  19. + Cryptography_STACK_OF_X509 *);
  20. void X509_STORE_CTX_set_cert(X509_STORE_CTX *, X509 *);
  21. -void X509_STORE_CTX_set_chain(X509_STORE_CTX *,Cryptography_STACK_OF_X509 *);
  22. +void X509_STORE_CTX_set_chain(X509_STORE_CTX *, Cryptography_STACK_OF_X509 *);
  23. +void X509_STORE_CTX_set0_untrusted(X509_STORE_CTX *,
  24. + Cryptography_STACK_OF_X509 *);
  25. X509_VERIFY_PARAM *X509_STORE_CTX_get0_param(X509_STORE_CTX *);
  26. void X509_STORE_CTX_set0_param(X509_STORE_CTX *, X509_VERIFY_PARAM *);
  27. int X509_STORE_CTX_set_default(X509_STORE_CTX *, const char *);
  28. @@ -282,4 +286,15 @@ static const long Cryptography_HAS_X509_CB_ISSUER_CHECK = 0;
  29. #else
  30. static const long Cryptography_HAS_X509_CB_ISSUER_CHECK = 1;
  31. #endif
  32. +
  33. +#if CRYPTOGRAPHY_OPENSSL_LESS_THAN_110 && !CRYPTOGRAPHY_IS_LIBRESSL
  34. +#define X509_STORE_CTX_set0_trusted_stack X509_STORE_CTX_trusted_stack
  35. +#define X509_STORE_CTX_set0_untrusted X509_STORE_CTX_set_chain
  36. +#endif
  37. +
  38. +#if (OPENSSL_API_COMPAT >= 0x10100000L) && !CRYPTOGRAPHY_IS_LIBRESSL
  39. +#define X509_STORE_CTX_trusted_stack X509_STORE_CTX_set0_trusted_stack
  40. +#define X509_STORE_CTX_set_chain X509_STORE_CTX_set0_untrusted
  41. +#define X509_STORE_CTX_get_chain X509_STORE_CTX_get1_chain
  42. +#endif
  43. """
  44. --
  45. 2.26.2