Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | // Implements generating OCSP responses of various types. Used by the |
michael@0 | 6 | // programs in tlsserver/cmd. |
michael@0 | 7 | |
michael@0 | 8 | #ifndef OCSPCommon_h |
michael@0 | 9 | #define OCSPCommon_h |
michael@0 | 10 | |
michael@0 | 11 | #include "certt.h" |
michael@0 | 12 | #include "seccomon.h" |
michael@0 | 13 | |
michael@0 | 14 | enum OCSPResponseType |
michael@0 | 15 | { |
michael@0 | 16 | ORTNull = 0, |
michael@0 | 17 | ORTGood, // the certificate is good |
michael@0 | 18 | ORTRevoked, // the certificate has been revoked |
michael@0 | 19 | ORTRevokedOld, // same, but the response is old |
michael@0 | 20 | ORTUnknown, // the responder doesn't know if the cert is good |
michael@0 | 21 | ORTUnknownOld, // same, but the response is old |
michael@0 | 22 | ORTGoodOtherCert, // the response references a different certificate |
michael@0 | 23 | ORTGoodOtherCA, // the wrong CA has signed the response |
michael@0 | 24 | ORTExpired, // the signature on the response has expired |
michael@0 | 25 | ORTExpiredFreshCA, // fresh signature, but old validity period |
michael@0 | 26 | ORTNone, // no stapled response |
michael@0 | 27 | ORTEmpty, // an empty stapled response |
michael@0 | 28 | ORTMalformed, // the response from the responder was malformed |
michael@0 | 29 | ORTSrverr, // the response indicates there was a server error |
michael@0 | 30 | ORTTryLater, // the responder replied with "try again later" |
michael@0 | 31 | ORTNeedsSig, // the response needs a signature |
michael@0 | 32 | ORTUnauthorized, // the responder is not authorized for this certificate |
michael@0 | 33 | ORTBadSignature, // the response has a signature that does not verify |
michael@0 | 34 | ORTSkipResponseBytes, // the response does not include responseBytes |
michael@0 | 35 | ORTCriticalExtension, // the response includes a critical extension |
michael@0 | 36 | ORTNoncriticalExtension, // the response includes an extension that is not critical |
michael@0 | 37 | ORTEmptyExtensions, // the response includes a SEQUENCE OF Extension that is empty |
michael@0 | 38 | ORTDelegatedIncluded, // the response is signed by an included delegated responder |
michael@0 | 39 | ORTDelegatedIncludedLast, // same, but multiple other certificates are included |
michael@0 | 40 | ORTDelegatedMissing, // the response is signed by a not included delegated responder |
michael@0 | 41 | ORTDelegatedMissingMultiple, // same, but multiple other certificates are included |
michael@0 | 42 | ORTLongValidityAlmostExpired, // a good response, but that was generated a almost a year ago |
michael@0 | 43 | ORTAncientAlmostExpired, // a good response, with a validity of almost two years almost expiring |
michael@0 | 44 | }; |
michael@0 | 45 | |
michael@0 | 46 | struct OCSPHost |
michael@0 | 47 | { |
michael@0 | 48 | const char *mHostName; |
michael@0 | 49 | OCSPResponseType mORT; |
michael@0 | 50 | const char *mAdditionalCertName; // useful for ORTGoodOtherCert, etc. |
michael@0 | 51 | }; |
michael@0 | 52 | |
michael@0 | 53 | SECItemArray * |
michael@0 | 54 | GetOCSPResponseForType(OCSPResponseType aORT, CERTCertificate *aCert, |
michael@0 | 55 | PLArenaPool *aArena, const char *aAdditionalCertName); |
michael@0 | 56 | |
michael@0 | 57 | #endif // OCSPCommon_h |