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