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.

44 lines
1.1 KiB

  1. From 821d3a9f513a63b06f1696352392996391807c16 Mon Sep 17 00:00:00 2001
  2. From: Janusz Dziemidowicz <rraptorr@nails.eu.org>
  3. Date: Wed, 8 Mar 2017 16:59:41 +0100
  4. Subject: [PATCH 4/7] BUG/MEDIUM: ssl: Clear OpenSSL error stack after trying
  5. to parse OCSP file
  6. Invalid OCSP file (for example empty one that can be used to enable
  7. OCSP response to be set dynamically later) causes errors that are
  8. placed on OpenSSL error stack. Those errors are not cleared so
  9. anything that checks this stack later will fail.
  10. Following configuration:
  11. bind :443 ssl crt crt1.pem crt crt2.pem
  12. With following files:
  13. crt1.pem
  14. crt1.pem.ocsp - empty one
  15. crt2.pem.rsa
  16. crt2.pem.ecdsa
  17. Will fail to load.
  18. This patch should be backported to 1.7.
  19. (cherry picked from commit 8d7104982e1c41f7dc4d75ae7f7d2bbb96052d40)
  20. ---
  21. src/ssl_sock.c | 2 ++
  22. 1 file changed, 2 insertions(+)
  23. diff --git a/src/ssl_sock.c b/src/ssl_sock.c
  24. index cc2dc12..daa584c 100644
  25. --- a/src/ssl_sock.c
  26. +++ b/src/ssl_sock.c
  27. @@ -433,6 +433,8 @@ static int ssl_sock_load_ocsp_response(struct chunk *ocsp_response, struct certi
  28. ret = 0;
  29. out:
  30. + ERR_clear_error();
  31. +
  32. if (bs)
  33. OCSP_BASICRESP_free(bs);
  34. --
  35. 2.10.2