3 * Written by Vern Staats <staatsvr@asc.hpc.mil> for the OpenSSL project, **
\r
4 * using ocsp/{*.h,*asn*.c} as a starting point
\r
7 /* ====================================================================
\r
8 * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
\r
10 * Redistribution and use in source and binary forms, with or without
\r
11 * modification, are permitted provided that the following conditions
\r
14 * 1. Redistributions of source code must retain the above copyright
\r
15 * notice, this list of conditions and the following disclaimer.
\r
17 * 2. Redistributions in binary form must reproduce the above copyright
\r
18 * notice, this list of conditions and the following disclaimer in
\r
19 * the documentation and/or other materials provided with the
\r
22 * 3. All advertising materials mentioning features or use of this
\r
23 * software must display the following acknowledgment:
\r
24 * "This product includes software developed by the OpenSSL Project
\r
25 * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
\r
27 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
\r
28 * endorse or promote products derived from this software without
\r
29 * prior written permission. For written permission, please contact
\r
30 * openssl-core@openssl.org.
\r
32 * 5. Products derived from this software may not be called "OpenSSL"
\r
33 * nor may "OpenSSL" appear in their names without prior written
\r
34 * permission of the OpenSSL Project.
\r
36 * 6. Redistributions of any form whatsoever must retain the following
\r
38 * "This product includes software developed by the OpenSSL Project
\r
39 * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
\r
41 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
\r
42 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
\r
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
\r
44 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
\r
45 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
\r
46 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
\r
47 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
\r
48 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
\r
49 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
\r
50 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
\r
51 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
\r
52 * OF THE POSSIBILITY OF SUCH DAMAGE.
\r
53 * ====================================================================
\r
55 * This product includes cryptographic software written by Eric Young
\r
56 * (eay@cryptsoft.com). This product includes software written by Tim
\r
57 * Hudson (tjh@cryptsoft.com).
\r
61 #ifndef HEADER_KRB5_ASN_H
\r
62 # define HEADER_KRB5_ASN_H
\r
67 # include <openssl/safestack.h>
\r
74 * ASN.1 from Kerberos RFC 1510
\r
77 /*- EncryptedData ::= SEQUENCE {
\r
78 * etype[0] INTEGER, -- EncryptionType
\r
79 * kvno[1] INTEGER OPTIONAL,
\r
80 * cipher[2] OCTET STRING -- ciphertext
\r
83 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
97 ASN1_INTEGER *nametype;
\r
98 STACK_OF(ASN1_GENERALSTRING) *namestring;
\r
101 DECLARE_STACK_OF(KRB5_PRINCNAME)
\r
103 /*- Ticket ::= [APPLICATION 1] SEQUENCE {
\r
104 * tkt-vno[0] INTEGER,
\r
106 * sname[2] PrincipalName,
\r
107 * enc-part[3] EncryptedData
\r
110 typedef struct krb5_tktbody_st {
\r
111 ASN1_INTEGER *tktvno;
\r
112 ASN1_GENERALSTRING *realm;
\r
113 KRB5_PRINCNAME *sname;
\r
114 KRB5_ENCDATA *encdata;
\r
117 typedef STACK_OF(KRB5_TKTBODY) KRB5_TICKET;
\r
118 DECLARE_STACK_OF(KRB5_TKTBODY)
\r
120 /*- AP-REQ ::= [APPLICATION 14] SEQUENCE {
\r
122 * msg-type[1] INTEGER,
\r
123 * ap-options[2] APOptions,
\r
124 * ticket[3] Ticket,
\r
125 * authenticator[4] EncryptedData
\r
128 * APOptions ::= BIT STRING {
\r
129 * reserved(0), use-session-key(1), mutual-required(2) }
\r
131 typedef struct krb5_ap_req_st {
\r
132 ASN1_INTEGER *pvno;
\r
133 ASN1_INTEGER *msgtype;
\r
134 ASN1_BIT_STRING *apoptions;
\r
135 KRB5_TICKET *ticket;
\r
136 KRB5_ENCDATA *authenticator;
\r
139 typedef STACK_OF(KRB5_APREQBODY) KRB5_APREQ;
\r
140 DECLARE_STACK_OF(KRB5_APREQBODY)
\r
142 /* Authenticator Stuff */
\r
144 /*- Checksum ::= SEQUENCE {
\r
145 * cksumtype[0] INTEGER,
\r
146 * checksum[1] OCTET STRING
\r
149 typedef struct krb5_checksum_st {
\r
150 ASN1_INTEGER *ctype;
\r
151 ASN1_OCTET_STRING *checksum;
\r
154 DECLARE_STACK_OF(KRB5_CHECKSUM)
\r
156 /*- EncryptionKey ::= SEQUENCE {
\r
157 * keytype[0] INTEGER,
\r
158 * keyvalue[1] OCTET STRING
\r
161 typedef struct krb5_encryptionkey_st {
\r
162 ASN1_INTEGER *ktype;
\r
163 ASN1_OCTET_STRING *keyvalue;
\r
166 DECLARE_STACK_OF(KRB5_ENCKEY)
\r
168 /*- AuthorizationData ::= SEQUENCE OF SEQUENCE {
\r
169 * ad-type[0] INTEGER,
\r
170 * ad-data[1] OCTET STRING
\r
173 typedef struct krb5_authorization_st {
\r
174 ASN1_INTEGER *adtype;
\r
175 ASN1_OCTET_STRING *addata;
\r
178 DECLARE_STACK_OF(KRB5_AUTHDATA)
\r
180 /*- -- Unencrypted authenticator
\r
181 * Authenticator ::= [APPLICATION 2] SEQUENCE {
\r
182 * authenticator-vno[0] INTEGER,
\r
184 * cname[2] PrincipalName,
\r
185 * cksum[3] Checksum OPTIONAL,
\r
186 * cusec[4] INTEGER,
\r
187 * ctime[5] KerberosTime,
\r
188 * subkey[6] EncryptionKey OPTIONAL,
\r
189 * seq-number[7] INTEGER OPTIONAL,
\r
190 * authorization-data[8] AuthorizationData OPTIONAL
\r
193 typedef struct krb5_authenticator_st {
\r
194 ASN1_INTEGER *avno;
\r
195 ASN1_GENERALSTRING *crealm;
\r
196 KRB5_PRINCNAME *cname;
\r
197 KRB5_CHECKSUM *cksum;
\r
198 ASN1_INTEGER *cusec;
\r
199 ASN1_GENERALIZEDTIME *ctime;
\r
200 KRB5_ENCKEY *subkey;
\r
201 ASN1_INTEGER *seqnum;
\r
202 KRB5_AUTHDATA *authorization;
\r
203 } KRB5_AUTHENTBODY;
\r
205 typedef STACK_OF(KRB5_AUTHENTBODY) KRB5_AUTHENT;
\r
206 DECLARE_STACK_OF(KRB5_AUTHENTBODY)
\r
208 /*- DECLARE_ASN1_FUNCTIONS(type) = DECLARE_ASN1_FUNCTIONS_name(type, type) =
\r
209 * type *name##_new(void);
\r
210 * void name##_free(type *a);
\r
211 * DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name) =
\r
212 * DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) =
\r
213 * type *d2i_##name(type **a, const unsigned char **in, long len);
\r
214 * int i2d_##name(type *a, unsigned char **out);
\r
215 * DECLARE_ASN1_ITEM(itname) = OPENSSL_EXTERN const ASN1_ITEM itname##_it
\r
218 DECLARE_ASN1_FUNCTIONS(KRB5_ENCDATA)
\r
219 DECLARE_ASN1_FUNCTIONS(KRB5_PRINCNAME)
\r
220 DECLARE_ASN1_FUNCTIONS(KRB5_TKTBODY)
\r
221 DECLARE_ASN1_FUNCTIONS(KRB5_APREQBODY)
\r
222 DECLARE_ASN1_FUNCTIONS(KRB5_TICKET)
\r
223 DECLARE_ASN1_FUNCTIONS(KRB5_APREQ)
\r
225 DECLARE_ASN1_FUNCTIONS(KRB5_CHECKSUM)
\r
226 DECLARE_ASN1_FUNCTIONS(KRB5_ENCKEY)
\r
227 DECLARE_ASN1_FUNCTIONS(KRB5_AUTHDATA)
\r
228 DECLARE_ASN1_FUNCTIONS(KRB5_AUTHENTBODY)
\r
229 DECLARE_ASN1_FUNCTIONS(KRB5_AUTHENT)
\r
231 /* BEGIN ERROR CODES */
\r
233 * The following lines are auto generated by the script mkerr.pl. Any changes
\r
234 * made after this point may be overwritten when the script is next run.
\r