Debian Codegraph @

build_helpers/heimdal/include/ocsp_asn1.h

raw
1 /* Generated from ./ocsp.asn1 */
2 /* Do not edit */
3
4 #ifndef __ocsp_asn1_h__
5 #define __ocsp_asn1_h__
6
7 #include <stddef.h>
8 #include <time.h>
9
10 #ifndef __asn1_common_definitions__
11 #define __asn1_common_definitions__
12
13 #ifndef __HEIM_BASE_DATA__
14 #define __HEIM_BASE_DATA__ 1
15 struct heim_base_data {
16 size_t length;
17 void *data;
18 };
19 typedef struct heim_base_data heim_octet_string;
20 #endif
21
22 typedef struct heim_integer {
23 size_t length;
24 void *data;
25 int negative;
26 } heim_integer;
27
28 typedef char *heim_general_string;
29
30 typedef char *heim_utf8_string;
31
32 typedef struct heim_base_data heim_printable_string;
33
34 typedef struct heim_base_data heim_ia5_string;
35
36 typedef struct heim_bmp_string {
37 size_t length;
38 uint16_t *data;
39 } heim_bmp_string;
40
41 typedef struct heim_universal_string {
42 size_t length;
43 uint32_t *data;
44 } heim_universal_string;
45
46 typedef char *heim_visible_string;
47
48 typedef struct heim_oid {
49 size_t length;
50 unsigned *components;
51 } heim_oid;
52
53 typedef struct heim_bit_string {
54 size_t length;
55 void *data;
56 } heim_bit_string;
57
58 typedef struct heim_base_data heim_any;
59 typedef struct heim_base_data heim_any_set;
60
61 #define ASN1_MALLOC_ENCODE(T, B, BL, S, L, R) \
62 do { \
63 (BL) = length_##T((S)); \
64 (B) = malloc((BL)); \
65 if((B) == NULL) { \
66 (R) = ENOMEM; \
67 } else { \
68 (R) = encode_##T(((unsigned char*)(B)) + (BL) - 1, (BL), \
69 (S), (L)); \
70 if((R) != 0) { \
71 free((B)); \
72 (B) = NULL; \
73 } \
74 } \
75 } while (0)
76
77 #ifdef _WIN32
78 #ifndef ASN1_LIB
79 #define ASN1EXP __declspec(dllimport)
80 #else
81 #define ASN1EXP
82 #endif
83 #define ASN1CALL __stdcall
84 #else
85 #define ASN1EXP
86 #define ASN1CALL
87 #endif
88 struct units;
89
90 #endif
91
92 #include <rfc2459_asn1.h>
93 /*
94 OCSPVersion ::= INTEGER {
95 ocsp_v1(0)
96 }
97 */
98
99 typedef enum OCSPVersion {
100 ocsp_v1 = 0
101 } OCSPVersion;
102
103 ASN1EXP int ASN1CALL decode_OCSPVersion(const unsigned char *, size_t, OCSPVersion *, size_t *);
104 ASN1EXP int ASN1CALL encode_OCSPVersion(unsigned char *, size_t, const OCSPVersion *, size_t *);
105 ASN1EXP size_t ASN1CALL length_OCSPVersion(const OCSPVersion *);
106 ASN1EXP int ASN1CALL copy_OCSPVersion (const OCSPVersion *, OCSPVersion *);
107 ASN1EXP void ASN1CALL free_OCSPVersion (OCSPVersion *);
108
109
110 /*
111 OCSPCertStatus ::= CHOICE {
112 good [0] IMPLICIT NULL,
113 revoked [1] IMPLICIT SEQUENCE {
114 revocationTime GeneralizedTime,
115 revocationReason [0] CRLReason OPTIONAL,
116 },
117 unknown [2] IMPLICIT NULL,
118 }
119 */
120
121 typedef struct OCSPCertStatus {
122 enum OCSPCertStatus_enum {
123 choice_OCSPCertStatus_good = 1,
124 choice_OCSPCertStatus_revoked,
125 choice_OCSPCertStatus_unknown
126 } element;
127 union {
128 int good;
129 struct OCSPCertStatus_revoked {
130 time_t revocationTime;
131 CRLReason *revocationReason;
132 } revoked;
133 int unknown;
134 } u;
135 } OCSPCertStatus;
136
137 ASN1EXP int ASN1CALL decode_OCSPCertStatus(const unsigned char *, size_t, OCSPCertStatus *, size_t *);
138 ASN1EXP int ASN1CALL encode_OCSPCertStatus(unsigned char *, size_t, const OCSPCertStatus *, size_t *);
139 ASN1EXP size_t ASN1CALL length_OCSPCertStatus(const OCSPCertStatus *);
140 ASN1EXP int ASN1CALL copy_OCSPCertStatus (const OCSPCertStatus *, OCSPCertStatus *);
141 ASN1EXP void ASN1CALL free_OCSPCertStatus (OCSPCertStatus *);
142
143
144 /*
145 OCSPCertID ::= SEQUENCE {
146 hashAlgorithm AlgorithmIdentifier,
147 issuerNameHash OCTET STRING,
148 issuerKeyHash OCTET STRING,
149 serialNumber CertificateSerialNumber,
150 }
151 */
152
153 typedef struct OCSPCertID {
154 AlgorithmIdentifier hashAlgorithm;
155 heim_octet_string issuerNameHash;
156 heim_octet_string issuerKeyHash;
157 CertificateSerialNumber serialNumber;
158 } OCSPCertID;
159
160 ASN1EXP int ASN1CALL decode_OCSPCertID(const unsigned char *, size_t, OCSPCertID *, size_t *);
161 ASN1EXP int ASN1CALL encode_OCSPCertID(unsigned char *, size_t, const OCSPCertID *, size_t *);
162 ASN1EXP size_t ASN1CALL length_OCSPCertID(const OCSPCertID *);
163 ASN1EXP int ASN1CALL copy_OCSPCertID (const OCSPCertID *, OCSPCertID *);
164 ASN1EXP void ASN1CALL free_OCSPCertID (OCSPCertID *);
165
166
167 /*
168 OCSPSingleResponse ::= SEQUENCE {
169 certID OCSPCertID,
170 certStatus OCSPCertStatus,
171 thisUpdate GeneralizedTime,
172 nextUpdate [0] GeneralizedTime OPTIONAL,
173 singleExtensions [1] Extensions OPTIONAL,
174 }
175 */
176
177 typedef struct OCSPSingleResponse {
178 OCSPCertID certID;
179 OCSPCertStatus certStatus;
180 time_t thisUpdate;
181 time_t *nextUpdate;
182 Extensions *singleExtensions;
183 } OCSPSingleResponse;
184
185 ASN1EXP int ASN1CALL decode_OCSPSingleResponse(const unsigned char *, size_t, OCSPSingleResponse *, size_t *);
186 ASN1EXP int ASN1CALL encode_OCSPSingleResponse(unsigned char *, size_t, const OCSPSingleResponse *, size_t *);
187 ASN1EXP size_t ASN1CALL length_OCSPSingleResponse(const OCSPSingleResponse *);
188 ASN1EXP int ASN1CALL copy_OCSPSingleResponse (const OCSPSingleResponse *, OCSPSingleResponse *);
189 ASN1EXP void ASN1CALL free_OCSPSingleResponse (OCSPSingleResponse *);
190
191
192 /*
193 OCSPInnerRequest ::= SEQUENCE {
194 reqCert OCSPCertID,
195 singleRequestExtensions [0] Extensions OPTIONAL,
196 }
197 */
198
199 typedef struct OCSPInnerRequest {
200 OCSPCertID reqCert;
201 Extensions *singleRequestExtensions;
202 } OCSPInnerRequest;
203
204 ASN1EXP int ASN1CALL decode_OCSPInnerRequest(const unsigned char *, size_t, OCSPInnerRequest *, size_t *);
205 ASN1EXP int ASN1CALL encode_OCSPInnerRequest(unsigned char *, size_t, const OCSPInnerRequest *, size_t *);
206 ASN1EXP size_t ASN1CALL length_OCSPInnerRequest(const OCSPInnerRequest *);
207 ASN1EXP int ASN1CALL copy_OCSPInnerRequest (const OCSPInnerRequest *, OCSPInnerRequest *);
208 ASN1EXP void ASN1CALL free_OCSPInnerRequest (OCSPInnerRequest *);
209
210
211 /*
212 OCSPTBSRequest ::= SEQUENCE {
213 version [0] OCSPVersion OPTIONAL,
214 requestorName [1] GeneralName OPTIONAL,
215 requestList SEQUENCE OF OCSPInnerRequest,
216 requestExtensions [2] Extensions OPTIONAL,
217 }
218 */
219
220 typedef struct OCSPTBSRequest {
221 heim_octet_string _save;
222 OCSPVersion *version;
223 GeneralName *requestorName;
224 struct OCSPTBSRequest_requestList {
225 unsigned int len;
226 OCSPInnerRequest *val;
227 } requestList;
228 Extensions *requestExtensions;
229 } OCSPTBSRequest;
230
231 ASN1EXP int ASN1CALL decode_OCSPTBSRequest(const unsigned char *, size_t, OCSPTBSRequest *, size_t *);
232 ASN1EXP int ASN1CALL encode_OCSPTBSRequest(unsigned char *, size_t, const OCSPTBSRequest *, size_t *);
233 ASN1EXP size_t ASN1CALL length_OCSPTBSRequest(const OCSPTBSRequest *);
234 ASN1EXP int ASN1CALL copy_OCSPTBSRequest (const OCSPTBSRequest *, OCSPTBSRequest *);
235 ASN1EXP void ASN1CALL free_OCSPTBSRequest (OCSPTBSRequest *);
236
237
238 /*
239 OCSPSignature ::= SEQUENCE {
240 signatureAlgorithm AlgorithmIdentifier,
241 signature BIT STRING {
242 },
243 certs [0] SEQUENCE OF Certificate OPTIONAL,
244 }
245 */
246
247 typedef struct OCSPSignature {
248 AlgorithmIdentifier signatureAlgorithm;
249 heim_bit_string signature;
250 struct OCSPSignature_certs {
251 unsigned int len;
252 Certificate *val;
253 } *certs;
254 } OCSPSignature;
255
256 ASN1EXP int ASN1CALL decode_OCSPSignature(const unsigned char *, size_t, OCSPSignature *, size_t *);
257 ASN1EXP int ASN1CALL encode_OCSPSignature(unsigned char *, size_t, const OCSPSignature *, size_t *);
258 ASN1EXP size_t ASN1CALL length_OCSPSignature(const OCSPSignature *);
259 ASN1EXP int ASN1CALL copy_OCSPSignature (const OCSPSignature *, OCSPSignature *);
260 ASN1EXP void ASN1CALL free_OCSPSignature (OCSPSignature *);
261
262
263 /*
264 OCSPRequest ::= SEQUENCE {
265 tbsRequest OCSPTBSRequest,
266 optionalSignature [0] OCSPSignature OPTIONAL,
267 }
268 */
269
270 typedef struct OCSPRequest {
271 OCSPTBSRequest tbsRequest;
272 OCSPSignature *optionalSignature;
273 } OCSPRequest;
274
275 ASN1EXP int ASN1CALL decode_OCSPRequest(const unsigned char *, size_t, OCSPRequest *, size_t *);
276 ASN1EXP int ASN1CALL encode_OCSPRequest(unsigned char *, size_t, const OCSPRequest *, size_t *);
277 ASN1EXP size_t ASN1CALL length_OCSPRequest(const OCSPRequest *);
278 ASN1EXP int ASN1CALL copy_OCSPRequest (const OCSPRequest *, OCSPRequest *);
279 ASN1EXP void ASN1CALL free_OCSPRequest (OCSPRequest *);
280
281
282 /*
283 OCSPResponseBytes ::= SEQUENCE {
284 responseType OBJECT IDENTIFIER,
285 response OCTET STRING,
286 }
287 */
288
289 typedef struct OCSPResponseBytes {
290 heim_oid responseType;
291 heim_octet_string response;
292 } OCSPResponseBytes;
293
294 ASN1EXP int ASN1CALL decode_OCSPResponseBytes(const unsigned char *, size_t, OCSPResponseBytes *, size_t *);
295 ASN1EXP int ASN1CALL encode_OCSPResponseBytes(unsigned char *, size_t, const OCSPResponseBytes *, size_t *);
296 ASN1EXP size_t ASN1CALL length_OCSPResponseBytes(const OCSPResponseBytes *);
297 ASN1EXP int ASN1CALL copy_OCSPResponseBytes (const OCSPResponseBytes *, OCSPResponseBytes *);
298 ASN1EXP void ASN1CALL free_OCSPResponseBytes (OCSPResponseBytes *);
299
300
301 /*
302 OCSPResponseStatus ::= INTEGER {
303 successful(0),
304 malformedRequest(1),
305 internalError(2),
306 tryLater(3),
307 sigRequired(5),
308 unauthorized(6)
309 }
310 */
311
312 typedef enum OCSPResponseStatus {
313 successful = 0,
314 malformedRequest = 1,
315 internalError = 2,
316 tryLater = 3,
317 sigRequired = 5,
318 unauthorized = 6
319 } OCSPResponseStatus;
320
321 ASN1EXP int ASN1CALL decode_OCSPResponseStatus(const unsigned char *, size_t, OCSPResponseStatus *, size_t *);
322 ASN1EXP int ASN1CALL encode_OCSPResponseStatus(unsigned char *, size_t, const OCSPResponseStatus *, size_t *);
323 ASN1EXP size_t ASN1CALL length_OCSPResponseStatus(const OCSPResponseStatus *);
324 ASN1EXP int ASN1CALL copy_OCSPResponseStatus (const OCSPResponseStatus *, OCSPResponseStatus *);
325 ASN1EXP void ASN1CALL free_OCSPResponseStatus (OCSPResponseStatus *);
326
327
328 /*
329 OCSPResponse ::= SEQUENCE {
330 responseStatus OCSPResponseStatus,
331 responseBytes [0] OCSPResponseBytes OPTIONAL,
332 }
333 */
334
335 typedef struct OCSPResponse {
336 OCSPResponseStatus responseStatus;
337 OCSPResponseBytes *responseBytes;
338 } OCSPResponse;
339
340 ASN1EXP int ASN1CALL decode_OCSPResponse(const unsigned char *, size_t, OCSPResponse *, size_t *);
341 ASN1EXP int ASN1CALL encode_OCSPResponse(unsigned char *, size_t, const OCSPResponse *, size_t *);
342 ASN1EXP size_t ASN1CALL length_OCSPResponse(const OCSPResponse *);
343 ASN1EXP int ASN1CALL copy_OCSPResponse (const OCSPResponse *, OCSPResponse *);
344 ASN1EXP void ASN1CALL free_OCSPResponse (OCSPResponse *);
345
346
347 /*
348 OCSPKeyHash ::= OCTET STRING
349 */
350
351 typedef heim_octet_string OCSPKeyHash;
352
353 ASN1EXP int ASN1CALL decode_OCSPKeyHash(const unsigned char *, size_t, OCSPKeyHash *, size_t *);
354 ASN1EXP int ASN1CALL encode_OCSPKeyHash(unsigned char *, size_t, const OCSPKeyHash *, size_t *);
355 ASN1EXP size_t ASN1CALL length_OCSPKeyHash(const OCSPKeyHash *);
356 ASN1EXP int ASN1CALL copy_OCSPKeyHash (const OCSPKeyHash *, OCSPKeyHash *);
357 ASN1EXP void ASN1CALL free_OCSPKeyHash (OCSPKeyHash *);
358
359
360 /*
361 OCSPResponderID ::= CHOICE {
362 byName [1] Name,
363 byKey [2] OCSPKeyHash,
364 }
365 */
366
367 typedef struct OCSPResponderID {
368 enum OCSPResponderID_enum {
369 choice_OCSPResponderID_byName = 1,
370 choice_OCSPResponderID_byKey
371 } element;
372 union {
373 Name byName;
374 OCSPKeyHash byKey;
375 } u;
376 } OCSPResponderID;
377
378 ASN1EXP int ASN1CALL decode_OCSPResponderID(const unsigned char *, size_t, OCSPResponderID *, size_t *);
379 ASN1EXP int ASN1CALL encode_OCSPResponderID(unsigned char *, size_t, const OCSPResponderID *, size_t *);
380 ASN1EXP size_t ASN1CALL length_OCSPResponderID(const OCSPResponderID *);
381 ASN1EXP int ASN1CALL copy_OCSPResponderID (const OCSPResponderID *, OCSPResponderID *);
382 ASN1EXP void ASN1CALL free_OCSPResponderID (OCSPResponderID *);
383
384
385 /*
386 OCSPResponseData ::= SEQUENCE {
387 version [0] OCSPVersion OPTIONAL,
388 responderID OCSPResponderID,
389 producedAt GeneralizedTime,
390 responses SEQUENCE OF OCSPSingleResponse,
391 responseExtensions [1] Extensions OPTIONAL,
392 }
393 */
394
395 typedef struct OCSPResponseData {
396 heim_octet_string _save;
397 OCSPVersion *version;
398 OCSPResponderID responderID;
399 time_t producedAt;
400 struct OCSPResponseData_responses {
401 unsigned int len;
402 OCSPSingleResponse *val;
403 } responses;
404 Extensions *responseExtensions;
405 } OCSPResponseData;
406
407 ASN1EXP int ASN1CALL decode_OCSPResponseData(const unsigned char *, size_t, OCSPResponseData *, size_t *);
408 ASN1EXP int ASN1CALL encode_OCSPResponseData(unsigned char *, size_t, const OCSPResponseData *, size_t *);
409 ASN1EXP size_t ASN1CALL length_OCSPResponseData(const OCSPResponseData *);
410 ASN1EXP int ASN1CALL copy_OCSPResponseData (const OCSPResponseData *, OCSPResponseData *);
411 ASN1EXP void ASN1CALL free_OCSPResponseData (OCSPResponseData *);
412
413
414 /*
415 OCSPBasicOCSPResponse ::= SEQUENCE {
416 tbsResponseData OCSPResponseData,
417 signatureAlgorithm AlgorithmIdentifier,
418 signature BIT STRING {
419 },
420 certs [0] SEQUENCE OF Certificate OPTIONAL,
421 }
422 */
423
424 typedef struct OCSPBasicOCSPResponse {
425 OCSPResponseData tbsResponseData;
426 AlgorithmIdentifier signatureAlgorithm;
427 heim_bit_string signature;
428 struct OCSPBasicOCSPResponse_certs {
429 unsigned int len;
430 Certificate *val;
431 } *certs;
432 } OCSPBasicOCSPResponse;
433
434 ASN1EXP int ASN1CALL decode_OCSPBasicOCSPResponse(const unsigned char *, size_t, OCSPBasicOCSPResponse *, size_t *);
435 ASN1EXP int ASN1CALL encode_OCSPBasicOCSPResponse(unsigned char *, size_t, const OCSPBasicOCSPResponse *, size_t *);
436 ASN1EXP size_t ASN1CALL length_OCSPBasicOCSPResponse(const OCSPBasicOCSPResponse *);
437 ASN1EXP int ASN1CALL copy_OCSPBasicOCSPResponse (const OCSPBasicOCSPResponse *, OCSPBasicOCSPResponse *);
438 ASN1EXP void ASN1CALL free_OCSPBasicOCSPResponse (OCSPBasicOCSPResponse *);
439
440
441 /* OBJECT IDENTIFIER id-pkix-ocsp ::= { iso(1) identified-organization(3) dod(6) internet(1) security(5) mechanisms(5) pkix(7) pkix-ad(48) label-less(1) } */
442 extern ASN1EXP const heim_oid asn1_oid_id_pkix_ocsp;
443 #define ASN1_OID_ID_PKIX_OCSP (&asn1_oid_id_pkix_ocsp)
444
445 /* OBJECT IDENTIFIER id-pkix-ocsp-basic ::= { iso(1) identified-organization(3) dod(6) internet(1) security(5) mechanisms(5) pkix(7) pkix-ad(48) label-less(1) label-less(1) } */
446 extern ASN1EXP const heim_oid asn1_oid_id_pkix_ocsp_basic;
447 #define ASN1_OID_ID_PKIX_OCSP_BASIC (&asn1_oid_id_pkix_ocsp_basic)
448
449 /* OBJECT IDENTIFIER id-pkix-ocsp-nonce ::= { iso(1) identified-organization(3) dod(6) internet(1) security(5) mechanisms(5) pkix(7) pkix-ad(48) label-less(1) label-less(2) } */
450 extern ASN1EXP const heim_oid asn1_oid_id_pkix_ocsp_nonce;
451 #define ASN1_OID_ID_PKIX_OCSP_NONCE (&asn1_oid_id_pkix_ocsp_nonce)
452
453 #endif /* __ocsp_asn1_h__ */