OLD | NEW |
1 /* This Source Code Form is subject to the terms of the Mozilla Public | 1 /* This Source Code Form is subject to the terms of the Mozilla Public |
2 * License, v. 2.0. If a copy of the MPL was not distributed with this | 2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
4 | 4 |
5 /* | 5 /* |
6 * Private header defining OCSP types. | 6 * Private header defining OCSP types. |
7 */ | 7 */ |
8 | 8 |
9 #ifndef _OCSPTI_H_ | 9 #ifndef _OCSPTI_H_ |
10 #define _OCSPTI_H_ | 10 #define _OCSPTI_H_ |
11 | 11 |
12 #include "ocspt.h" | 12 #include "ocspt.h" |
13 | 13 |
14 #include "certt.h" | 14 #include "certt.h" |
15 #include "plarena.h" | 15 #include "plarena.h" |
16 #include "seccomon.h" | 16 #include "seccomon.h" |
17 #include "secoidt.h" | 17 #include "secoidt.h" |
18 | 18 |
19 | |
20 /* | 19 /* |
21 * Some notes about naming conventions... | 20 * Some notes about naming conventions... |
22 * | 21 * |
23 * The public data types all start with "CERTOCSP" (e.g. CERTOCSPRequest). | 22 * The public data types all start with "CERTOCSP" (e.g. CERTOCSPRequest). |
24 * (Even the public types are opaque, however. Only their names are | 23 * (Even the public types are opaque, however. Only their names are |
25 * "exported".) | 24 * "exported".) |
26 * | 25 * |
27 * Internal-only data types drop the "CERT" prefix and use only the | 26 * Internal-only data types drop the "CERT" prefix and use only the |
28 * lower-case "ocsp" (e.g. ocspTBSRequest), for brevity sake. | 27 * lower-case "ocsp" (e.g. ocspTBSRequest), for brevity sake. |
29 * | 28 * |
(...skipping 12 matching lines...) Expand all Loading... |
42 * The definitions laid out in this header file are intended to follow | 41 * The definitions laid out in this header file are intended to follow |
43 * the same order as the definitions in the OCSP specification itself. | 42 * the same order as the definitions in the OCSP specification itself. |
44 * With the OCSP standard in hand, you should be able to move through | 43 * With the OCSP standard in hand, you should be able to move through |
45 * this file and follow along. To future modifiers of this file: please | 44 * this file and follow along. To future modifiers of this file: please |
46 * try to keep it that way. The only exceptions are the few cases where | 45 * try to keep it that way. The only exceptions are the few cases where |
47 * we need to define a type before it is referenced (e.g. enumerations), | 46 * we need to define a type before it is referenced (e.g. enumerations), |
48 * whereas in the OCSP specification these are usually defined the other | 47 * whereas in the OCSP specification these are usually defined the other |
49 * way around (reference before definition). | 48 * way around (reference before definition). |
50 */ | 49 */ |
51 | 50 |
52 | |
53 /* | 51 /* |
54 * Forward-declarations of internal-only data structures. | 52 * Forward-declarations of internal-only data structures. |
55 * | 53 * |
56 * These are in alphabetical order (case-insensitive); please keep it that way! | 54 * These are in alphabetical order (case-insensitive); please keep it that way! |
57 */ | 55 */ |
58 typedef struct ocspBasicOCSPResponseStr ocspBasicOCSPResponse; | 56 typedef struct ocspBasicOCSPResponseStr ocspBasicOCSPResponse; |
59 typedef struct ocspCertStatusStr ocspCertStatus; | 57 typedef struct ocspCertStatusStr ocspCertStatus; |
60 typedef struct ocspResponderIDStr ocspResponderID; | 58 typedef struct ocspResponderIDStr ocspResponderID; |
61 typedef struct ocspResponseBytesStr ocspResponseBytes; | 59 typedef struct ocspResponseBytesStr ocspResponseBytes; |
62 typedef struct ocspResponseDataStr ocspResponseData; | 60 typedef struct ocspResponseDataStr ocspResponseData; |
63 typedef struct ocspRevokedInfoStr ocspRevokedInfo; | 61 typedef struct ocspRevokedInfoStr ocspRevokedInfo; |
64 typedef struct ocspServiceLocatorStr ocspServiceLocator; | 62 typedef struct ocspServiceLocatorStr ocspServiceLocator; |
65 typedef struct ocspSignatureStr ocspSignature; | 63 typedef struct ocspSignatureStr ocspSignature; |
66 typedef struct ocspSingleRequestStr ocspSingleRequest; | 64 typedef struct ocspSingleRequestStr ocspSingleRequest; |
67 typedef struct ocspSingleResponseStr ocspSingleResponse; | 65 typedef struct ocspSingleResponseStr ocspSingleResponse; |
68 typedef struct ocspTBSRequestStr ocspTBSRequest; | 66 typedef struct ocspTBSRequestStr ocspTBSRequest; |
69 | 67 |
70 | |
71 /* | 68 /* |
72 * An OCSPRequest; this is what is sent (encoded) to an OCSP responder. | 69 * An OCSPRequest; this is what is sent (encoded) to an OCSP responder. |
73 */ | 70 */ |
74 struct CERTOCSPRequestStr { | 71 struct CERTOCSPRequestStr { |
75 PLArenaPool *arena;»» » /* local; not part of encoding */ | 72 PLArenaPool *arena; /* local; not part of encoding */ |
76 ocspTBSRequest *tbsRequest; | 73 ocspTBSRequest *tbsRequest; |
77 ocspSignature *optionalSignature; | 74 ocspSignature *optionalSignature; |
78 }; | 75 }; |
79 | 76 |
80 /* | 77 /* |
81 * A TBSRequest; when an OCSPRequest is signed, the encoding of this | 78 * A TBSRequest; when an OCSPRequest is signed, the encoding of this |
82 * is what the signature is actually applied to. ("TBS" == To Be Signed) | 79 * is what the signature is actually applied to. ("TBS" == To Be Signed) |
83 * Whether signed or not, however, this structure will be present, and | 80 * Whether signed or not, however, this structure will be present, and |
84 * is the "meat" of the OCSPRequest. | 81 * is the "meat" of the OCSPRequest. |
85 * | 82 * |
86 * Note that the "requestorName" field cannot be encoded/decoded in the | 83 * Note that the "requestorName" field cannot be encoded/decoded in the |
87 * same pass as the entire request -- it needs to be handled with a special | 84 * same pass as the entire request -- it needs to be handled with a special |
88 * call to convert to/from our internal form of a GeneralName. Thus the | 85 * call to convert to/from our internal form of a GeneralName. Thus the |
89 * "derRequestorName" field, which is the actual DER-encoded bytes. | 86 * "derRequestorName" field, which is the actual DER-encoded bytes. |
90 * | 87 * |
91 * The "extensionHandle" field is used on creation only; it holds | 88 * The "extensionHandle" field is used on creation only; it holds |
92 * in-progress extensions as they are optionally added to the request. | 89 * in-progress extensions as they are optionally added to the request. |
93 */ | 90 */ |
94 struct ocspTBSRequestStr { | 91 struct ocspTBSRequestStr { |
95 SECItem version;» » » /* an INTEGER */ | 92 SECItem version; /* an INTEGER */ |
96 SECItem *derRequestorName;» » /* encoded GeneralName; see above */ | 93 SECItem *derRequestorName; /* encoded GeneralName; see above */ |
97 CERTGeneralNameList *requestorName;»/* local; not part of encoding */ | 94 CERTGeneralNameList *requestorName; /* local; not part of encoding */ |
98 ocspSingleRequest **requestList; | 95 ocspSingleRequest **requestList; |
99 CERTCertExtension **requestExtensions; | 96 CERTCertExtension **requestExtensions; |
100 void *extensionHandle;» » /* local; not part of encoding */ | 97 void *extensionHandle; /* local; not part of encoding */ |
101 }; | 98 }; |
102 | 99 |
103 /* | 100 /* |
104 * This is the actual signature information for an OCSPRequest (applied to | 101 * This is the actual signature information for an OCSPRequest (applied to |
105 * the TBSRequest structure) or for a BasicOCSPResponse (applied to a | 102 * the TBSRequest structure) or for a BasicOCSPResponse (applied to a |
106 * ResponseData structure). | 103 * ResponseData structure). |
107 * | 104 * |
108 * Note that the "signature" field itself is a BIT STRING; operations on | 105 * Note that the "signature" field itself is a BIT STRING; operations on |
109 * it need to keep that in mind, converting the length to bytes as needed | 106 * it need to keep that in mind, converting the length to bytes as needed |
110 * and back again afterward (so that the length is usually expressing bits). | 107 * and back again afterward (so that the length is usually expressing bits). |
111 * | 108 * |
112 * The "cert" field is the signer's certificate. In the case of a received | 109 * The "cert" field is the signer's certificate. In the case of a received |
113 * signature, it will be filled in when the signature is verified. In the | 110 * signature, it will be filled in when the signature is verified. In the |
114 * case of a created signature, it is filled in on creation and will be the | 111 * case of a created signature, it is filled in on creation and will be the |
115 * cert used to create the signature when the signing-and-encoding occurs, | 112 * cert used to create the signature when the signing-and-encoding occurs, |
116 * as well as the cert (and its chain) to fill in derCerts if requested. | 113 * as well as the cert (and its chain) to fill in derCerts if requested. |
117 * | 114 * |
118 * The extra fields cache information about the signature after we have | 115 * The extra fields cache information about the signature after we have |
119 * attempted a verification. "wasChecked", if true, means the signature | 116 * attempted a verification. "wasChecked", if true, means the signature |
120 * has been checked against the appropriate data and thus that "status" | 117 * has been checked against the appropriate data and thus that "status" |
121 * contains the result of that verification. If "status" is not SECSuccess, | 118 * contains the result of that verification. If "status" is not SECSuccess, |
122 * "failureReason" is a copy of the error code that was set at the time; | 119 * "failureReason" is a copy of the error code that was set at the time; |
123 * presumably it tells why the signature verification failed. | 120 * presumably it tells why the signature verification failed. |
124 */ | 121 */ |
125 struct ocspSignatureStr { | 122 struct ocspSignatureStr { |
126 SECAlgorithmID signatureAlgorithm; | 123 SECAlgorithmID signatureAlgorithm; |
127 SECItem signature;» » » /* a BIT STRING */ | 124 SECItem signature; /* a BIT STRING */ |
128 SECItem **derCerts;»» » /* a SEQUENCE OF Certificate */ | 125 SECItem **derCerts; /* a SEQUENCE OF Certificate */ |
129 CERTCertificate *cert;» » /* local; not part of encoding */ | 126 CERTCertificate *cert; /* local; not part of encoding */ |
130 PRBool wasChecked;» » » /* local; not part of encoding */ | 127 PRBool wasChecked; /* local; not part of encoding */ |
131 SECStatus status;» » » /* local; not part of encoding */ | 128 SECStatus status; /* local; not part of encoding */ |
132 int failureReason;» » » /* local; not part of encoding */ | 129 int failureReason; /* local; not part of encoding */ |
133 }; | 130 }; |
134 | 131 |
135 /* | 132 /* |
136 * An OCSPRequest contains a SEQUENCE OF these, one for each certificate | 133 * An OCSPRequest contains a SEQUENCE OF these, one for each certificate |
137 * whose status is being checked. | 134 * whose status is being checked. |
138 * | 135 * |
139 * Note that in the OCSP specification this is just called "Request", | 136 * Note that in the OCSP specification this is just called "Request", |
140 * but since that seemed confusing (vs. an OCSPRequest) and to be more | 137 * but since that seemed confusing (vs. an OCSPRequest) and to be more |
141 * consistent with the parallel type "SingleResponse", I called it a | 138 * consistent with the parallel type "SingleResponse", I called it a |
142 * "SingleRequest". | 139 * "SingleRequest". |
143 * | 140 * |
144 * XXX figure out how to get rid of that arena -- there must be a way | 141 * XXX figure out how to get rid of that arena -- there must be a way |
145 */ | 142 */ |
146 struct ocspSingleRequestStr { | 143 struct ocspSingleRequestStr { |
147 PLArenaPool *arena;»» » /* just a copy of the response arena, | 144 PLArenaPool *arena; /* just a copy of the response arena, |
148 * needed here for extension handling | 145 * needed here for extension handling |
149 * routines, on creation only */ | 146 * routines, on creation only */ |
150 CERTOCSPCertID *reqCert; | 147 CERTOCSPCertID *reqCert; |
151 CERTCertExtension **singleRequestExtensions; | 148 CERTCertExtension **singleRequestExtensions; |
152 }; | 149 }; |
153 | 150 |
154 /* | 151 /* |
155 * A CertID is the means of identifying a certificate, used both in requests | 152 * A CertID is the means of identifying a certificate, used both in requests |
156 * and in responses. | 153 * and in responses. |
157 * | 154 * |
158 * When in a SingleRequest it specifies the certificate to be checked. | 155 * When in a SingleRequest it specifies the certificate to be checked. |
159 * When in a SingleResponse it is the cert whose status is being given. | 156 * When in a SingleResponse it is the cert whose status is being given. |
160 */ | 157 */ |
161 struct CERTOCSPCertIDStr { | 158 struct CERTOCSPCertIDStr { |
162 SECAlgorithmID hashAlgorithm; | 159 SECAlgorithmID hashAlgorithm; |
163 SECItem issuerNameHash;» » /* an OCTET STRING */ | 160 SECItem issuerNameHash; /* an OCTET STRING */ |
164 SECItem issuerKeyHash;» » /* an OCTET STRING */ | 161 SECItem issuerKeyHash; /* an OCTET STRING */ |
165 SECItem serialNumber;» » /* an INTEGER */ | 162 SECItem serialNumber; /* an INTEGER */ |
166 SECItem issuerSHA1NameHash;»» /* keep other hashes around when */ | 163 SECItem issuerSHA1NameHash; /* keep other hashes around when */ |
167 SECItem issuerMD5NameHash; /* we have them */ | 164 SECItem issuerMD5NameHash; /* we have them */ |
168 SECItem issuerMD2NameHash; | 165 SECItem issuerMD2NameHash; |
169 SECItem issuerSHA1KeyHash;» » /* keep other hashes around when */ | 166 SECItem issuerSHA1KeyHash; /* keep other hashes around when */ |
170 SECItem issuerMD5KeyHash; /* we have them */ | 167 SECItem issuerMD5KeyHash; /* we have them */ |
171 SECItem issuerMD2KeyHash; | 168 SECItem issuerMD2KeyHash; |
172 PLArenaPool *poolp; | 169 PLArenaPool *poolp; |
173 }; | 170 }; |
174 | 171 |
175 /* | 172 /* |
176 * This describes the value of the responseStatus field in an OCSPResponse. | 173 * This describes the value of the responseStatus field in an OCSPResponse. |
177 * The corresponding ASN.1 definition is: | 174 * The corresponding ASN.1 definition is: |
178 * | 175 * |
179 * OCSPResponseStatus ::= ENUMERATED { | 176 * OCSPResponseStatus ::= ENUMERATED { |
180 * successful (0), --Response has valid confirmations | 177 * successful (0), --Response has valid confirmations |
(...skipping 21 matching lines...) Expand all Loading... |
202 } ocspResponseStatus; | 199 } ocspResponseStatus; |
203 | 200 |
204 /* | 201 /* |
205 * An OCSPResponse is what is sent (encoded) by an OCSP responder. | 202 * An OCSPResponse is what is sent (encoded) by an OCSP responder. |
206 * | 203 * |
207 * The field "responseStatus" is the ASN.1 encoded value; the field | 204 * The field "responseStatus" is the ASN.1 encoded value; the field |
208 * "statusValue" is simply that same value translated into our local | 205 * "statusValue" is simply that same value translated into our local |
209 * type ocspResponseStatus. | 206 * type ocspResponseStatus. |
210 */ | 207 */ |
211 struct CERTOCSPResponseStr { | 208 struct CERTOCSPResponseStr { |
212 PLArenaPool *arena;»» » /* local; not part of encoding */ | 209 PLArenaPool *arena; /* local; not part of encoding */ |
213 SECItem responseStatus;» » /* an ENUMERATED, see above */ | 210 SECItem responseStatus; /* an ENUMERATED, see above */ |
214 ocspResponseStatus statusValue;» /* local; not part of encoding */ | 211 ocspResponseStatus statusValue; /* local; not part of encoding */ |
215 ocspResponseBytes *responseBytes;» /* only when status is successful */ | 212 ocspResponseBytes *responseBytes; /* only when status is successful */ |
216 }; | 213 }; |
217 | 214 |
218 /* | 215 /* |
219 * A ResponseBytes (despite appearances) is what contains the meat | 216 * A ResponseBytes (despite appearances) is what contains the meat |
220 * of a successful response -- but still in encoded form. The type | 217 * of a successful response -- but still in encoded form. The type |
221 * given as "responseType" tells you how to decode the string. | 218 * given as "responseType" tells you how to decode the string. |
222 * | 219 * |
223 * We look at the OID and translate it into our local OID representation | 220 * We look at the OID and translate it into our local OID representation |
224 * "responseTypeTag", and use that value to tell us how to decode the | 221 * "responseTypeTag", and use that value to tell us how to decode the |
225 * actual response itself. For now the only kind of OCSP response we | 222 * actual response itself. For now the only kind of OCSP response we |
226 * know about is a BasicOCSPResponse. However, the intention in the | 223 * know about is a BasicOCSPResponse. However, the intention in the |
227 * OCSP specification is to allow for other response types, so we are | 224 * OCSP specification is to allow for other response types, so we are |
228 * building in that flexibility from the start and thus put a pointer | 225 * building in that flexibility from the start and thus put a pointer |
229 * to that data structure inside of a union. Whenever OCSP adds more | 226 * to that data structure inside of a union. Whenever OCSP adds more |
230 * response types, just add them to the union. | 227 * response types, just add them to the union. |
231 */ | 228 */ |
232 struct ocspResponseBytesStr { | 229 struct ocspResponseBytesStr { |
233 SECItem responseType;» » /* an OBJECT IDENTIFIER */ | 230 SECItem responseType; /* an OBJECT IDENTIFIER */ |
234 SECOidTag responseTypeTag;» » /* local; not part of encoding */ | 231 SECOidTag responseTypeTag; /* local; not part of encoding */ |
235 SECItem response;» » » /* an OCTET STRING */ | 232 SECItem response; /* an OCTET STRING */ |
236 union { | 233 union { |
237 » ocspBasicOCSPResponse *basic;» /* when type is id-pkix-ocsp-basic */ | 234 ocspBasicOCSPResponse *basic; /* when type is id-pkix-ocsp-basic */ |
238 } decodedResponse;» » » /* local; not part of encoding */ | 235 } decodedResponse; /* local; not part of encoding */ |
239 }; | 236 }; |
240 | 237 |
241 /* | 238 /* |
242 * A BasicOCSPResponse -- when the responseType in a ResponseBytes is | 239 * A BasicOCSPResponse -- when the responseType in a ResponseBytes is |
243 * id-pkix-ocsp-basic, the "response" OCTET STRING above is the DER | 240 * id-pkix-ocsp-basic, the "response" OCTET STRING above is the DER |
244 * encoding of one of these. | 241 * encoding of one of these. |
245 * | 242 * |
246 * Note that in the OCSP specification, the signature fields are not | 243 * Note that in the OCSP specification, the signature fields are not |
247 * part of a separate sub-structure. But since they are the same fields | 244 * part of a separate sub-structure. But since they are the same fields |
248 * as we define for the signature in a request, it made sense to share | 245 * as we define for the signature in a request, it made sense to share |
249 * the C data structure here and in some shared code to operate on them. | 246 * the C data structure here and in some shared code to operate on them. |
250 */ | 247 */ |
251 struct ocspBasicOCSPResponseStr { | 248 struct ocspBasicOCSPResponseStr { |
252 SECItem tbsResponseDataDER; | 249 SECItem tbsResponseDataDER; |
253 ocspResponseData *tbsResponseData;» /* "tbs" == To Be Signed */ | 250 ocspResponseData *tbsResponseData; /* "tbs" == To Be Signed */ |
254 ocspSignature responseSignature; | 251 ocspSignature responseSignature; |
255 }; | 252 }; |
256 | 253 |
257 /* | 254 /* |
258 * A ResponseData is the part of a BasicOCSPResponse that is signed | 255 * A ResponseData is the part of a BasicOCSPResponse that is signed |
259 * (after it is DER encoded). It contains the real details of the response | 256 * (after it is DER encoded). It contains the real details of the response |
260 * (a per-certificate status). | 257 * (a per-certificate status). |
261 */ | 258 */ |
262 struct ocspResponseDataStr { | 259 struct ocspResponseDataStr { |
263 SECItem version;» » » /* an INTEGER */ | 260 SECItem version; /* an INTEGER */ |
264 SECItem derResponderID; | 261 SECItem derResponderID; |
265 ocspResponderID *responderID;» /* local; not part of encoding */ | 262 ocspResponderID *responderID; /* local; not part of encoding */ |
266 SECItem producedAt;»» » /* a GeneralizedTime */ | 263 SECItem producedAt; /* a GeneralizedTime */ |
267 CERTOCSPSingleResponse **responses; | 264 CERTOCSPSingleResponse **responses; |
268 CERTCertExtension **responseExtensions; | 265 CERTCertExtension **responseExtensions; |
269 }; | 266 }; |
270 | 267 |
271 struct ocspResponderIDStr { | 268 struct ocspResponderIDStr { |
272 CERTOCSPResponderIDType responderIDType;/* local; not part of encoding */ | 269 CERTOCSPResponderIDType responderIDType; /* local; not part of encoding */ |
273 union { | 270 union { |
274 » CERTName name;» » » /* when ocspResponderID_byName */ | 271 CERTName name; /* when ocspResponderID_byName */ |
275 » SECItem keyHash;» » /* when ocspResponderID_byKey */ | 272 SECItem keyHash; /* when ocspResponderID_byKey */ |
276 » SECItem other;» » » /* when ocspResponderID_other */ | 273 SECItem other; /* when ocspResponderID_other */ |
277 } responderIDValue; | 274 } responderIDValue; |
278 }; | 275 }; |
279 | 276 |
280 /* | 277 /* |
281 * The ResponseData in a BasicOCSPResponse contains a SEQUENCE OF | 278 * The ResponseData in a BasicOCSPResponse contains a SEQUENCE OF |
282 * SingleResponse -- one for each certificate whose status is being supplied. | 279 * SingleResponse -- one for each certificate whose status is being supplied. |
283 * | 280 * |
284 * XXX figure out how to get rid of that arena -- there must be a way | 281 * XXX figure out how to get rid of that arena -- there must be a way |
285 */ | 282 */ |
286 struct CERTOCSPSingleResponseStr { | 283 struct CERTOCSPSingleResponseStr { |
287 PLArenaPool *arena;»» » /* just a copy of the response arena, | 284 PLArenaPool *arena; /* just a copy of the response arena, |
288 * needed here for extension handling | 285 * needed here for extension handling |
289 * routines, on creation only */ | 286 * routines, on creation only */ |
290 CERTOCSPCertID *certID; | 287 CERTOCSPCertID *certID; |
291 SECItem derCertStatus; | 288 SECItem derCertStatus; |
292 ocspCertStatus *certStatus;»» /* local; not part of encoding */ | 289 ocspCertStatus *certStatus; /* local; not part of encoding */ |
293 SECItem thisUpdate;»» » /* a GeneralizedTime */ | 290 SECItem thisUpdate; /* a GeneralizedTime */ |
294 SECItem *nextUpdate;» » /* a GeneralizedTime */ | 291 SECItem *nextUpdate; /* a GeneralizedTime */ |
295 CERTCertExtension **singleExtensions; | 292 CERTCertExtension **singleExtensions; |
296 }; | 293 }; |
297 | 294 |
298 /* | 295 /* |
299 * A CertStatus is the actual per-certificate status. Its ASN.1 definition: | 296 * A CertStatus is the actual per-certificate status. Its ASN.1 definition: |
300 * | 297 * |
301 * CertStatus ::= CHOICE { | 298 * CertStatus ::= CHOICE { |
302 * good [0] IMPLICIT NULL, | 299 * good [0] IMPLICIT NULL, |
303 * revoked [1] IMPLICIT RevokedInfo, | 300 * revoked [1] IMPLICIT RevokedInfo, |
304 * unknown [2] IMPLICIT UnknownInfo } | 301 * unknown [2] IMPLICIT UnknownInfo } |
305 * | 302 * |
306 * (where for now UnknownInfo is defined to be NULL but in the | 303 * (where for now UnknownInfo is defined to be NULL but in the |
307 * future may be replaced with an enumeration). | 304 * future may be replaced with an enumeration). |
308 * | 305 * |
309 * Because it is CHOICE, the status value and its associated information | 306 * Because it is CHOICE, the status value and its associated information |
310 * (if any) are actually encoded together. To represent this same | 307 * (if any) are actually encoded together. To represent this same |
311 * information internally, we explicitly define a type and save it, | 308 * information internally, we explicitly define a type and save it, |
312 * along with the value, into a data structure. | 309 * along with the value, into a data structure. |
313 */ | 310 */ |
314 | 311 |
315 typedef enum { | 312 typedef enum { |
316 ocspCertStatus_good,» » /* cert is not revoked */ | 313 ocspCertStatus_good, /* cert is not revoked */ |
317 ocspCertStatus_revoked,» » /* cert is revoked */ | 314 ocspCertStatus_revoked, /* cert is revoked */ |
318 ocspCertStatus_unknown,» » /* cert was unknown to the responder */ | 315 ocspCertStatus_unknown, /* cert was unknown to the responder */ |
319 ocspCertStatus_other» » /* status was not an expected value */ | 316 ocspCertStatus_other /* status was not an expected value */ |
320 } ocspCertStatusType; | 317 } ocspCertStatusType; |
321 | 318 |
322 /* | 319 /* |
323 * This is the actual per-certificate status. | 320 * This is the actual per-certificate status. |
324 * | 321 * |
325 * The "goodInfo" and "unknownInfo" items are only place-holders for a NULL. | 322 * The "goodInfo" and "unknownInfo" items are only place-holders for a NULL. |
326 * (Though someday OCSP may replace UnknownInfo with an enumeration that | 323 * (Though someday OCSP may replace UnknownInfo with an enumeration that |
327 * gives more detailed information.) | 324 * gives more detailed information.) |
328 */ | 325 */ |
329 struct ocspCertStatusStr { | 326 struct ocspCertStatusStr { |
330 ocspCertStatusType certStatusType;» /* local; not part of encoding */ | 327 ocspCertStatusType certStatusType; /* local; not part of encoding */ |
331 union { | 328 union { |
332 » SECItem *goodInfo;» » /* when ocspCertStatus_good */ | 329 SECItem *goodInfo; /* when ocspCertStatus_good */ |
333 » ocspRevokedInfo *revokedInfo;» /* when ocspCertStatus_revoked */ | 330 ocspRevokedInfo *revokedInfo; /* when ocspCertStatus_revoked */ |
334 » SECItem *unknownInfo;» » /* when ocspCertStatus_unknown */ | 331 SECItem *unknownInfo; /* when ocspCertStatus_unknown */ |
335 » SECItem *otherInfo;» » /* when ocspCertStatus_other */ | 332 SECItem *otherInfo; /* when ocspCertStatus_other */ |
336 } certStatusInfo; | 333 } certStatusInfo; |
337 }; | 334 }; |
338 | 335 |
339 /* | 336 /* |
340 * A RevokedInfo gives information about a revoked certificate -- when it | 337 * A RevokedInfo gives information about a revoked certificate -- when it |
341 * was revoked and why. | 338 * was revoked and why. |
342 */ | 339 */ |
343 struct ocspRevokedInfoStr { | 340 struct ocspRevokedInfoStr { |
344 SECItem revocationTime;» » /* a GeneralizedTime */ | 341 SECItem revocationTime; /* a GeneralizedTime */ |
345 SECItem *revocationReason;» » /* a CRLReason; ignored for now */ | 342 SECItem *revocationReason; /* a CRLReason; ignored for now */ |
346 }; | 343 }; |
347 | 344 |
348 /* | 345 /* |
349 * ServiceLocator can be included as one of the singleRequestExtensions. | 346 * ServiceLocator can be included as one of the singleRequestExtensions. |
350 * When added, it specifies the (name of the) issuer of the cert being | 347 * When added, it specifies the (name of the) issuer of the cert being |
351 * checked, and optionally the value of the AuthorityInfoAccess extension | 348 * checked, and optionally the value of the AuthorityInfoAccess extension |
352 * if the cert has one. | 349 * if the cert has one. |
353 */ | 350 */ |
354 struct ocspServiceLocatorStr { | 351 struct ocspServiceLocatorStr { |
355 CERTName *issuer; | 352 CERTName *issuer; |
356 SECItem locator;» /* DER encoded authInfoAccess extension from cert */ | 353 SECItem locator; /* DER encoded authInfoAccess extension from cert */ |
357 }; | 354 }; |
358 | 355 |
359 #endif /* _OCSPTI_H_ */ | 356 #endif /* _OCSPTI_H_ */ |
OLD | NEW |