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.

39 lines
1.8 KiB

  1. From 98bf3eda9c950158cf6a0a6a698dd365712201b1 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 6/7] 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 | 12 +++++++++++-
  9. 1 file changed, 11 insertions(+), 1 deletion(-)
  10. --- a/src/_cffi_src/openssl/x509_vfy.py
  11. +++ b/src/_cffi_src/openssl/x509_vfy.py
  12. @@ -157,8 +157,12 @@ int X509_STORE_CTX_init(X509_STORE_CTX *
  13. Cryptography_STACK_OF_X509 *);
  14. void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *,
  15. Cryptography_STACK_OF_X509 *);
  16. +void X509_STORE_CTX_set0_trusted_stack(X509_STORE_CTX *,
  17. + Cryptography_STACK_OF_X509 *);
  18. void X509_STORE_CTX_set_cert(X509_STORE_CTX *, X509 *);
  19. -void X509_STORE_CTX_set_chain(X509_STORE_CTX *,Cryptography_STACK_OF_X509 *);
  20. +void X509_STORE_CTX_set_chain(X509_STORE_CTX *, Cryptography_STACK_OF_X509 *);
  21. +void X509_STORE_CTX_set0_untrusted(X509_STORE_CTX *,
  22. + Cryptography_STACK_OF_X509 *);
  23. X509_VERIFY_PARAM *X509_STORE_CTX_get0_param(X509_STORE_CTX *);
  24. void X509_STORE_CTX_set0_param(X509_STORE_CTX *, X509_VERIFY_PARAM *);
  25. int X509_STORE_CTX_set_default(X509_STORE_CTX *, const char *);
  26. @@ -260,4 +264,10 @@ static const long Cryptography_HAS_X509_
  27. #else
  28. static const long Cryptography_HAS_X509_CB_ISSUER_CHECK = 1;
  29. #endif
  30. +
  31. +#if (OPENSSL_API_COMPAT >= 0x10100000L) && !CRYPTOGRAPHY_IS_LIBRESSL
  32. +#define X509_STORE_CTX_trusted_stack X509_STORE_CTX_set0_trusted_stack
  33. +#define X509_STORE_CTX_set_chain X509_STORE_CTX_set0_untrusted
  34. +#define X509_STORE_CTX_get_chain X509_STORE_CTX_get1_chain
  35. +#endif
  36. """