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.3 KiB

  1. From 1135ea40b0ae5e5a98ee0cb9e13491664356adfc Mon Sep 17 00:00:00 2001
  2. From: Emeric Brun <ebrun@haproxy.com>
  3. Date: Fri, 20 Jun 2014 15:44:34 +0200
  4. Subject: [PATCH 2/5] BUG/MINOR: ssl: rejects OCSP response without nextupdate.
  5. To cache an OCSP Response without expiration time is not safe.
  6. (cherry picked from commit 13a6b48e241c0a50b501446992ab4fda2529f317)
  7. ---
  8. src/ssl_sock.c | 7 ++++++-
  9. 1 file changed, 6 insertions(+), 1 deletion(-)
  10. diff --git a/src/ssl_sock.c b/src/ssl_sock.c
  11. index ad4b1ca..278af8b 100644
  12. --- a/src/ssl_sock.c
  13. +++ b/src/ssl_sock.c
  14. @@ -139,7 +139,7 @@ static int ssl_sock_load_ocsp_response(struct chunk *ocsp_response, struct certi
  15. OCSP_SINGLERESP *sr;
  16. unsigned char *p = (unsigned char *)ocsp_response->str;
  17. int rc , count_sr;
  18. - ASN1_GENERALIZEDTIME *revtime, *thisupd, *nextupd;
  19. + ASN1_GENERALIZEDTIME *revtime, *thisupd, *nextupd = NULL;
  20. int reason;
  21. int ret = 1;
  22. @@ -179,6 +179,11 @@ static int ssl_sock_load_ocsp_response(struct chunk *ocsp_response, struct certi
  23. goto out;
  24. }
  25. + if (!nextupd) {
  26. + memprintf(err, "OCSP single response: missing nextupdate");
  27. + goto out;
  28. + }
  29. +
  30. rc = OCSP_check_validity(thisupd, nextupd, OCSP_MAX_RESPONSE_TIME_SKEW, -1);
  31. if (!rc) {
  32. memprintf(err, "OCSP single response: no longer valid.");
  33. --
  34. 1.8.5.5