1/* Generated from digest.asn1 */
2/* Do not edit */
3
4#ifndef __digest_asn1_h__
5#define __digest_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
15struct heim_base_data {
16 size_t length;
17 void *data;
18};
19typedef struct heim_base_data heim_octet_string;
20#endif
21
22typedef struct heim_integer {
23 size_t length;
24 void *data;
25 int negative;
26} heim_integer;
27
28typedef char *heim_general_string;
29
30typedef char *heim_utf8_string;
31
32typedef struct heim_base_data heim_printable_string;
33
34typedef struct heim_base_data heim_ia5_string;
35
36typedef struct heim_bmp_string {
37 size_t length;
38 uint16_t *data;
39} heim_bmp_string;
40
41typedef struct heim_universal_string {
42 size_t length;
43 uint32_t *data;
44} heim_universal_string;
45
46typedef char *heim_visible_string;
47
48typedef struct heim_oid {
49 size_t length;
50 unsigned *components;
51} heim_oid;
52
53typedef struct heim_bit_string {
54 size_t length;
55 void *data;
56} heim_bit_string;
57
58typedef struct heim_base_data heim_any;
59typedef 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
88struct units;
89
90#endif
91
92#include <krb5/krb5_asn1.h>
93/*
94DigestTypes ::= BIT STRING {
95 ntlm-v1(0),
96 ntlm-v1-session(1),
97 ntlm-v2(2),
98 digest-md5(3),
99 chap-md5(4),
100 ms-chap-v2(5)
101}
102*/
103
104typedef struct DigestTypes {
105 unsigned int ntlm_v1:1;
106 unsigned int ntlm_v1_session:1;
107 unsigned int ntlm_v2:1;
108 unsigned int digest_md5:1;
109 unsigned int chap_md5:1;
110 unsigned int ms_chap_v2:1;
111 unsigned int _unused6:1;
112 unsigned int _unused7:1;
113 unsigned int _unused8:1;
114 unsigned int _unused9:1;
115 unsigned int _unused10:1;
116 unsigned int _unused11:1;
117 unsigned int _unused12:1;
118 unsigned int _unused13:1;
119 unsigned int _unused14:1;
120 unsigned int _unused15:1;
121 unsigned int _unused16:1;
122 unsigned int _unused17:1;
123 unsigned int _unused18:1;
124 unsigned int _unused19:1;
125 unsigned int _unused20:1;
126 unsigned int _unused21:1;
127 unsigned int _unused22:1;
128 unsigned int _unused23:1;
129 unsigned int _unused24:1;
130 unsigned int _unused25:1;
131 unsigned int _unused26:1;
132 unsigned int _unused27:1;
133 unsigned int _unused28:1;
134 unsigned int _unused29:1;
135 unsigned int _unused30:1;
136 unsigned int _unused31:1;
137} DigestTypes;
138
139
140unsigned DigestTypes2int(DigestTypes);
141DigestTypes int2DigestTypes(unsigned);
142const struct units * asn1_DigestTypes_units(void);
143ASN1EXP int ASN1CALL decode_DigestTypes(const unsigned char *, size_t, DigestTypes *, size_t *);
144ASN1EXP int ASN1CALL encode_DigestTypes(unsigned char *, size_t, const DigestTypes *, size_t *);
145ASN1EXP size_t ASN1CALL length_DigestTypes(const DigestTypes *);
146ASN1EXP int ASN1CALL copy_DigestTypes (const DigestTypes *, DigestTypes *);
147ASN1EXP void ASN1CALL free_DigestTypes (DigestTypes *);
148
149
150/*
151DigestInit ::= SEQUENCE {
152 type UTF8String,
153 channel [0] SEQUENCE {
154 cb-type UTF8String,
155 cb-binding UTF8String,
156 } OPTIONAL,
157 hostname [1] UTF8String OPTIONAL,
158}
159*/
160
161typedef struct DigestInit {
162 heim_utf8_string type;
163 struct DigestInit_channel {
164 heim_utf8_string cb_type;
165 heim_utf8_string cb_binding;
166 } *channel;
167 heim_utf8_string *hostname;
168} DigestInit;
169
170ASN1EXP int ASN1CALL decode_DigestInit(const unsigned char *, size_t, DigestInit *, size_t *);
171ASN1EXP int ASN1CALL encode_DigestInit(unsigned char *, size_t, const DigestInit *, size_t *);
172ASN1EXP size_t ASN1CALL length_DigestInit(const DigestInit *);
173ASN1EXP int ASN1CALL copy_DigestInit (const DigestInit *, DigestInit *);
174ASN1EXP void ASN1CALL free_DigestInit (DigestInit *);
175
176
177/*
178DigestInitReply ::= SEQUENCE {
179 nonce UTF8String,
180 opaque UTF8String,
181 identifier [0] UTF8String OPTIONAL,
182}
183*/
184
185typedef struct DigestInitReply {
186 heim_utf8_string nonce;
187 heim_utf8_string opaque;
188 heim_utf8_string *identifier;
189} DigestInitReply;
190
191ASN1EXP int ASN1CALL decode_DigestInitReply(const unsigned char *, size_t, DigestInitReply *, size_t *);
192ASN1EXP int ASN1CALL encode_DigestInitReply(unsigned char *, size_t, const DigestInitReply *, size_t *);
193ASN1EXP size_t ASN1CALL length_DigestInitReply(const DigestInitReply *);
194ASN1EXP int ASN1CALL copy_DigestInitReply (const DigestInitReply *, DigestInitReply *);
195ASN1EXP void ASN1CALL free_DigestInitReply (DigestInitReply *);
196
197
198/*
199DigestRequest ::= SEQUENCE {
200 type UTF8String,
201 digest UTF8String,
202 username UTF8String,
203 responseData UTF8String,
204 authid [0] UTF8String OPTIONAL,
205 authentication-user [1] Principal OPTIONAL,
206 realm [2] UTF8String OPTIONAL,
207 method [3] UTF8String OPTIONAL,
208 uri [4] UTF8String OPTIONAL,
209 serverNonce UTF8String,
210 clientNonce [5] UTF8String OPTIONAL,
211 nonceCount [6] UTF8String OPTIONAL,
212 qop [7] UTF8String OPTIONAL,
213 identifier [8] UTF8String OPTIONAL,
214 hostname [9] UTF8String OPTIONAL,
215 opaque UTF8String,
216}
217*/
218
219typedef struct DigestRequest {
220 heim_utf8_string type;
221 heim_utf8_string digest;
222 heim_utf8_string username;
223 heim_utf8_string responseData;
224 heim_utf8_string *authid;
225 Principal *authentication_user;
226 heim_utf8_string *realm;
227 heim_utf8_string *method;
228 heim_utf8_string *uri;
229 heim_utf8_string serverNonce;
230 heim_utf8_string *clientNonce;
231 heim_utf8_string *nonceCount;
232 heim_utf8_string *qop;
233 heim_utf8_string *identifier;
234 heim_utf8_string *hostname;
235 heim_utf8_string opaque;
236} DigestRequest;
237
238ASN1EXP int ASN1CALL decode_DigestRequest(const unsigned char *, size_t, DigestRequest *, size_t *);
239ASN1EXP int ASN1CALL encode_DigestRequest(unsigned char *, size_t, const DigestRequest *, size_t *);
240ASN1EXP size_t ASN1CALL length_DigestRequest(const DigestRequest *);
241ASN1EXP int ASN1CALL copy_DigestRequest (const DigestRequest *, DigestRequest *);
242ASN1EXP void ASN1CALL free_DigestRequest (DigestRequest *);
243
244
245/*
246DigestError ::= SEQUENCE {
247 reason UTF8String,
248 code INTEGER (-2147483648..2147483647),
249}
250*/
251
252typedef struct DigestError {
253 heim_utf8_string reason;
254 int code;
255} DigestError;
256
257ASN1EXP int ASN1CALL decode_DigestError(const unsigned char *, size_t, DigestError *, size_t *);
258ASN1EXP int ASN1CALL encode_DigestError(unsigned char *, size_t, const DigestError *, size_t *);
259ASN1EXP size_t ASN1CALL length_DigestError(const DigestError *);
260ASN1EXP int ASN1CALL copy_DigestError (const DigestError *, DigestError *);
261ASN1EXP void ASN1CALL free_DigestError (DigestError *);
262
263
264/*
265DigestResponse ::= SEQUENCE {
266 success BOOLEAN,
267 rsp [0] UTF8String OPTIONAL,
268 tickets [1] SEQUENCE OF OCTET STRING OPTIONAL,
269 channel [2] SEQUENCE {
270 cb-type UTF8String,
271 cb-binding UTF8String,
272 } OPTIONAL,
273 session-key [3] OCTET STRING OPTIONAL,
274}
275*/
276
277typedef struct DigestResponse {
278 int success;
279 heim_utf8_string *rsp;
280 struct DigestResponse_tickets {
281 unsigned int len;
282 heim_octet_string *val;
283 } *tickets;
284 struct DigestResponse_channel {
285 heim_utf8_string cb_type;
286 heim_utf8_string cb_binding;
287 } *channel;
288 heim_octet_string *session_key;
289} DigestResponse;
290
291ASN1EXP int ASN1CALL decode_DigestResponse(const unsigned char *, size_t, DigestResponse *, size_t *);
292ASN1EXP int ASN1CALL encode_DigestResponse(unsigned char *, size_t, const DigestResponse *, size_t *);
293ASN1EXP size_t ASN1CALL length_DigestResponse(const DigestResponse *);
294ASN1EXP int ASN1CALL copy_DigestResponse (const DigestResponse *, DigestResponse *);
295ASN1EXP void ASN1CALL free_DigestResponse (DigestResponse *);
296
297
298/*
299NTLMInit ::= SEQUENCE {
300 flags [0] INTEGER (0..4294967295),
301 hostname [1] UTF8String OPTIONAL,
302 domain [1] UTF8String OPTIONAL,
303}
304*/
305
306typedef struct NTLMInit {
307 unsigned int flags;
308 heim_utf8_string *hostname;
309 heim_utf8_string *domain;
310} NTLMInit;
311
312ASN1EXP int ASN1CALL decode_NTLMInit(const unsigned char *, size_t, NTLMInit *, size_t *);
313ASN1EXP int ASN1CALL encode_NTLMInit(unsigned char *, size_t, const NTLMInit *, size_t *);
314ASN1EXP size_t ASN1CALL length_NTLMInit(const NTLMInit *);
315ASN1EXP int ASN1CALL copy_NTLMInit (const NTLMInit *, NTLMInit *);
316ASN1EXP void ASN1CALL free_NTLMInit (NTLMInit *);
317
318
319/*
320NTLMInitReply ::= SEQUENCE {
321 flags [0] INTEGER (0..4294967295),
322 opaque [1] OCTET STRING,
323 targetname [2] UTF8String,
324 challenge [3] OCTET STRING,
325 targetinfo [4] OCTET STRING OPTIONAL,
326}
327*/
328
329typedef struct NTLMInitReply {
330 unsigned int flags;
331 heim_octet_string opaque;
332 heim_utf8_string targetname;
333 heim_octet_string challenge;
334 heim_octet_string *targetinfo;
335} NTLMInitReply;
336
337ASN1EXP int ASN1CALL decode_NTLMInitReply(const unsigned char *, size_t, NTLMInitReply *, size_t *);
338ASN1EXP int ASN1CALL encode_NTLMInitReply(unsigned char *, size_t, const NTLMInitReply *, size_t *);
339ASN1EXP size_t ASN1CALL length_NTLMInitReply(const NTLMInitReply *);
340ASN1EXP int ASN1CALL copy_NTLMInitReply (const NTLMInitReply *, NTLMInitReply *);
341ASN1EXP void ASN1CALL free_NTLMInitReply (NTLMInitReply *);
342
343
344/*
345NTLMRequest ::= SEQUENCE {
346 flags [0] INTEGER (0..4294967295),
347 opaque [1] OCTET STRING,
348 username [2] UTF8String,
349 targetname [3] UTF8String,
350 targetinfo [4] OCTET STRING OPTIONAL,
351 lm [5] OCTET STRING,
352 ntlm [6] OCTET STRING,
353 sessionkey [7] OCTET STRING OPTIONAL,
354}
355*/
356
357typedef struct NTLMRequest {
358 unsigned int flags;
359 heim_octet_string opaque;
360 heim_utf8_string username;
361 heim_utf8_string targetname;
362 heim_octet_string *targetinfo;
363 heim_octet_string lm;
364 heim_octet_string ntlm;
365 heim_octet_string *sessionkey;
366} NTLMRequest;
367
368ASN1EXP int ASN1CALL decode_NTLMRequest(const unsigned char *, size_t, NTLMRequest *, size_t *);
369ASN1EXP int ASN1CALL encode_NTLMRequest(unsigned char *, size_t, const NTLMRequest *, size_t *);
370ASN1EXP size_t ASN1CALL length_NTLMRequest(const NTLMRequest *);
371ASN1EXP int ASN1CALL copy_NTLMRequest (const NTLMRequest *, NTLMRequest *);
372ASN1EXP void ASN1CALL free_NTLMRequest (NTLMRequest *);
373
374
375/*
376NTLMResponse ::= SEQUENCE {
377 success [0] BOOLEAN,
378 flags [1] INTEGER (0..4294967295),
379 sessionkey [2] OCTET STRING OPTIONAL,
380 tickets [3] SEQUENCE OF OCTET STRING OPTIONAL,
381}
382*/
383
384typedef struct NTLMResponse {
385 int success;
386 unsigned int flags;
387 heim_octet_string *sessionkey;
388 struct NTLMResponse_tickets {
389 unsigned int len;
390 heim_octet_string *val;
391 } *tickets;
392} NTLMResponse;
393
394ASN1EXP int ASN1CALL decode_NTLMResponse(const unsigned char *, size_t, NTLMResponse *, size_t *);
395ASN1EXP int ASN1CALL encode_NTLMResponse(unsigned char *, size_t, const NTLMResponse *, size_t *);
396ASN1EXP size_t ASN1CALL length_NTLMResponse(const NTLMResponse *);
397ASN1EXP int ASN1CALL copy_NTLMResponse (const NTLMResponse *, NTLMResponse *);
398ASN1EXP void ASN1CALL free_NTLMResponse (NTLMResponse *);
399
400
401/*
402NTLMRequest2 ::= SEQUENCE {
403 loginUserName [0] UTF8String,
404 loginDomainName [1] UTF8String,
405 flags [2] INTEGER (0..4294967295),
406 lmchallenge [3] OCTET STRING,
407 ntChallengeResponce [4] OCTET STRING,
408 lmChallengeResponce [5] OCTET STRING,
409}
410*/
411
412typedef struct NTLMRequest2 {
413 heim_utf8_string loginUserName;
414 heim_utf8_string loginDomainName;
415 unsigned int flags;
416 heim_octet_string lmchallenge;
417 heim_octet_string ntChallengeResponce;
418 heim_octet_string lmChallengeResponce;
419} NTLMRequest2;
420
421ASN1EXP int ASN1CALL decode_NTLMRequest2(const unsigned char *, size_t, NTLMRequest2 *, size_t *);
422ASN1EXP int ASN1CALL encode_NTLMRequest2(unsigned char *, size_t, const NTLMRequest2 *, size_t *);
423ASN1EXP size_t ASN1CALL length_NTLMRequest2(const NTLMRequest2 *);
424ASN1EXP int ASN1CALL copy_NTLMRequest2 (const NTLMRequest2 *, NTLMRequest2 *);
425ASN1EXP void ASN1CALL free_NTLMRequest2 (NTLMRequest2 *);
426
427
428/*
429NTLMReply ::= SEQUENCE {
430 success [0] BOOLEAN,
431 flags [1] INTEGER (0..4294967295),
432 sessionkey [2] OCTET STRING OPTIONAL,
433}
434*/
435
436typedef struct NTLMReply {
437 int success;
438 unsigned int flags;
439 heim_octet_string *sessionkey;
440} NTLMReply;
441
442ASN1EXP int ASN1CALL decode_NTLMReply(const unsigned char *, size_t, NTLMReply *, size_t *);
443ASN1EXP int ASN1CALL encode_NTLMReply(unsigned char *, size_t, const NTLMReply *, size_t *);
444ASN1EXP size_t ASN1CALL length_NTLMReply(const NTLMReply *);
445ASN1EXP int ASN1CALL copy_NTLMReply (const NTLMReply *, NTLMReply *);
446ASN1EXP void ASN1CALL free_NTLMReply (NTLMReply *);
447
448
449/*
450DigestReqInner ::= CHOICE {
451 init [0] DigestInit,
452 digestRequest [1] DigestRequest,
453 ntlmInit [2] NTLMInit,
454 ntlmRequest [3] NTLMRequest,
455 supportedMechs [4] NULL,
456}
457*/
458
459typedef struct DigestReqInner {
460 enum DigestReqInner_enum {
461 choice_DigestReqInner_init = 1,
462 choice_DigestReqInner_digestRequest,
463 choice_DigestReqInner_ntlmInit,
464 choice_DigestReqInner_ntlmRequest,
465 choice_DigestReqInner_supportedMechs
466 } element;
467 union {
468 DigestInit init;
469 DigestRequest digestRequest;
470 NTLMInit ntlmInit;
471 NTLMRequest ntlmRequest;
472 int supportedMechs;
473 } u;
474} DigestReqInner;
475
476ASN1EXP int ASN1CALL decode_DigestReqInner(const unsigned char *, size_t, DigestReqInner *, size_t *);
477ASN1EXP int ASN1CALL encode_DigestReqInner(unsigned char *, size_t, const DigestReqInner *, size_t *);
478ASN1EXP size_t ASN1CALL length_DigestReqInner(const DigestReqInner *);
479ASN1EXP int ASN1CALL copy_DigestReqInner (const DigestReqInner *, DigestReqInner *);
480ASN1EXP void ASN1CALL free_DigestReqInner (DigestReqInner *);
481
482
483/*
484DigestREQ ::= [APPLICATION 128] SEQUENCE {
485 apReq [0] OCTET STRING,
486 innerReq [1] EncryptedData,
487}
488*/
489
490typedef struct DigestREQ {
491 heim_octet_string apReq;
492 EncryptedData innerReq;
493} DigestREQ;
494
495ASN1EXP int ASN1CALL decode_DigestREQ(const unsigned char *, size_t, DigestREQ *, size_t *);
496ASN1EXP int ASN1CALL encode_DigestREQ(unsigned char *, size_t, const DigestREQ *, size_t *);
497ASN1EXP size_t ASN1CALL length_DigestREQ(const DigestREQ *);
498ASN1EXP int ASN1CALL copy_DigestREQ (const DigestREQ *, DigestREQ *);
499ASN1EXP void ASN1CALL free_DigestREQ (DigestREQ *);
500
501
502/*
503DigestRepInner ::= CHOICE {
504 error [0] DigestError,
505 initReply [1] DigestInitReply,
506 response [2] DigestResponse,
507 ntlmInitReply [3] NTLMInitReply,
508 ntlmResponse [4] NTLMResponse,
509 supportedMechs [5] DigestTypes,
510 ...,
511}
512*/
513
514typedef struct DigestRepInner {
515 enum DigestRepInner_enum {
516 choice_DigestRepInner_asn1_ellipsis = 0,
517 choice_DigestRepInner_error,
518 choice_DigestRepInner_initReply,
519 choice_DigestRepInner_response,
520 choice_DigestRepInner_ntlmInitReply,
521 choice_DigestRepInner_ntlmResponse,
522 choice_DigestRepInner_supportedMechs
523 /* ... */
524 } element;
525 union {
526 DigestError error;
527 DigestInitReply initReply;
528 DigestResponse response;
529 NTLMInitReply ntlmInitReply;
530 NTLMResponse ntlmResponse;
531 DigestTypes supportedMechs;
532 heim_octet_string asn1_ellipsis;
533 } u;
534} DigestRepInner;
535
536ASN1EXP int ASN1CALL decode_DigestRepInner(const unsigned char *, size_t, DigestRepInner *, size_t *);
537ASN1EXP int ASN1CALL encode_DigestRepInner(unsigned char *, size_t, const DigestRepInner *, size_t *);
538ASN1EXP size_t ASN1CALL length_DigestRepInner(const DigestRepInner *);
539ASN1EXP int ASN1CALL copy_DigestRepInner (const DigestRepInner *, DigestRepInner *);
540ASN1EXP void ASN1CALL free_DigestRepInner (DigestRepInner *);
541
542
543/*
544DigestREP ::= [APPLICATION 129] SEQUENCE {
545 apRep [0] OCTET STRING,
546 innerRep [1] EncryptedData,
547}
548*/
549
550typedef struct DigestREP {
551 heim_octet_string apRep;
552 EncryptedData innerRep;
553} DigestREP;
554
555ASN1EXP int ASN1CALL decode_DigestREP(const unsigned char *, size_t, DigestREP *, size_t *);
556ASN1EXP int ASN1CALL encode_DigestREP(unsigned char *, size_t, const DigestREP *, size_t *);
557ASN1EXP size_t ASN1CALL length_DigestREP(const DigestREP *);
558ASN1EXP int ASN1CALL copy_DigestREP (const DigestREP *, DigestREP *);
559ASN1EXP void ASN1CALL free_DigestREP (DigestREP *);
560
561
562#endif /* __digest_asn1_h__ */
563