Bug 964493: Adding missing PORT_SetError to CERT_CheckOCSPStatus, r=briansmith NSS_3_15_5 NSS_3_15_5_BETA3
authorDavid Keeler <dkeeler@mozilla.com>
Mon, 03 Feb 2014 11:35:46 -0800
branchNSS_3_15_5
changeset 11028 4e2f6a631150a32af355dcdd25870d85fc524b90
parent 11027 377dc0ceb7f3f1e428be5e4eff217cee1c335093
child 11029 efe1b674fd10b7cd287ac9e89378b00d32b6d5a9
push id295
push userbrian@briansmith.org
push dateMon, 03 Feb 2014 21:32:32 +0000
reviewersbriansmith
bugs964493
Bug 964493: Adding missing PORT_SetError to CERT_CheckOCSPStatus, r=briansmith
lib/certhigh/ocsp.c
--- a/lib/certhigh/ocsp.c
+++ b/lib/certhigh/ocsp.c
@@ -5082,16 +5082,19 @@ CERT_CheckOCSPStatus(CERTCertDBHandle *h
         certID, time, PR_FALSE, /* ignoreGlobalOcspFailureSetting */
         &rvOcsp, &cachedErrorCode, &cachedResponseFreshness);
     if (rv != SECSuccess) {
         CERT_DestroyOCSPCertID(certID);
         return SECFailure;
     }
     if (cachedResponseFreshness == ocspFresh) {
         CERT_DestroyOCSPCertID(certID);
+        if (rvOcsp != SECSuccess) {
+            PORT_SetError(cachedErrorCode);
+        }
         return rvOcsp;
     }
 
     rv = ocsp_GetOCSPStatusFromNetwork(handle, certID, cert, time, pwArg,
                                        &certIDWasConsumed, 
                                        &rvOcsp);
     if (rv != SECSuccess) {
         PRErrorCode err = PORT_GetError();