Closed Bug 495934 Opened 16 years ago Closed 16 years ago

OCSP test with revoked EE cert validated as good.

Categories

(NSS :: Test, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
3.12.4

People

(Reporter: slavomir.katuscak+mozilla, Assigned: slavomir.katuscak+mozilla)

Details

Attachments

(1 file, 1 obsolete file)

Build: trunk/attic/Linux 64bit DBG on 2009/05/29 10:36:22 (Tinderbox) Test log: chains.sh: Verifying certificate(s) OCSPEE12.cert OCSPCA1.cert with flags -g leaf -m ocsp -d OCSPRootDB -t OCSPRoot vfychain -d OCSPRootDB -pp -vv -g leaf -m ocsp /export/tinderlight/data/attic_64_DBG/mozilla/security/nss/tests/libpkix/certs/OCSPEE12.cert /export/tinderlight/data/attic_64_DBG/mozilla/security/nss/tests/libpkix/certs/OCSPCA1.cert -t OCSPRoot (pkix_CacheCert_Add: PKIX_PL_HashTable_Add for Certs skipped: entry existed (pkix_CacheCert_Add: PKIX_PL_HashTable_Add for Certs skipped: entry existed Chain is good! Root Certificate: Data: Version: 3 (0x2) Serial Number: 219193145 (0xd109f39) Signature Algorithm: PKCS #1 SHA-1 With RSA Encryption Issuer: "CN=OCSPRoot ROOT CA,O=OCSPRoot,C=US" Validity: Not Before: Thu Feb 19 18:31:46 2009 Not After : Wed Feb 19 18:31:46 2059 Subject: "CN=OCSPRoot ROOT CA,O=OCSPRoot,C=US" Subject Public Key Info: Public Key Algorithm: PKCS #1 RSA Encryption RSA Public Key: Modulus: ef:28:1c:84:50:5a:2e:bb:7a:ad:5e:2e:fb:61:03:ba: 44:c9:a9:8d:35:fa:78:6c:ac:7b:57:e2:7f:9e:f9:63: 70:15:a9:1c:8a:8d:bb:23:d1:11:7c:37:6c:ca:b0:ea: 60:89:57:06:b1:d3:4c:8c:85:e4:21:57:ea:f6:a3:cd: 61:cc:51:ba:b5:3c:1f:0e:e4:55:6e:0f:04:a0:7a:69: 06:9a:b2:d6:3a:5e:d0:fa:07:12:c4:d3:99:3e:a1:bc: 06:de:3a:d1:24:c5:24:c8:03:f2:66:24:76:93:12:ed: 4e:cc:f9:e9:f5:3b:e5:4a:d3:63:af:01:13:83:ce:f3 Exponent: 65537 (0x10001) Signed Extensions: Name: Certificate Type Data: <SSL CA,S/MIME CA,ObjectSigning CA> Name: Certificate Basic Constraints Data: Is a CA with no maximum path length. Name: Certificate Key Usage Usages: Certificate Signing CRL Signing Signature Algorithm: PKCS #1 SHA-1 With RSA Encryption Signature: b4:2f:33:72:87:24:78:9a:4c:24:ac:6e:92:a7:0e:7f: 32:92:67:79:7b:76:82:88:a5:3c:fd:27:cc:2b:50:f6: c4:d2:60:e5:42:20:10:25:07:27:aa:de:ae:f7:20:23: 6d:ae:6b:75:25:b6:eb:b3:2c:cb:3e:3b:46:8a:61:de: 6d:8e:0b:de:d4:46:6a:d6:01:44:89:8b:67:b4:47:bc: 43:be:da:4f:e9:6c:58:a9:c7:90:16:c6:ed:c1:3f:48: 7a:47:55:27:ed:b8:6c:17:6f:56:c5:6e:2a:8b:f3:67: a2:65:6c:b9:f6:71:cd:65:14:4a:40:ea:f1:8f:84:6f Fingerprint (MD5): 35:8F:91:0E:79:08:B0:8B:CF:1D:03:B5:E0:53:B8:B0 Fingerprint (SHA1): 85:7B:73:CA:B7:90:27:C4:C3:D1:61:C0:C3:4F:05:20:C6:73:19:AE Certificate Trust Flags: SSL Flags: Valid CA Trusted CA Trusted Client CA Email Flags: Valid CA Trusted CA Object Signing Flags: Valid CA Trusted CA Certificate 1 Subject: "CN=OCSPEE12 EE,O=OCSPEE12,C=US" Certificate 2 Subject: "CN=OCSPCA1 Intermediate,O=OCSPCA1,C=US" Returned value is 0, expected result is fail chains.sh: #5977: OCSP: Verifying certificate(s) OCSPEE12.cert OCSPCA1.cert with flags -g leaf -m ocsp -d OCSPRootDB -t OCSPRoot - FAILED Details: Chain: OCSPEE12 -> OCSPCA1 -> OCSPRoot OCSPEE12 is revoked by OCSPCA1 (and contains AIA link to it), therefore it should be validated as revoked, but it wasn't. This bug occurred only once, usually it passes.
This bug is very similar to 482702. Alexei, do you think that adding requireFreshInfo is required also here, or it can be some other issue ?
Assignee: nobody → slavomir.katuscak
Slavo, It is most likely, that client didn't receive any thing from the ocsp server. Without requireFreshInfo flag, if the server would have some problems responding to your request, for example when the server is unreachable, you would get a positive return status, since no information was received, that in its turn means that either a previously received information should be used or another revocation method should be tried. Since other source of information are unavailable and requireFreshInfo flag is not set, the cert is considered to be valid. We should use the flag for all the revocation tests that communicating with a server in the process of a test. Please try to create and run ocsp server load test to understand under what load the server is caving in.
Alexei, I did some experiments with requireFreshInfo flag and I have some questions: 1. Test with revoked CA: OCSPEE21 -> OCSPCA2 -> OCSPRoot (OCSPCA2 is revoked) When testing with -g chain OCSPEE21 is not validated, because OCSPCA2 is validated as revoked. When testing with -g leaf, OCSPEE21 is validated as valid (what is OK when we test only leaf validation), with requireFreshInfo it is validated as revoked. Can you please explain me, how it works for chain and for leaf validation and how can requireFreshInfo make difference in results there ? 2. Test with revoked EE cert in combination with doNotUse or forbidFetching flags. OCSPEE12 -> OCSPCA1 -> OCSPRoot (OCSPEE12 is revoked) When testing with doNotUse or forbidFetching without requireFreshInfo cert is validated as OK. After adding requireFreshInfo seems that doNotUse and forbidFetching flags are ignored and cert is validated as revoked. Is this OK ? Does requireFreshInfo have higher priority than other flags, or is it a bug ?
To answer the first question I'll need to see the whole command to vfychain. Would be great if for every new bug related to vfychain you would provide a vfychain options that was used. > Is this OK ? Does requireFreshInfo have higher priority than other flags, or is > it a bug ? It is not. requireFreshInfo is not the method, but revocation test flag. If vfychain is prohibited from using one of the revocation method, it still need to used others to get an info. It the info is not available after trying all methods, we declare failure. Here is the result matrix when requireFreshInfo is used: doNotUse forbidFetching", "ignoreDefaultSrc", "requireInfo" and "failIfNoInfo".
Sorry, pressed enter before finished typing.
> To answer the first question I'll need to see the whole command to vfychain. > Would be great if for every new bug related to vfychain you would provide a > vfychain options that was used. OCSPEE21 -> OCSPCA2 -> OCSPRoot (OCSPCA2 is revoked) $ vfychain -d OCSPRootDB -pp -vv -g leaf -m ocsp /Users/sven/nss/securitytip/mozilla/security/nss/tests/libpkix/certs/OCSPEE21.cert /Users/sven/nss/securitytip/mozilla/security/nss/tests/libpkix/certs/OCSPCA2.cert -t OCSPRoot Chain is good! $ vfychain -d OCSPRootDB -pp -vv -g leaf -h requireFreshInfo -m ocsp /Users/sven/nss/securitytip/mozilla/security/nss/tests/libpkix/certs/OCSPEE21.cert /Users/sven/nss/securitytip/mozilla/security/nss/tests/libpkix/certs/OCSPCA2.cert -t OCSPRoot Chain is bad, -8180 = Peer's Certificate has been revoked. PROBLEM WITH THE CERT CHAIN: CERT 2. OCSPRoot [Certificate Authority]: ERROR -8180: Peer's Certificate has been revoked. For -g chain cert is revoked in both cases.
Results of doNotUse and forbidFetching with/without requireFreshInfo: OCSPEE12 -> OCSPCA1 -> OCSPRoot (OCSPEE12 is revoked) vfychain -d OCSPRootDB -pp -vv -g leaf -m ocsp -s doNotUse /Users/sven/nss/securitytip/mozilla/security/nss/tests/libpkix/certs/OCSPEE12.cert /Users/sven/nss/securitytip/mozilla/security/nss/tests/libpkix/certs/OCSPCA1.cert -t OCSPRoot Chain is good! vfychain -d OCSPRootDB -pp -vv -g leaf -h requireFreshInfo -m ocsp -s doNotUse /Users/sven/nss/securitytip/mozilla/security/nss/tests/libpkix/certs/OCSPEE12.cert /Users/sven/nss/securitytip/mozilla/security/nss/tests/libpkix/certs/OCSPCA1.cert -t OCSPRoot Chain is bad, -8180 = Peer's Certificate has been revoked. PROBLEM WITH THE CERT CHAIN: CERT 2. OCSPRoot [Certificate Authority]: ERROR -8180: Peer's Certificate has been revoked. vfychain -d OCSPRootDB -pp -vv -g leaf -m ocsp -s forbidFetching /Users/sven/nss/securitytip/mozilla/security/nss/tests/libpkix/certs/OCSPEE12.cert /Users/sven/nss/securitytip/mozilla/security/nss/tests/libpkix/certs/OCSPCA1.cert -t OCSPRoot Chain is good! vfychain -d OCSPRootDB -pp -vv -g leaf -h requireFreshInfo -m ocsp -s forbidFetching /Users/sven/nss/securitytip/mozilla/security/nss/tests/libpkix/certs/OCSPEE12.cert /Users/sven/nss/securitytip/mozilla/security/nss/tests/libpkix/certs/OCSPCA1.cert -t OCSPRoot Chain is bad, -8180 = Peer's Certificate has been revoked. PROBLEM WITH THE CERT CHAIN: CERT 2. OCSPRoot [Certificate Authority]: ERROR -8180: Peer's Certificate has been revoked.
> OCSPEE21 -> OCSPCA2 -> OCSPRoot (OCSPCA2 is revoked) > > $ vfychain -d OCSPRootDB -pp -vv -g leaf -m ocsp > /Users/sven/nss/securitytip/mozilla/security/nss/tests/libpkix/certs/OCSPEE21.cert > /Users/sven/nss/securitytip/mozilla/security/nss/tests/libpkix/certs/OCSPCA2.cert > -t OCSPRoot > Chain is good! Correct since testing only the leaf, an EE cert. > > $ vfychain -d OCSPRootDB -pp -vv -g leaf -h requireFreshInfo -m ocsp > /Users/sven/nss/securitytip/mozilla/security/nss/tests/libpkix/certs/OCSPEE21.cert > /Users/sven/nss/securitytip/mozilla/security/nss/tests/libpkix/certs/OCSPCA2.cert > -t OCSPRoot > Chain is bad, -8180 = Peer's Certificate has been revoked. > PROBLEM WITH THE CERT CHAIN: > CERT 2. OCSPRoot [Certificate Authority]: > ERROR -8180: Peer's Certificate has been revoked. This test should pass if EE cert has AIA extension and was able to get the information. > > For -g chain cert is revoked in both cases. Correct in both cases.
(In reply to comment #7) > Results of doNotUse and forbidFetching with/without requireFreshInfo: > > OCSPEE12 -> OCSPCA1 -> OCSPRoot (OCSPEE12 is revoked) > > vfychain -d OCSPRootDB -pp -vv -g leaf -m ocsp -s doNotUse > /Users/sven/nss/securitytip/mozilla/security/nss/tests/libpkix/certs/OCSPEE12.cert > /Users/sven/nss/securitytip/mozilla/security/nss/tests/libpkix/certs/OCSPCA1.cert > -t OCSPRoot > Chain is good! Correct: you have prohibited to use the method. No connection was made. > > vfychain -d OCSPRootDB -pp -vv -g leaf -h requireFreshInfo -m ocsp -s doNotUse > > /Users/sven/nss/securitytip/mozilla/security/nss/tests/libpkix/certs/OCSPEE12.cert > /Users/sven/nss/securitytip/mozilla/security/nss/tests/libpkix/certs/OCSPCA1.cert > -t OCSPRoot > Chain is bad, -8180 = Peer's Certificate has been revoked. > PROBLEM WITH THE CERT CHAIN: > CERT 2. OCSPRoot [Certificate Authority]: > ERROR -8180: Peer's Certificate has been revoked. Correct: the method is prohibited, but no other methods are defined, that would provide the missing revocation info. > > vfychain -d OCSPRootDB -pp -vv -g leaf -m ocsp -s forbidFetching > /Users/sven/nss/securitytip/mozilla/security/nss/tests/libpkix/certs/OCSPEE12.cert > /Users/sven/nss/securitytip/mozilla/security/nss/tests/libpkix/certs/OCSPCA1.cert > -t OCSPRoot > Chain is good! > > vfychain -d OCSPRootDB -pp -vv -g leaf -h requireFreshInfo -m ocsp -s > forbidFetching > /Users/sven/nss/securitytip/mozilla/security/nss/tests/libpkix/certs/OCSPEE12.cert > /Users/sven/nss/securitytip/mozilla/security/nss/tests/libpkix/certs/OCSPCA1.cert > -t OCSPRoot > Chain is bad, -8180 = Peer's Certificate has been revoked. > PROBLEM WITH THE CERT CHAIN: > CERT 2. OCSPRoot [Certificate Authority]: > ERROR -8180: Peer's Certificate has been revoked. Same as above, but in this case instead of prohibiting a use of the method, you make the method use only info that is available in ocsp cache. But the cache is empty.
Attachment #384607 - Flags: review?(alexei.volkov.bugs)
Attachment #384607 - Attachment is patch: true
Attachment #384607 - Attachment mime type: application/octet-stream → text/plain
Comment on attachment 384607 [details] [diff] [review] Patch adding requireFreshInfo flag. r-. > > #EE - OK, CA - revoked, leaf > verify OCSPEE21:x > cert OCSPCA2:x > trust OCSPRoot > rev_type leaf >+# bug 499908 - would fail with requireFreshInfo flag >+# rev_flags requireFreshInfo > rev_mtype ocsp > result pass In this test case, when requireFreshInfo flag is used, we can not verify ocsp response since CA cert is invalid and there is no other revocation information is available. In case, when the is not used, bad signature is treated as absents of the response. The failure in this case can be enforced by using failIfNoInfo flag. I suggest we add two more cases: test case with requireFreshInfo should fail. With out any flags it should pass. And the test with failIfNoInfo flag should also fail.
Attachment #384607 - Flags: review?(alexei.volkov.bugs) → review-
Attached patch Patch v2.Splinter Review
Addressed suggestions from comment 11.
Attachment #384607 - Attachment is obsolete: true
Attachment #390210 - Flags: review?(alexei.volkov.bugs)
Comment on attachment 390210 [details] [diff] [review] Patch v2. r=alexei
Attachment #390210 - Flags: review?(alexei.volkov.bugs) → review+
Checking in ocsp.cfg; /cvsroot/mozilla/security/nss/tests/chains/scenarios/ocsp.cfg,v <-- ocsp.cfg new revision: 1.6; previous revision: 1.5 done
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: