]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Parse validation helper response bug
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Tue, 4 Dec 2012 12:49:21 +0000 (14:49 +0200)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Tue, 4 Dec 2012 12:49:21 +0000 (14:49 +0200)
- CertValidationResponse bug: The CertValidationResponse::RecvdError::id is
  not intialized in constructors

- Inside Ssl::CertValidationMsg::parseResponse, after parsing response run
  through the parsed errors for errors.

src/ssl/cert_validate_message.cc

index 93c1072f010d5ec792ecbaa37eb8ca713a4df6d5..ceee3014d25b435569af02a4946521b96518ac3a 100644 (file)
@@ -130,6 +130,13 @@ Ssl::CertValidationMsg::parseResponse(CertValidationResponse &resp, STACK_OF(X50
     }
 
     /*Run through parsed errors to check for errors*/
+    typedef Ssl::CertValidationResponse::RecvdErrors::const_iterator SVCRECI;
+    for (SVCRECI i = resp.errors.begin(); i != resp.errors.end(); ++i) {
+        if (i->error_no != SSL_ERROR_NONE) {
+            debugs(83, DBG_IMPORTANT, "WARNING: cert validator incomplete response: Missing error name from error_id: " << i->id);
+            return false;
+        }
+    }
 
     return true;
 }
@@ -161,6 +168,7 @@ Ssl::CertValidationResponse::getError(int errorId)
 
 Ssl::CertValidationResponse::RecvdError::RecvdError(const RecvdError &old)
 {
+    id = old.id;
     error_no = old.error_no;
     error_reason = old.error_reason;
     setCert(old.cert.get());
@@ -168,6 +176,7 @@ Ssl::CertValidationResponse::RecvdError::RecvdError(const RecvdError &old)
 
 Ssl::CertValidationResponse::RecvdError & Ssl::CertValidationResponse::RecvdError::operator = (const RecvdError &old)
 {
+    id = old.id;
     error_no = old.error_no;
     error_reason = old.error_reason;
     setCert(old.cert.get());