2 /* Written by Vern Staats <staatsvr@asc.hpc.mil> for the OpenSSL project,
\r
3 ** using ocsp/{*.h,*asn*.c} as a starting point
\r
6 /* ====================================================================
\r
7 * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
\r
9 * Redistribution and use in source and binary forms, with or without
\r
10 * modification, are permitted provided that the following conditions
\r
13 * 1. Redistributions of source code must retain the above copyright
\r
14 * notice, this list of conditions and the following disclaimer.
\r
16 * 2. Redistributions in binary form must reproduce the above copyright
\r
17 * notice, this list of conditions and the following disclaimer in
\r
18 * the documentation and/or other materials provided with the
\r
21 * 3. All advertising materials mentioning features or use of this
\r
22 * software must display the following acknowledgment:
\r
23 * "This product includes software developed by the OpenSSL Project
\r
24 * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
\r
26 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
\r
27 * endorse or promote products derived from this software without
\r
28 * prior written permission. For written permission, please contact
\r
29 * openssl-core@openssl.org.
\r
31 * 5. Products derived from this software may not be called "OpenSSL"
\r
32 * nor may "OpenSSL" appear in their names without prior written
\r
33 * permission of the OpenSSL Project.
\r
35 * 6. Redistributions of any form whatsoever must retain the following
\r
37 * "This product includes software developed by the OpenSSL Project
\r
38 * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
\r
40 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
\r
41 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
\r
42 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
\r
43 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
\r
44 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
\r
45 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
\r
46 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
\r
47 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
\r
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
\r
49 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
\r
50 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
\r
51 * OF THE POSSIBILITY OF SUCH DAMAGE.
\r
52 * ====================================================================
\r
54 * This product includes cryptographic software written by Eric Young
\r
55 * (eay@cryptsoft.com). This product includes software written by Tim
\r
56 * Hudson (tjh@cryptsoft.com).
\r
60 #ifndef HEADER_KRB5_ASN_H
\r
61 #define HEADER_KRB5_ASN_H
\r
66 #include <openssl/safestack.h>
\r
73 /* ASN.1 from Kerberos RFC 1510
\r
76 /* EncryptedData ::= SEQUENCE {
\r
77 ** etype[0] INTEGER, -- EncryptionType
\r
78 ** kvno[1] INTEGER OPTIONAL,
\r
79 ** cipher[2] OCTET STRING -- ciphertext
\r
82 typedef struct krb5_encdata_st
\r
84 ASN1_INTEGER *etype;
\r
86 ASN1_OCTET_STRING *cipher;
\r
89 DECLARE_STACK_OF(KRB5_ENCDATA)
\r
91 /* PrincipalName ::= SEQUENCE {
\r
92 ** name-type[0] INTEGER,
\r
93 ** name-string[1] SEQUENCE OF GeneralString
\r
96 typedef struct krb5_princname_st
\r
98 ASN1_INTEGER *nametype;
\r
99 STACK_OF(ASN1_GENERALSTRING) *namestring;
\r
102 DECLARE_STACK_OF(KRB5_PRINCNAME)
\r
105 /* Ticket ::= [APPLICATION 1] SEQUENCE {
\r
106 ** tkt-vno[0] INTEGER,
\r
108 ** sname[2] PrincipalName,
\r
109 ** enc-part[3] EncryptedData
\r
112 typedef struct krb5_tktbody_st
\r
114 ASN1_INTEGER *tktvno;
\r
115 ASN1_GENERALSTRING *realm;
\r
116 KRB5_PRINCNAME *sname;
\r
117 KRB5_ENCDATA *encdata;
\r
120 typedef STACK_OF(KRB5_TKTBODY) KRB5_TICKET;
\r
121 DECLARE_STACK_OF(KRB5_TKTBODY)
\r
124 /* AP-REQ ::= [APPLICATION 14] SEQUENCE {
\r
125 ** pvno[0] INTEGER,
\r
126 ** msg-type[1] INTEGER,
\r
127 ** ap-options[2] APOptions,
\r
128 ** ticket[3] Ticket,
\r
129 ** authenticator[4] EncryptedData
\r
132 ** APOptions ::= BIT STRING {
\r
133 ** reserved(0), use-session-key(1), mutual-required(2) }
\r
135 typedef struct krb5_ap_req_st
\r
137 ASN1_INTEGER *pvno;
\r
138 ASN1_INTEGER *msgtype;
\r
139 ASN1_BIT_STRING *apoptions;
\r
140 KRB5_TICKET *ticket;
\r
141 KRB5_ENCDATA *authenticator;
\r
144 typedef STACK_OF(KRB5_APREQBODY) KRB5_APREQ;
\r
145 DECLARE_STACK_OF(KRB5_APREQBODY)
\r
148 /* Authenticator Stuff */
\r
151 /* Checksum ::= SEQUENCE {
\r
152 ** cksumtype[0] INTEGER,
\r
153 ** checksum[1] OCTET STRING
\r
156 typedef struct krb5_checksum_st
\r
158 ASN1_INTEGER *ctype;
\r
159 ASN1_OCTET_STRING *checksum;
\r
162 DECLARE_STACK_OF(KRB5_CHECKSUM)
\r
165 /* EncryptionKey ::= SEQUENCE {
\r
166 ** keytype[0] INTEGER,
\r
167 ** keyvalue[1] OCTET STRING
\r
170 typedef struct krb5_encryptionkey_st
\r
172 ASN1_INTEGER *ktype;
\r
173 ASN1_OCTET_STRING *keyvalue;
\r
176 DECLARE_STACK_OF(KRB5_ENCKEY)
\r
179 /* AuthorizationData ::= SEQUENCE OF SEQUENCE {
\r
180 ** ad-type[0] INTEGER,
\r
181 ** ad-data[1] OCTET STRING
\r
184 typedef struct krb5_authorization_st
\r
186 ASN1_INTEGER *adtype;
\r
187 ASN1_OCTET_STRING *addata;
\r
190 DECLARE_STACK_OF(KRB5_AUTHDATA)
\r
193 /* -- Unencrypted authenticator
\r
194 ** Authenticator ::= [APPLICATION 2] SEQUENCE {
\r
195 ** authenticator-vno[0] INTEGER,
\r
196 ** crealm[1] Realm,
\r
197 ** cname[2] PrincipalName,
\r
198 ** cksum[3] Checksum OPTIONAL,
\r
199 ** cusec[4] INTEGER,
\r
200 ** ctime[5] KerberosTime,
\r
201 ** subkey[6] EncryptionKey OPTIONAL,
\r
202 ** seq-number[7] INTEGER OPTIONAL,
\r
203 ** authorization-data[8] AuthorizationData OPTIONAL
\r
206 typedef struct krb5_authenticator_st
\r
208 ASN1_INTEGER *avno;
\r
209 ASN1_GENERALSTRING *crealm;
\r
210 KRB5_PRINCNAME *cname;
\r
211 KRB5_CHECKSUM *cksum;
\r
212 ASN1_INTEGER *cusec;
\r
213 ASN1_GENERALIZEDTIME *ctime;
\r
214 KRB5_ENCKEY *subkey;
\r
215 ASN1_INTEGER *seqnum;
\r
216 KRB5_AUTHDATA *authorization;
\r
217 } KRB5_AUTHENTBODY;
\r
219 typedef STACK_OF(KRB5_AUTHENTBODY) KRB5_AUTHENT;
\r
220 DECLARE_STACK_OF(KRB5_AUTHENTBODY)
\r
223 /* DECLARE_ASN1_FUNCTIONS(type) = DECLARE_ASN1_FUNCTIONS_name(type, type) =
\r
224 ** type *name##_new(void);
\r
225 ** void name##_free(type *a);
\r
226 ** DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name) =
\r
227 ** DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) =
\r
228 ** type *d2i_##name(type **a, const unsigned char **in, long len);
\r
229 ** int i2d_##name(type *a, unsigned char **out);
\r
230 ** DECLARE_ASN1_ITEM(itname) = OPENSSL_EXTERN const ASN1_ITEM itname##_it
\r
233 DECLARE_ASN1_FUNCTIONS(KRB5_ENCDATA)
\r
234 DECLARE_ASN1_FUNCTIONS(KRB5_PRINCNAME)
\r
235 DECLARE_ASN1_FUNCTIONS(KRB5_TKTBODY)
\r
236 DECLARE_ASN1_FUNCTIONS(KRB5_APREQBODY)
\r
237 DECLARE_ASN1_FUNCTIONS(KRB5_TICKET)
\r
238 DECLARE_ASN1_FUNCTIONS(KRB5_APREQ)
\r
240 DECLARE_ASN1_FUNCTIONS(KRB5_CHECKSUM)
\r
241 DECLARE_ASN1_FUNCTIONS(KRB5_ENCKEY)
\r
242 DECLARE_ASN1_FUNCTIONS(KRB5_AUTHDATA)
\r
243 DECLARE_ASN1_FUNCTIONS(KRB5_AUTHENTBODY)
\r
244 DECLARE_ASN1_FUNCTIONS(KRB5_AUTHENT)
\r
247 /* BEGIN ERROR CODES */
\r
248 /* The following lines are auto generated by the script mkerr.pl. Any changes
\r
249 * made after this point may be overwritten when the script is next run.
\r