xref: /minix3/crypto/external/bsd/heimdal/dist/lib/krb5/krb5.h (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc /*	$NetBSD: krb5.h,v 1.1.1.3 2014/04/24 12:45:50 pettai Exp $	*/
2ebfedea0SLionel Sambuc 
3ebfedea0SLionel Sambuc /*
4ebfedea0SLionel Sambuc  * Copyright (c) 1997 - 2007 Kungliga Tekniska Högskolan
5ebfedea0SLionel Sambuc  * (Royal Institute of Technology, Stockholm, Sweden).
6ebfedea0SLionel Sambuc  * All rights reserved.
7ebfedea0SLionel Sambuc  *
8ebfedea0SLionel Sambuc  * Portions Copyright (c) 2009 Apple Inc. All rights reserved.
9ebfedea0SLionel Sambuc  *
10ebfedea0SLionel Sambuc  * Redistribution and use in source and binary forms, with or without
11ebfedea0SLionel Sambuc  * modification, are permitted provided that the following conditions
12ebfedea0SLionel Sambuc  * are met:
13ebfedea0SLionel Sambuc  *
14ebfedea0SLionel Sambuc  * 1. Redistributions of source code must retain the above copyright
15ebfedea0SLionel Sambuc  *    notice, this list of conditions and the following disclaimer.
16ebfedea0SLionel Sambuc  *
17ebfedea0SLionel Sambuc  * 2. Redistributions in binary form must reproduce the above copyright
18ebfedea0SLionel Sambuc  *    notice, this list of conditions and the following disclaimer in the
19ebfedea0SLionel Sambuc  *    documentation and/or other materials provided with the distribution.
20ebfedea0SLionel Sambuc  *
21ebfedea0SLionel Sambuc  * 3. Neither the name of the Institute nor the names of its contributors
22ebfedea0SLionel Sambuc  *    may be used to endorse or promote products derived from this software
23ebfedea0SLionel Sambuc  *    without specific prior written permission.
24ebfedea0SLionel Sambuc  *
25ebfedea0SLionel Sambuc  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
26ebfedea0SLionel Sambuc  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27ebfedea0SLionel Sambuc  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28ebfedea0SLionel Sambuc  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
29ebfedea0SLionel Sambuc  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30ebfedea0SLionel Sambuc  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31ebfedea0SLionel Sambuc  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32ebfedea0SLionel Sambuc  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33ebfedea0SLionel Sambuc  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34ebfedea0SLionel Sambuc  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35ebfedea0SLionel Sambuc  * SUCH DAMAGE.
36ebfedea0SLionel Sambuc  */
37ebfedea0SLionel Sambuc 
38ebfedea0SLionel Sambuc /* Id */
39ebfedea0SLionel Sambuc 
40ebfedea0SLionel Sambuc #ifndef __KRB5_H__
41ebfedea0SLionel Sambuc #define __KRB5_H__
42ebfedea0SLionel Sambuc 
43ebfedea0SLionel Sambuc #include <time.h>
44ebfedea0SLionel Sambuc #include <krb5/krb5-types.h>
45ebfedea0SLionel Sambuc 
46ebfedea0SLionel Sambuc #include <krb5/asn1_err.h>
47ebfedea0SLionel Sambuc #include <krb5/krb5_err.h>
48ebfedea0SLionel Sambuc #include <krb5/heim_err.h>
49ebfedea0SLionel Sambuc #include <krb5/k524_err.h>
50ebfedea0SLionel Sambuc 
51ebfedea0SLionel Sambuc #include <krb5/krb5_asn1.h>
52ebfedea0SLionel Sambuc 
53ebfedea0SLionel Sambuc /* name confusion with MIT */
54ebfedea0SLionel Sambuc #ifndef KRB5KDC_ERR_KEY_EXP
55ebfedea0SLionel Sambuc #define KRB5KDC_ERR_KEY_EXP KRB5KDC_ERR_KEY_EXPIRED
56ebfedea0SLionel Sambuc #endif
57ebfedea0SLionel Sambuc 
58ebfedea0SLionel Sambuc #ifdef _WIN32
59ebfedea0SLionel Sambuc #define KRB5_CALLCONV __stdcall
60ebfedea0SLionel Sambuc #else
61ebfedea0SLionel Sambuc #define KRB5_CALLCONV
62ebfedea0SLionel Sambuc #endif
63ebfedea0SLionel Sambuc 
64ebfedea0SLionel Sambuc /* simple constants */
65ebfedea0SLionel Sambuc 
66ebfedea0SLionel Sambuc #ifndef TRUE
67ebfedea0SLionel Sambuc #define TRUE  1
68ebfedea0SLionel Sambuc #define FALSE 0
69ebfedea0SLionel Sambuc #endif
70ebfedea0SLionel Sambuc 
71ebfedea0SLionel Sambuc typedef int krb5_boolean;
72ebfedea0SLionel Sambuc 
73ebfedea0SLionel Sambuc typedef int32_t krb5_error_code;
74ebfedea0SLionel Sambuc 
75ebfedea0SLionel Sambuc typedef int32_t krb5_kvno;
76ebfedea0SLionel Sambuc 
77ebfedea0SLionel Sambuc typedef uint32_t krb5_flags;
78ebfedea0SLionel Sambuc 
79ebfedea0SLionel Sambuc typedef void *krb5_pointer;
80ebfedea0SLionel Sambuc typedef const void *krb5_const_pointer;
81ebfedea0SLionel Sambuc 
82ebfedea0SLionel Sambuc struct krb5_crypto_data;
83ebfedea0SLionel Sambuc typedef struct krb5_crypto_data *krb5_crypto;
84ebfedea0SLionel Sambuc 
85ebfedea0SLionel Sambuc struct krb5_get_creds_opt_data;
86ebfedea0SLionel Sambuc typedef struct krb5_get_creds_opt_data *krb5_get_creds_opt;
87ebfedea0SLionel Sambuc 
88ebfedea0SLionel Sambuc struct krb5_digest_data;
89ebfedea0SLionel Sambuc typedef struct krb5_digest_data *krb5_digest;
90ebfedea0SLionel Sambuc struct krb5_ntlm_data;
91ebfedea0SLionel Sambuc typedef struct krb5_ntlm_data *krb5_ntlm;
92ebfedea0SLionel Sambuc 
93ebfedea0SLionel Sambuc struct krb5_pac_data;
94ebfedea0SLionel Sambuc typedef struct krb5_pac_data *krb5_pac;
95ebfedea0SLionel Sambuc 
96ebfedea0SLionel Sambuc typedef struct krb5_rd_req_in_ctx_data *krb5_rd_req_in_ctx;
97ebfedea0SLionel Sambuc typedef struct krb5_rd_req_out_ctx_data *krb5_rd_req_out_ctx;
98ebfedea0SLionel Sambuc 
99ebfedea0SLionel Sambuc typedef CKSUMTYPE krb5_cksumtype;
100ebfedea0SLionel Sambuc 
101ebfedea0SLionel Sambuc typedef Checksum krb5_checksum;
102ebfedea0SLionel Sambuc 
103ebfedea0SLionel Sambuc typedef ENCTYPE krb5_enctype;
104ebfedea0SLionel Sambuc 
105ebfedea0SLionel Sambuc typedef struct krb5_get_init_creds_ctx *krb5_init_creds_context;
106ebfedea0SLionel Sambuc 
107ebfedea0SLionel Sambuc typedef heim_octet_string krb5_data;
108ebfedea0SLionel Sambuc 
109ebfedea0SLionel Sambuc /* PKINIT related forward declarations */
110ebfedea0SLionel Sambuc struct ContentInfo;
111ebfedea0SLionel Sambuc struct krb5_pk_identity;
112ebfedea0SLionel Sambuc struct krb5_pk_cert;
113ebfedea0SLionel Sambuc 
114ebfedea0SLionel Sambuc /* krb5_enc_data is a mit compat structure */
115ebfedea0SLionel Sambuc typedef struct krb5_enc_data {
116ebfedea0SLionel Sambuc     krb5_enctype enctype;
117ebfedea0SLionel Sambuc     krb5_kvno kvno;
118ebfedea0SLionel Sambuc     krb5_data ciphertext;
119ebfedea0SLionel Sambuc } krb5_enc_data;
120ebfedea0SLionel Sambuc 
121ebfedea0SLionel Sambuc /* alternative names */
122ebfedea0SLionel Sambuc enum {
123*0a6a1f1dSLionel Sambuc     ENCTYPE_NULL		= KRB5_ENCTYPE_NULL,
124*0a6a1f1dSLionel Sambuc     ENCTYPE_DES_CBC_CRC		= KRB5_ENCTYPE_DES_CBC_CRC,
125*0a6a1f1dSLionel Sambuc     ENCTYPE_DES_CBC_MD4		= KRB5_ENCTYPE_DES_CBC_MD4,
126*0a6a1f1dSLionel Sambuc     ENCTYPE_DES_CBC_MD5		= KRB5_ENCTYPE_DES_CBC_MD5,
127*0a6a1f1dSLionel Sambuc     ENCTYPE_DES3_CBC_MD5	= KRB5_ENCTYPE_DES3_CBC_MD5,
128*0a6a1f1dSLionel Sambuc     ENCTYPE_OLD_DES3_CBC_SHA1	= KRB5_ENCTYPE_OLD_DES3_CBC_SHA1,
129*0a6a1f1dSLionel Sambuc     ENCTYPE_SIGN_DSA_GENERATE	= KRB5_ENCTYPE_SIGN_DSA_GENERATE,
130*0a6a1f1dSLionel Sambuc     ENCTYPE_ENCRYPT_RSA_PRIV	= KRB5_ENCTYPE_ENCRYPT_RSA_PRIV,
131*0a6a1f1dSLionel Sambuc     ENCTYPE_ENCRYPT_RSA_PUB	= KRB5_ENCTYPE_ENCRYPT_RSA_PUB,
132*0a6a1f1dSLionel Sambuc     ENCTYPE_DES3_CBC_SHA1	= KRB5_ENCTYPE_DES3_CBC_SHA1,
133*0a6a1f1dSLionel Sambuc     ENCTYPE_AES128_CTS_HMAC_SHA1_96 = KRB5_ENCTYPE_AES128_CTS_HMAC_SHA1_96,
134*0a6a1f1dSLionel Sambuc     ENCTYPE_AES256_CTS_HMAC_SHA1_96 = KRB5_ENCTYPE_AES256_CTS_HMAC_SHA1_96,
135*0a6a1f1dSLionel Sambuc     ENCTYPE_ARCFOUR_HMAC	= KRB5_ENCTYPE_ARCFOUR_HMAC_MD5,
136*0a6a1f1dSLionel Sambuc     ENCTYPE_ARCFOUR_HMAC_MD5	= KRB5_ENCTYPE_ARCFOUR_HMAC_MD5,
137*0a6a1f1dSLionel Sambuc     ENCTYPE_ARCFOUR_HMAC_MD5_56	= KRB5_ENCTYPE_ARCFOUR_HMAC_MD5_56,
138*0a6a1f1dSLionel Sambuc     ENCTYPE_ENCTYPE_PK_CROSS	= KRB5_ENCTYPE_ENCTYPE_PK_CROSS,
139*0a6a1f1dSLionel Sambuc     ENCTYPE_DES_CBC_NONE	= KRB5_ENCTYPE_DES_CBC_NONE,
140*0a6a1f1dSLionel Sambuc     ENCTYPE_DES3_CBC_NONE	= KRB5_ENCTYPE_DES3_CBC_NONE,
141*0a6a1f1dSLionel Sambuc     ENCTYPE_DES_CFB64_NONE	= KRB5_ENCTYPE_DES_CFB64_NONE,
142*0a6a1f1dSLionel Sambuc     ENCTYPE_DES_PCBC_NONE	= KRB5_ENCTYPE_DES_PCBC_NONE,
143*0a6a1f1dSLionel Sambuc     ETYPE_NULL			= KRB5_ENCTYPE_NULL,
144*0a6a1f1dSLionel Sambuc     ETYPE_DES_CBC_CRC		= KRB5_ENCTYPE_DES_CBC_CRC,
145*0a6a1f1dSLionel Sambuc     ETYPE_DES_CBC_MD4		= KRB5_ENCTYPE_DES_CBC_MD4,
146*0a6a1f1dSLionel Sambuc     ETYPE_DES_CBC_MD5		= KRB5_ENCTYPE_DES_CBC_MD5,
147*0a6a1f1dSLionel Sambuc     ETYPE_DES3_CBC_MD5		= KRB5_ENCTYPE_DES3_CBC_MD5,
148*0a6a1f1dSLionel Sambuc     ETYPE_OLD_DES3_CBC_SHA1	= KRB5_ENCTYPE_OLD_DES3_CBC_SHA1,
149*0a6a1f1dSLionel Sambuc     ETYPE_SIGN_DSA_GENERATE	= KRB5_ENCTYPE_SIGN_DSA_GENERATE,
150*0a6a1f1dSLionel Sambuc     ETYPE_ENCRYPT_RSA_PRIV	= KRB5_ENCTYPE_ENCRYPT_RSA_PRIV,
151*0a6a1f1dSLionel Sambuc     ETYPE_ENCRYPT_RSA_PUB	= KRB5_ENCTYPE_ENCRYPT_RSA_PUB,
152*0a6a1f1dSLionel Sambuc     ETYPE_DES3_CBC_SHA1		= KRB5_ENCTYPE_DES3_CBC_SHA1,
153*0a6a1f1dSLionel Sambuc     ETYPE_AES128_CTS_HMAC_SHA1_96	= KRB5_ENCTYPE_AES128_CTS_HMAC_SHA1_96,
154*0a6a1f1dSLionel Sambuc     ETYPE_AES256_CTS_HMAC_SHA1_96	= KRB5_ENCTYPE_AES256_CTS_HMAC_SHA1_96,
155*0a6a1f1dSLionel Sambuc     ETYPE_ARCFOUR_HMAC_MD5	= KRB5_ENCTYPE_ARCFOUR_HMAC_MD5,
156*0a6a1f1dSLionel Sambuc     ETYPE_ARCFOUR_HMAC_MD5_56	= KRB5_ENCTYPE_ARCFOUR_HMAC_MD5_56,
157*0a6a1f1dSLionel Sambuc     ETYPE_ENCTYPE_PK_CROSS	= KRB5_ENCTYPE_ENCTYPE_PK_CROSS,
158*0a6a1f1dSLionel Sambuc     ETYPE_ARCFOUR_MD4		= KRB5_ENCTYPE_ARCFOUR_MD4,
159*0a6a1f1dSLionel Sambuc     ETYPE_ARCFOUR_HMAC_OLD	= KRB5_ENCTYPE_ARCFOUR_HMAC_OLD,
160*0a6a1f1dSLionel Sambuc     ETYPE_ARCFOUR_HMAC_OLD_EXP	= KRB5_ENCTYPE_ARCFOUR_HMAC_OLD_EXP,
161*0a6a1f1dSLionel Sambuc     ETYPE_DES_CBC_NONE		= KRB5_ENCTYPE_DES_CBC_NONE,
162*0a6a1f1dSLionel Sambuc     ETYPE_DES3_CBC_NONE		= KRB5_ENCTYPE_DES3_CBC_NONE,
163*0a6a1f1dSLionel Sambuc     ETYPE_DES_CFB64_NONE	= KRB5_ENCTYPE_DES_CFB64_NONE,
164*0a6a1f1dSLionel Sambuc     ETYPE_DES_PCBC_NONE		= KRB5_ENCTYPE_DES_PCBC_NONE,
165*0a6a1f1dSLionel Sambuc     ETYPE_DIGEST_MD5_NONE	= KRB5_ENCTYPE_DIGEST_MD5_NONE,
166*0a6a1f1dSLionel Sambuc     ETYPE_CRAM_MD5_NONE		= KRB5_ENCTYPE_CRAM_MD5_NONE
167*0a6a1f1dSLionel Sambuc 
168ebfedea0SLionel Sambuc };
169ebfedea0SLionel Sambuc 
170*0a6a1f1dSLionel Sambuc /* PDU types */
171*0a6a1f1dSLionel Sambuc typedef enum krb5_pdu {
172*0a6a1f1dSLionel Sambuc     KRB5_PDU_ERROR = 0,
173*0a6a1f1dSLionel Sambuc     KRB5_PDU_TICKET = 1,
174*0a6a1f1dSLionel Sambuc     KRB5_PDU_AS_REQUEST = 2,
175*0a6a1f1dSLionel Sambuc     KRB5_PDU_AS_REPLY = 3,
176*0a6a1f1dSLionel Sambuc     KRB5_PDU_TGS_REQUEST = 4,
177*0a6a1f1dSLionel Sambuc     KRB5_PDU_TGS_REPLY = 5,
178*0a6a1f1dSLionel Sambuc     KRB5_PDU_AP_REQUEST = 6,
179*0a6a1f1dSLionel Sambuc     KRB5_PDU_AP_REPLY = 7,
180*0a6a1f1dSLionel Sambuc     KRB5_PDU_KRB_SAFE = 8,
181*0a6a1f1dSLionel Sambuc     KRB5_PDU_KRB_PRIV = 9,
182*0a6a1f1dSLionel Sambuc     KRB5_PDU_KRB_CRED = 10,
183*0a6a1f1dSLionel Sambuc     KRB5_PDU_NONE = 11 /* See krb5_get_permitted_enctypes() */
184*0a6a1f1dSLionel Sambuc } krb5_pdu;
185*0a6a1f1dSLionel Sambuc 
186ebfedea0SLionel Sambuc typedef PADATA_TYPE krb5_preauthtype;
187ebfedea0SLionel Sambuc 
188ebfedea0SLionel Sambuc typedef enum krb5_key_usage {
189ebfedea0SLionel Sambuc     KRB5_KU_PA_ENC_TIMESTAMP = 1,
190ebfedea0SLionel Sambuc     /* AS-REQ PA-ENC-TIMESTAMP padata timestamp, encrypted with the
191ebfedea0SLionel Sambuc        client key (section 5.4.1) */
192ebfedea0SLionel Sambuc     KRB5_KU_TICKET = 2,
193ebfedea0SLionel Sambuc     /* AS-REP Ticket and TGS-REP Ticket (includes tgs session key or
194ebfedea0SLionel Sambuc        application session key), encrypted with the service key
195ebfedea0SLionel Sambuc        (section 5.4.2) */
196ebfedea0SLionel Sambuc     KRB5_KU_AS_REP_ENC_PART = 3,
197ebfedea0SLionel Sambuc     /* AS-REP encrypted part (includes tgs session key or application
198ebfedea0SLionel Sambuc        session key), encrypted with the client key (section 5.4.2) */
199ebfedea0SLionel Sambuc     KRB5_KU_TGS_REQ_AUTH_DAT_SESSION = 4,
200ebfedea0SLionel Sambuc     /* TGS-REQ KDC-REQ-BODY AuthorizationData, encrypted with the tgs
201ebfedea0SLionel Sambuc        session key (section 5.4.1) */
202ebfedea0SLionel Sambuc     KRB5_KU_TGS_REQ_AUTH_DAT_SUBKEY = 5,
203ebfedea0SLionel Sambuc     /* TGS-REQ KDC-REQ-BODY AuthorizationData, encrypted with the tgs
204ebfedea0SLionel Sambuc           authenticator subkey (section 5.4.1) */
205ebfedea0SLionel Sambuc     KRB5_KU_TGS_REQ_AUTH_CKSUM = 6,
206ebfedea0SLionel Sambuc     /* TGS-REQ PA-TGS-REQ padata AP-REQ Authenticator cksum, keyed
207ebfedea0SLionel Sambuc        with the tgs session key (sections 5.3.2, 5.4.1) */
208ebfedea0SLionel Sambuc     KRB5_KU_TGS_REQ_AUTH = 7,
209ebfedea0SLionel Sambuc     /* TGS-REQ PA-TGS-REQ padata AP-REQ Authenticator (includes tgs
210ebfedea0SLionel Sambuc        authenticator subkey), encrypted with the tgs session key
211ebfedea0SLionel Sambuc        (section 5.3.2) */
212ebfedea0SLionel Sambuc     KRB5_KU_TGS_REP_ENC_PART_SESSION = 8,
213ebfedea0SLionel Sambuc     /* TGS-REP encrypted part (includes application session key),
214ebfedea0SLionel Sambuc        encrypted with the tgs session key (section 5.4.2) */
215ebfedea0SLionel Sambuc     KRB5_KU_TGS_REP_ENC_PART_SUB_KEY = 9,
216ebfedea0SLionel Sambuc     /* TGS-REP encrypted part (includes application session key),
217ebfedea0SLionel Sambuc        encrypted with the tgs authenticator subkey (section 5.4.2) */
218ebfedea0SLionel Sambuc     KRB5_KU_AP_REQ_AUTH_CKSUM = 10,
219ebfedea0SLionel Sambuc     /* AP-REQ Authenticator cksum, keyed with the application session
220ebfedea0SLionel Sambuc        key (section 5.3.2) */
221ebfedea0SLionel Sambuc     KRB5_KU_AP_REQ_AUTH = 11,
222ebfedea0SLionel Sambuc     /* AP-REQ Authenticator (includes application authenticator
223ebfedea0SLionel Sambuc        subkey), encrypted with the application session key (section
224ebfedea0SLionel Sambuc        5.3.2) */
225ebfedea0SLionel Sambuc     KRB5_KU_AP_REQ_ENC_PART = 12,
226ebfedea0SLionel Sambuc     /* AP-REP encrypted part (includes application session subkey),
227ebfedea0SLionel Sambuc        encrypted with the application session key (section 5.5.2) */
228ebfedea0SLionel Sambuc     KRB5_KU_KRB_PRIV = 13,
229ebfedea0SLionel Sambuc     /* KRB-PRIV encrypted part, encrypted with a key chosen by the
230ebfedea0SLionel Sambuc        application (section 5.7.1) */
231ebfedea0SLionel Sambuc     KRB5_KU_KRB_CRED = 14,
232ebfedea0SLionel Sambuc     /* KRB-CRED encrypted part, encrypted with a key chosen by the
233ebfedea0SLionel Sambuc        application (section 5.8.1) */
234ebfedea0SLionel Sambuc     KRB5_KU_KRB_SAFE_CKSUM = 15,
235ebfedea0SLionel Sambuc     /* KRB-SAFE cksum, keyed with a key chosen by the application
236ebfedea0SLionel Sambuc        (section 5.6.1) */
237ebfedea0SLionel Sambuc     KRB5_KU_OTHER_ENCRYPTED = 16,
238ebfedea0SLionel Sambuc     /* Data which is defined in some specification outside of
239ebfedea0SLionel Sambuc        Kerberos to be encrypted using an RFC1510 encryption type. */
240ebfedea0SLionel Sambuc     KRB5_KU_OTHER_CKSUM = 17,
241ebfedea0SLionel Sambuc     /* Data which is defined in some specification outside of
242ebfedea0SLionel Sambuc        Kerberos to be checksummed using an RFC1510 checksum type. */
243ebfedea0SLionel Sambuc     KRB5_KU_KRB_ERROR = 18,
244ebfedea0SLionel Sambuc     /* Krb-error checksum */
245ebfedea0SLionel Sambuc     KRB5_KU_AD_KDC_ISSUED = 19,
246ebfedea0SLionel Sambuc     /* AD-KDCIssued checksum */
247ebfedea0SLionel Sambuc     KRB5_KU_MANDATORY_TICKET_EXTENSION = 20,
248ebfedea0SLionel Sambuc     /* Checksum for Mandatory Ticket Extensions */
249ebfedea0SLionel Sambuc     KRB5_KU_AUTH_DATA_TICKET_EXTENSION = 21,
250ebfedea0SLionel Sambuc     /* Checksum in Authorization Data in Ticket Extensions */
251ebfedea0SLionel Sambuc     KRB5_KU_USAGE_SEAL = 22,
252ebfedea0SLionel Sambuc     /* seal in GSSAPI krb5 mechanism */
253ebfedea0SLionel Sambuc     KRB5_KU_USAGE_SIGN = 23,
254ebfedea0SLionel Sambuc     /* sign in GSSAPI krb5 mechanism */
255ebfedea0SLionel Sambuc     KRB5_KU_USAGE_SEQ = 24,
256ebfedea0SLionel Sambuc     /* SEQ in GSSAPI krb5 mechanism */
257ebfedea0SLionel Sambuc     KRB5_KU_USAGE_ACCEPTOR_SEAL = 22,
258ebfedea0SLionel Sambuc     /* acceptor sign in GSSAPI CFX krb5 mechanism */
259ebfedea0SLionel Sambuc     KRB5_KU_USAGE_ACCEPTOR_SIGN = 23,
260ebfedea0SLionel Sambuc     /* acceptor seal in GSSAPI CFX krb5 mechanism */
261ebfedea0SLionel Sambuc     KRB5_KU_USAGE_INITIATOR_SEAL = 24,
262ebfedea0SLionel Sambuc     /* initiator sign in GSSAPI CFX krb5 mechanism */
263ebfedea0SLionel Sambuc     KRB5_KU_USAGE_INITIATOR_SIGN = 25,
264ebfedea0SLionel Sambuc     /* initiator seal in GSSAPI CFX krb5 mechanism */
265ebfedea0SLionel Sambuc     KRB5_KU_PA_SERVER_REFERRAL_DATA = 22,
266ebfedea0SLionel Sambuc     /* encrypted server referral data */
267ebfedea0SLionel Sambuc     KRB5_KU_SAM_CHECKSUM = 25,
268ebfedea0SLionel Sambuc     /* Checksum for the SAM-CHECKSUM field */
269ebfedea0SLionel Sambuc     KRB5_KU_SAM_ENC_TRACK_ID = 26,
270ebfedea0SLionel Sambuc     /* Encryption of the SAM-TRACK-ID field */
271ebfedea0SLionel Sambuc     KRB5_KU_PA_SERVER_REFERRAL = 26,
272ebfedea0SLionel Sambuc     /* Keyusage for the server referral in a TGS req */
273ebfedea0SLionel Sambuc     KRB5_KU_SAM_ENC_NONCE_SAD = 27,
274ebfedea0SLionel Sambuc     /* Encryption of the SAM-NONCE-OR-SAD field */
275ebfedea0SLionel Sambuc     KRB5_KU_PA_PKINIT_KX = 44,
276ebfedea0SLionel Sambuc     /* Encryption type of the kdc session contribution in pk-init */
277ebfedea0SLionel Sambuc     KRB5_KU_AS_REQ = 56,
278ebfedea0SLionel Sambuc     /* Checksum of over the AS-REQ send by the KDC in PA-REQ-ENC-PA-REP */
279ebfedea0SLionel Sambuc     KRB5_KU_DIGEST_ENCRYPT = -18,
280ebfedea0SLionel Sambuc     /* Encryption key usage used in the digest encryption field */
281ebfedea0SLionel Sambuc     KRB5_KU_DIGEST_OPAQUE = -19,
282ebfedea0SLionel Sambuc     /* Checksum key usage used in the digest opaque field */
283ebfedea0SLionel Sambuc     KRB5_KU_KRB5SIGNEDPATH = -21,
284ebfedea0SLionel Sambuc     /* Checksum key usage on KRB5SignedPath */
285ebfedea0SLionel Sambuc     KRB5_KU_CANONICALIZED_NAMES = -23
286ebfedea0SLionel Sambuc     /* Checksum key usage on PA-CANONICALIZED */
287ebfedea0SLionel Sambuc } krb5_key_usage;
288ebfedea0SLionel Sambuc 
289ebfedea0SLionel Sambuc typedef krb5_key_usage krb5_keyusage;
290ebfedea0SLionel Sambuc 
291ebfedea0SLionel Sambuc typedef enum krb5_salttype {
292ebfedea0SLionel Sambuc     KRB5_PW_SALT = KRB5_PADATA_PW_SALT,
293ebfedea0SLionel Sambuc     KRB5_AFS3_SALT = KRB5_PADATA_AFS3_SALT
294ebfedea0SLionel Sambuc }krb5_salttype;
295ebfedea0SLionel Sambuc 
296ebfedea0SLionel Sambuc typedef struct krb5_salt {
297ebfedea0SLionel Sambuc     krb5_salttype salttype;
298ebfedea0SLionel Sambuc     krb5_data saltvalue;
299ebfedea0SLionel Sambuc } krb5_salt;
300ebfedea0SLionel Sambuc 
301ebfedea0SLionel Sambuc typedef ETYPE_INFO krb5_preauthinfo;
302ebfedea0SLionel Sambuc 
303ebfedea0SLionel Sambuc typedef struct {
304ebfedea0SLionel Sambuc     krb5_preauthtype type;
305ebfedea0SLionel Sambuc     krb5_preauthinfo info; /* list of preauthinfo for this type */
306ebfedea0SLionel Sambuc } krb5_preauthdata_entry;
307ebfedea0SLionel Sambuc 
308ebfedea0SLionel Sambuc typedef struct krb5_preauthdata {
309ebfedea0SLionel Sambuc     unsigned len;
310ebfedea0SLionel Sambuc     krb5_preauthdata_entry *val;
311ebfedea0SLionel Sambuc }krb5_preauthdata;
312ebfedea0SLionel Sambuc 
313ebfedea0SLionel Sambuc typedef enum krb5_address_type {
314ebfedea0SLionel Sambuc     KRB5_ADDRESS_INET     =   2,
315ebfedea0SLionel Sambuc     KRB5_ADDRESS_NETBIOS  =  20,
316ebfedea0SLionel Sambuc     KRB5_ADDRESS_INET6    =  24,
317ebfedea0SLionel Sambuc     KRB5_ADDRESS_ADDRPORT = 256,
318ebfedea0SLionel Sambuc     KRB5_ADDRESS_IPPORT   = 257
319ebfedea0SLionel Sambuc } krb5_address_type;
320ebfedea0SLionel Sambuc 
321ebfedea0SLionel Sambuc enum {
322ebfedea0SLionel Sambuc   AP_OPTS_USE_SESSION_KEY = 1,
323ebfedea0SLionel Sambuc   AP_OPTS_MUTUAL_REQUIRED = 2,
324ebfedea0SLionel Sambuc   AP_OPTS_USE_SUBKEY = 4		/* library internal */
325ebfedea0SLionel Sambuc };
326ebfedea0SLionel Sambuc 
327ebfedea0SLionel Sambuc typedef HostAddress krb5_address;
328ebfedea0SLionel Sambuc 
329ebfedea0SLionel Sambuc typedef HostAddresses krb5_addresses;
330ebfedea0SLionel Sambuc 
331*0a6a1f1dSLionel Sambuc typedef krb5_enctype krb5_keytype;
332*0a6a1f1dSLionel Sambuc 
333*0a6a1f1dSLionel Sambuc enum krb5_keytype_old {
334ebfedea0SLionel Sambuc     KEYTYPE_NULL	= ETYPE_NULL,
335ebfedea0SLionel Sambuc     KEYTYPE_DES		= ETYPE_DES_CBC_CRC,
336ebfedea0SLionel Sambuc     KEYTYPE_DES3	= ETYPE_OLD_DES3_CBC_SHA1,
337ebfedea0SLionel Sambuc     KEYTYPE_AES128	= ETYPE_AES128_CTS_HMAC_SHA1_96,
338ebfedea0SLionel Sambuc     KEYTYPE_AES256	= ETYPE_AES256_CTS_HMAC_SHA1_96,
339ebfedea0SLionel Sambuc     KEYTYPE_ARCFOUR	= ETYPE_ARCFOUR_HMAC_MD5,
340ebfedea0SLionel Sambuc     KEYTYPE_ARCFOUR_56	= ETYPE_ARCFOUR_HMAC_MD5_56
341*0a6a1f1dSLionel Sambuc };
342ebfedea0SLionel Sambuc 
343ebfedea0SLionel Sambuc typedef EncryptionKey krb5_keyblock;
344ebfedea0SLionel Sambuc 
345ebfedea0SLionel Sambuc typedef AP_REQ krb5_ap_req;
346ebfedea0SLionel Sambuc 
347ebfedea0SLionel Sambuc struct krb5_cc_ops;
348ebfedea0SLionel Sambuc 
349ebfedea0SLionel Sambuc #ifdef _WIN32
350ebfedea0SLionel Sambuc #define KRB5_USE_PATH_TOKENS 1
351ebfedea0SLionel Sambuc #endif
352ebfedea0SLionel Sambuc 
353ebfedea0SLionel Sambuc #ifdef KRB5_USE_PATH_TOKENS
354ebfedea0SLionel Sambuc #define KRB5_DEFAULT_CCFILE_ROOT "%{TEMP}/krb5cc_"
355ebfedea0SLionel Sambuc #else
356ebfedea0SLionel Sambuc #define KRB5_DEFAULT_CCFILE_ROOT "/tmp/krb5cc_"
357ebfedea0SLionel Sambuc #endif
358ebfedea0SLionel Sambuc 
359ebfedea0SLionel Sambuc #define KRB5_DEFAULT_CCROOT "FILE:" KRB5_DEFAULT_CCFILE_ROOT
360ebfedea0SLionel Sambuc 
361ebfedea0SLionel Sambuc #define KRB5_ACCEPT_NULL_ADDRESSES(C) 					 \
362ebfedea0SLionel Sambuc     krb5_config_get_bool_default((C), NULL, TRUE, 			 \
363ebfedea0SLionel Sambuc 				 "libdefaults", "accept_null_addresses", \
364ebfedea0SLionel Sambuc 				 NULL)
365ebfedea0SLionel Sambuc 
366ebfedea0SLionel Sambuc typedef void *krb5_cc_cursor;
367ebfedea0SLionel Sambuc typedef struct krb5_cccol_cursor_data *krb5_cccol_cursor;
368ebfedea0SLionel Sambuc 
369ebfedea0SLionel Sambuc typedef struct krb5_ccache_data {
370ebfedea0SLionel Sambuc     const struct krb5_cc_ops *ops;
371ebfedea0SLionel Sambuc     krb5_data data;
372ebfedea0SLionel Sambuc }krb5_ccache_data;
373ebfedea0SLionel Sambuc 
374ebfedea0SLionel Sambuc typedef struct krb5_ccache_data *krb5_ccache;
375ebfedea0SLionel Sambuc 
376ebfedea0SLionel Sambuc typedef struct krb5_context_data *krb5_context;
377ebfedea0SLionel Sambuc 
378ebfedea0SLionel Sambuc typedef Realm krb5_realm;
379ebfedea0SLionel Sambuc typedef const char *krb5_const_realm; /* stupid language */
380ebfedea0SLionel Sambuc 
381ebfedea0SLionel Sambuc #define krb5_realm_length(r) strlen(r)
382ebfedea0SLionel Sambuc #define krb5_realm_data(r) (r)
383ebfedea0SLionel Sambuc 
384ebfedea0SLionel Sambuc typedef Principal krb5_principal_data;
385ebfedea0SLionel Sambuc typedef struct Principal *krb5_principal;
386ebfedea0SLionel Sambuc typedef const struct Principal *krb5_const_principal;
387ebfedea0SLionel Sambuc typedef struct Principals *krb5_principals;
388ebfedea0SLionel Sambuc 
389ebfedea0SLionel Sambuc typedef time_t krb5_deltat;
390ebfedea0SLionel Sambuc typedef time_t krb5_timestamp;
391ebfedea0SLionel Sambuc 
392ebfedea0SLionel Sambuc typedef struct krb5_times {
393ebfedea0SLionel Sambuc   krb5_timestamp authtime;
394ebfedea0SLionel Sambuc   krb5_timestamp starttime;
395ebfedea0SLionel Sambuc   krb5_timestamp endtime;
396ebfedea0SLionel Sambuc   krb5_timestamp renew_till;
397ebfedea0SLionel Sambuc } krb5_times;
398ebfedea0SLionel Sambuc 
399ebfedea0SLionel Sambuc typedef union {
400ebfedea0SLionel Sambuc     TicketFlags b;
401ebfedea0SLionel Sambuc     krb5_flags i;
402ebfedea0SLionel Sambuc } krb5_ticket_flags;
403ebfedea0SLionel Sambuc 
404ebfedea0SLionel Sambuc /* options for krb5_get_in_tkt() */
405ebfedea0SLionel Sambuc #define KDC_OPT_FORWARDABLE		(1 << 1)
406ebfedea0SLionel Sambuc #define KDC_OPT_FORWARDED		(1 << 2)
407ebfedea0SLionel Sambuc #define KDC_OPT_PROXIABLE		(1 << 3)
408ebfedea0SLionel Sambuc #define KDC_OPT_PROXY			(1 << 4)
409ebfedea0SLionel Sambuc #define KDC_OPT_ALLOW_POSTDATE		(1 << 5)
410ebfedea0SLionel Sambuc #define KDC_OPT_POSTDATED		(1 << 6)
411ebfedea0SLionel Sambuc #define KDC_OPT_RENEWABLE		(1 << 8)
412ebfedea0SLionel Sambuc #define KDC_OPT_REQUEST_ANONYMOUS	(1 << 14)
413ebfedea0SLionel Sambuc #define KDC_OPT_DISABLE_TRANSITED_CHECK	(1 << 26)
414ebfedea0SLionel Sambuc #define KDC_OPT_RENEWABLE_OK		(1 << 27)
415ebfedea0SLionel Sambuc #define KDC_OPT_ENC_TKT_IN_SKEY		(1 << 28)
416ebfedea0SLionel Sambuc #define KDC_OPT_RENEW			(1 << 30)
417ebfedea0SLionel Sambuc #define KDC_OPT_VALIDATE		(1 << 31)
418ebfedea0SLionel Sambuc 
419ebfedea0SLionel Sambuc typedef union {
420ebfedea0SLionel Sambuc     KDCOptions b;
421ebfedea0SLionel Sambuc     krb5_flags i;
422ebfedea0SLionel Sambuc } krb5_kdc_flags;
423ebfedea0SLionel Sambuc 
424ebfedea0SLionel Sambuc /* flags for krb5_verify_ap_req */
425ebfedea0SLionel Sambuc 
426ebfedea0SLionel Sambuc #define KRB5_VERIFY_AP_REQ_IGNORE_INVALID	(1 << 0)
427ebfedea0SLionel Sambuc 
428ebfedea0SLionel Sambuc #define KRB5_GC_CACHED			(1U << 0)
429ebfedea0SLionel Sambuc #define KRB5_GC_USER_USER		(1U << 1)
430ebfedea0SLionel Sambuc #define KRB5_GC_EXPIRED_OK		(1U << 2)
431ebfedea0SLionel Sambuc #define KRB5_GC_NO_STORE		(1U << 3)
432ebfedea0SLionel Sambuc #define KRB5_GC_FORWARDABLE		(1U << 4)
433ebfedea0SLionel Sambuc #define KRB5_GC_NO_TRANSIT_CHECK	(1U << 5)
434ebfedea0SLionel Sambuc #define KRB5_GC_CONSTRAINED_DELEGATION	(1U << 6)
435ebfedea0SLionel Sambuc #define KRB5_GC_CANONICALIZE		(1U << 7)
436ebfedea0SLionel Sambuc 
437ebfedea0SLionel Sambuc /* constants for compare_creds (and cc_retrieve_cred) */
438ebfedea0SLionel Sambuc #define KRB5_TC_DONT_MATCH_REALM	(1U << 31)
439ebfedea0SLionel Sambuc #define KRB5_TC_MATCH_KEYTYPE		(1U << 30)
440ebfedea0SLionel Sambuc #define KRB5_TC_MATCH_KTYPE		KRB5_TC_MATCH_KEYTYPE    /* MIT name */
441ebfedea0SLionel Sambuc #define KRB5_TC_MATCH_SRV_NAMEONLY	(1 << 29)
442ebfedea0SLionel Sambuc #define KRB5_TC_MATCH_FLAGS_EXACT	(1 << 28)
443ebfedea0SLionel Sambuc #define KRB5_TC_MATCH_FLAGS		(1 << 27)
444ebfedea0SLionel Sambuc #define KRB5_TC_MATCH_TIMES_EXACT	(1 << 26)
445ebfedea0SLionel Sambuc #define KRB5_TC_MATCH_TIMES		(1 << 25)
446ebfedea0SLionel Sambuc #define KRB5_TC_MATCH_AUTHDATA		(1 << 24)
447ebfedea0SLionel Sambuc #define KRB5_TC_MATCH_2ND_TKT		(1 << 23)
448ebfedea0SLionel Sambuc #define KRB5_TC_MATCH_IS_SKEY		(1 << 22)
449ebfedea0SLionel Sambuc 
450ebfedea0SLionel Sambuc /* constants for get_flags and set_flags */
451ebfedea0SLionel Sambuc #define KRB5_TC_OPENCLOSE 0x00000001
452ebfedea0SLionel Sambuc #define KRB5_TC_NOTICKET  0x00000002
453ebfedea0SLionel Sambuc 
454ebfedea0SLionel Sambuc typedef AuthorizationData krb5_authdata;
455ebfedea0SLionel Sambuc 
456ebfedea0SLionel Sambuc typedef KRB_ERROR krb5_error;
457ebfedea0SLionel Sambuc 
458ebfedea0SLionel Sambuc typedef struct krb5_creds {
459ebfedea0SLionel Sambuc     krb5_principal client;
460ebfedea0SLionel Sambuc     krb5_principal server;
461ebfedea0SLionel Sambuc     krb5_keyblock session;
462ebfedea0SLionel Sambuc     krb5_times times;
463ebfedea0SLionel Sambuc     krb5_data ticket;
464ebfedea0SLionel Sambuc     krb5_data second_ticket;
465ebfedea0SLionel Sambuc     krb5_authdata authdata;
466ebfedea0SLionel Sambuc     krb5_addresses addresses;
467ebfedea0SLionel Sambuc     krb5_ticket_flags flags;
468ebfedea0SLionel Sambuc } krb5_creds;
469ebfedea0SLionel Sambuc 
470ebfedea0SLionel Sambuc typedef struct krb5_cc_cache_cursor_data *krb5_cc_cache_cursor;
471ebfedea0SLionel Sambuc 
472ebfedea0SLionel Sambuc #define KRB5_CC_OPS_VERSION 3
473ebfedea0SLionel Sambuc 
474ebfedea0SLionel Sambuc typedef struct krb5_cc_ops {
475ebfedea0SLionel Sambuc     int version;
476ebfedea0SLionel Sambuc     const char *prefix;
477ebfedea0SLionel Sambuc     const char* (KRB5_CALLCONV * get_name)(krb5_context, krb5_ccache);
478ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * resolve)(krb5_context, krb5_ccache *, const char *);
479ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * gen_new)(krb5_context, krb5_ccache *);
480ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * init)(krb5_context, krb5_ccache, krb5_principal);
481ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * destroy)(krb5_context, krb5_ccache);
482ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * close)(krb5_context, krb5_ccache);
483ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * store)(krb5_context, krb5_ccache, krb5_creds*);
484ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * retrieve)(krb5_context, krb5_ccache,
485ebfedea0SLionel Sambuc 					       krb5_flags, const krb5_creds*, krb5_creds *);
486ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * get_princ)(krb5_context, krb5_ccache, krb5_principal*);
487ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * get_first)(krb5_context, krb5_ccache, krb5_cc_cursor *);
488ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * get_next)(krb5_context, krb5_ccache,
489ebfedea0SLionel Sambuc 					       krb5_cc_cursor*, krb5_creds*);
490ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * end_get)(krb5_context, krb5_ccache, krb5_cc_cursor*);
491ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * remove_cred)(krb5_context, krb5_ccache,
492ebfedea0SLionel Sambuc 						  krb5_flags, krb5_creds*);
493ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * set_flags)(krb5_context, krb5_ccache, krb5_flags);
494ebfedea0SLionel Sambuc     int (KRB5_CALLCONV * get_version)(krb5_context, krb5_ccache);
495ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * get_cache_first)(krb5_context, krb5_cc_cursor *);
496ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * get_cache_next)(krb5_context, krb5_cc_cursor,
497ebfedea0SLionel Sambuc 						     krb5_ccache *);
498ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * end_cache_get)(krb5_context, krb5_cc_cursor);
499ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * move)(krb5_context, krb5_ccache, krb5_ccache);
500ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * get_default_name)(krb5_context, char **);
501ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * set_default)(krb5_context, krb5_ccache);
502ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * lastchange)(krb5_context, krb5_ccache, krb5_timestamp *);
503ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * set_kdc_offset)(krb5_context, krb5_ccache, krb5_deltat);
504ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * get_kdc_offset)(krb5_context, krb5_ccache, krb5_deltat *);
505ebfedea0SLionel Sambuc } krb5_cc_ops;
506ebfedea0SLionel Sambuc 
507ebfedea0SLionel Sambuc struct krb5_log_facility;
508ebfedea0SLionel Sambuc 
509ebfedea0SLionel Sambuc struct krb5_config_binding {
510ebfedea0SLionel Sambuc     enum { krb5_config_string, krb5_config_list } type;
511ebfedea0SLionel Sambuc     char *name;
512ebfedea0SLionel Sambuc     struct krb5_config_binding *next;
513ebfedea0SLionel Sambuc     union {
514ebfedea0SLionel Sambuc 	char *string;
515ebfedea0SLionel Sambuc 	struct krb5_config_binding *list;
516ebfedea0SLionel Sambuc 	void *generic;
517ebfedea0SLionel Sambuc     } u;
518ebfedea0SLionel Sambuc };
519ebfedea0SLionel Sambuc 
520ebfedea0SLionel Sambuc typedef struct krb5_config_binding krb5_config_binding;
521ebfedea0SLionel Sambuc 
522ebfedea0SLionel Sambuc typedef krb5_config_binding krb5_config_section;
523ebfedea0SLionel Sambuc 
524ebfedea0SLionel Sambuc typedef struct krb5_ticket {
525ebfedea0SLionel Sambuc     EncTicketPart ticket;
526ebfedea0SLionel Sambuc     krb5_principal client;
527ebfedea0SLionel Sambuc     krb5_principal server;
528ebfedea0SLionel Sambuc } krb5_ticket;
529ebfedea0SLionel Sambuc 
530ebfedea0SLionel Sambuc typedef Authenticator krb5_authenticator_data;
531ebfedea0SLionel Sambuc 
532ebfedea0SLionel Sambuc typedef krb5_authenticator_data *krb5_authenticator;
533ebfedea0SLionel Sambuc 
534ebfedea0SLionel Sambuc struct krb5_rcache_data;
535ebfedea0SLionel Sambuc typedef struct krb5_rcache_data *krb5_rcache;
536ebfedea0SLionel Sambuc typedef Authenticator krb5_donot_replay;
537ebfedea0SLionel Sambuc 
538ebfedea0SLionel Sambuc #define KRB5_STORAGE_HOST_BYTEORDER			0x01 /* old */
539ebfedea0SLionel Sambuc #define KRB5_STORAGE_PRINCIPAL_WRONG_NUM_COMPONENTS	0x02
540ebfedea0SLionel Sambuc #define KRB5_STORAGE_PRINCIPAL_NO_NAME_TYPE		0x04
541ebfedea0SLionel Sambuc #define KRB5_STORAGE_KEYBLOCK_KEYTYPE_TWICE		0x08
542ebfedea0SLionel Sambuc #define KRB5_STORAGE_BYTEORDER_MASK			0x60
543ebfedea0SLionel Sambuc #define KRB5_STORAGE_BYTEORDER_BE			0x00 /* default */
544ebfedea0SLionel Sambuc #define KRB5_STORAGE_BYTEORDER_LE			0x20
545ebfedea0SLionel Sambuc #define KRB5_STORAGE_BYTEORDER_HOST			0x40
546ebfedea0SLionel Sambuc #define KRB5_STORAGE_CREDS_FLAGS_WRONG_BITORDER		0x80
547ebfedea0SLionel Sambuc 
548ebfedea0SLionel Sambuc struct krb5_storage_data;
549ebfedea0SLionel Sambuc typedef struct krb5_storage_data krb5_storage;
550ebfedea0SLionel Sambuc 
551ebfedea0SLionel Sambuc typedef struct krb5_keytab_entry {
552ebfedea0SLionel Sambuc     krb5_principal principal;
553ebfedea0SLionel Sambuc     krb5_kvno vno;
554ebfedea0SLionel Sambuc     krb5_keyblock keyblock;
555ebfedea0SLionel Sambuc     uint32_t timestamp;
556ebfedea0SLionel Sambuc     uint32_t flags;
557ebfedea0SLionel Sambuc     krb5_principals aliases;
558ebfedea0SLionel Sambuc } krb5_keytab_entry;
559ebfedea0SLionel Sambuc 
560ebfedea0SLionel Sambuc typedef struct krb5_kt_cursor {
561ebfedea0SLionel Sambuc     int fd;
562ebfedea0SLionel Sambuc     krb5_storage *sp;
563ebfedea0SLionel Sambuc     void *data;
564ebfedea0SLionel Sambuc } krb5_kt_cursor;
565ebfedea0SLionel Sambuc 
566ebfedea0SLionel Sambuc struct krb5_keytab_data;
567ebfedea0SLionel Sambuc 
568ebfedea0SLionel Sambuc typedef struct krb5_keytab_data *krb5_keytab;
569ebfedea0SLionel Sambuc 
570ebfedea0SLionel Sambuc #define KRB5_KT_PREFIX_MAX_LEN	30
571ebfedea0SLionel Sambuc 
572ebfedea0SLionel Sambuc struct krb5_keytab_data {
573ebfedea0SLionel Sambuc     const char *prefix;
574ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * resolve)(krb5_context, const char*, krb5_keytab);
575ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * get_name)(krb5_context, krb5_keytab, char*, size_t);
576ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * close)(krb5_context, krb5_keytab);
577ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * destroy)(krb5_context, krb5_keytab);
578ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * get)(krb5_context, krb5_keytab, krb5_const_principal,
579ebfedea0SLionel Sambuc 					  krb5_kvno, krb5_enctype, krb5_keytab_entry*);
580ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * start_seq_get)(krb5_context, krb5_keytab, krb5_kt_cursor*);
581ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * next_entry)(krb5_context, krb5_keytab,
582ebfedea0SLionel Sambuc 						 krb5_keytab_entry*, krb5_kt_cursor*);
583ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * end_seq_get)(krb5_context, krb5_keytab, krb5_kt_cursor*);
584ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * add)(krb5_context, krb5_keytab, krb5_keytab_entry*);
585ebfedea0SLionel Sambuc     krb5_error_code (KRB5_CALLCONV * remove)(krb5_context, krb5_keytab, krb5_keytab_entry*);
586ebfedea0SLionel Sambuc     void *data;
587ebfedea0SLionel Sambuc     int32_t version;
588ebfedea0SLionel Sambuc };
589ebfedea0SLionel Sambuc 
590ebfedea0SLionel Sambuc typedef struct krb5_keytab_data krb5_kt_ops;
591ebfedea0SLionel Sambuc 
592ebfedea0SLionel Sambuc struct krb5_keytab_key_proc_args {
593ebfedea0SLionel Sambuc     krb5_keytab keytab;
594ebfedea0SLionel Sambuc     krb5_principal principal;
595ebfedea0SLionel Sambuc };
596ebfedea0SLionel Sambuc 
597ebfedea0SLionel Sambuc typedef struct krb5_keytab_key_proc_args krb5_keytab_key_proc_args;
598ebfedea0SLionel Sambuc 
599ebfedea0SLionel Sambuc typedef struct krb5_replay_data {
600ebfedea0SLionel Sambuc     krb5_timestamp timestamp;
601ebfedea0SLionel Sambuc     int32_t usec;
602ebfedea0SLionel Sambuc     uint32_t seq;
603ebfedea0SLionel Sambuc } krb5_replay_data;
604ebfedea0SLionel Sambuc 
605ebfedea0SLionel Sambuc /* flags for krb5_auth_con_setflags */
606ebfedea0SLionel Sambuc enum {
607ebfedea0SLionel Sambuc     KRB5_AUTH_CONTEXT_DO_TIME      		= 1,
608ebfedea0SLionel Sambuc     KRB5_AUTH_CONTEXT_RET_TIME     		= 2,
609ebfedea0SLionel Sambuc     KRB5_AUTH_CONTEXT_DO_SEQUENCE  		= 4,
610ebfedea0SLionel Sambuc     KRB5_AUTH_CONTEXT_RET_SEQUENCE 		= 8,
611ebfedea0SLionel Sambuc     KRB5_AUTH_CONTEXT_PERMIT_ALL   		= 16,
612ebfedea0SLionel Sambuc     KRB5_AUTH_CONTEXT_USE_SUBKEY   		= 32,
613ebfedea0SLionel Sambuc     KRB5_AUTH_CONTEXT_CLEAR_FORWARDED_CRED	= 64
614ebfedea0SLionel Sambuc };
615ebfedea0SLionel Sambuc 
616ebfedea0SLionel Sambuc /* flags for krb5_auth_con_genaddrs */
617ebfedea0SLionel Sambuc enum {
618ebfedea0SLionel Sambuc     KRB5_AUTH_CONTEXT_GENERATE_LOCAL_ADDR       = 1,
619ebfedea0SLionel Sambuc     KRB5_AUTH_CONTEXT_GENERATE_LOCAL_FULL_ADDR  = 3,
620ebfedea0SLionel Sambuc     KRB5_AUTH_CONTEXT_GENERATE_REMOTE_ADDR      = 4,
621ebfedea0SLionel Sambuc     KRB5_AUTH_CONTEXT_GENERATE_REMOTE_FULL_ADDR = 12
622ebfedea0SLionel Sambuc };
623ebfedea0SLionel Sambuc 
624ebfedea0SLionel Sambuc typedef struct krb5_auth_context_data {
625ebfedea0SLionel Sambuc     unsigned int flags;
626ebfedea0SLionel Sambuc 
627ebfedea0SLionel Sambuc     krb5_address *local_address;
628ebfedea0SLionel Sambuc     krb5_address *remote_address;
629ebfedea0SLionel Sambuc     int16_t local_port;
630ebfedea0SLionel Sambuc     int16_t remote_port;
631ebfedea0SLionel Sambuc     krb5_keyblock *keyblock;
632ebfedea0SLionel Sambuc     krb5_keyblock *local_subkey;
633ebfedea0SLionel Sambuc     krb5_keyblock *remote_subkey;
634ebfedea0SLionel Sambuc 
635ebfedea0SLionel Sambuc     uint32_t local_seqnumber;
636ebfedea0SLionel Sambuc     uint32_t remote_seqnumber;
637ebfedea0SLionel Sambuc 
638ebfedea0SLionel Sambuc     krb5_authenticator authenticator;
639ebfedea0SLionel Sambuc 
640ebfedea0SLionel Sambuc     krb5_pointer i_vector;
641ebfedea0SLionel Sambuc 
642ebfedea0SLionel Sambuc     krb5_rcache rcache;
643ebfedea0SLionel Sambuc 
644ebfedea0SLionel Sambuc     krb5_keytype keytype;	/* ¿requested key type ? */
645ebfedea0SLionel Sambuc     krb5_cksumtype cksumtype;	/* ¡requested checksum type! */
646ebfedea0SLionel Sambuc 
647ebfedea0SLionel Sambuc }krb5_auth_context_data, *krb5_auth_context;
648ebfedea0SLionel Sambuc 
649ebfedea0SLionel Sambuc typedef struct {
650ebfedea0SLionel Sambuc     KDC_REP kdc_rep;
651ebfedea0SLionel Sambuc     EncKDCRepPart enc_part;
652ebfedea0SLionel Sambuc     KRB_ERROR error;
653ebfedea0SLionel Sambuc } krb5_kdc_rep;
654ebfedea0SLionel Sambuc 
655ebfedea0SLionel Sambuc extern const char *heimdal_version, *heimdal_long_version;
656ebfedea0SLionel Sambuc 
657ebfedea0SLionel Sambuc typedef void (KRB5_CALLCONV * krb5_log_log_func_t)(const char*, const char*, void*);
658ebfedea0SLionel Sambuc typedef void (KRB5_CALLCONV * krb5_log_close_func_t)(void*);
659ebfedea0SLionel Sambuc 
660ebfedea0SLionel Sambuc typedef struct krb5_log_facility {
661ebfedea0SLionel Sambuc     char *program;
662ebfedea0SLionel Sambuc     int len;
663ebfedea0SLionel Sambuc     struct facility *val;
664ebfedea0SLionel Sambuc } krb5_log_facility;
665ebfedea0SLionel Sambuc 
666ebfedea0SLionel Sambuc typedef EncAPRepPart krb5_ap_rep_enc_part;
667ebfedea0SLionel Sambuc 
668ebfedea0SLionel Sambuc #define KRB5_RECVAUTH_IGNORE_VERSION 1
669ebfedea0SLionel Sambuc 
670ebfedea0SLionel Sambuc #define KRB5_SENDAUTH_VERSION "KRB5_SENDAUTH_V1.0"
671ebfedea0SLionel Sambuc 
672ebfedea0SLionel Sambuc #define KRB5_TGS_NAME_SIZE (6)
673ebfedea0SLionel Sambuc #define KRB5_TGS_NAME ("krbtgt")
674ebfedea0SLionel Sambuc #define KRB5_WELLKNOWN_NAME ("WELLKNOWN")
675ebfedea0SLionel Sambuc #define KRB5_ANON_NAME ("ANONYMOUS")
676ebfedea0SLionel Sambuc #define KRB5_DIGEST_NAME ("digest")
677ebfedea0SLionel Sambuc 
678ebfedea0SLionel Sambuc typedef enum {
679ebfedea0SLionel Sambuc     KRB5_PROMPT_TYPE_PASSWORD		= 0x1,
680ebfedea0SLionel Sambuc     KRB5_PROMPT_TYPE_NEW_PASSWORD	= 0x2,
681ebfedea0SLionel Sambuc     KRB5_PROMPT_TYPE_NEW_PASSWORD_AGAIN = 0x3,
682ebfedea0SLionel Sambuc     KRB5_PROMPT_TYPE_PREAUTH		= 0x4,
683ebfedea0SLionel Sambuc     KRB5_PROMPT_TYPE_INFO		= 0x5
684ebfedea0SLionel Sambuc } krb5_prompt_type;
685ebfedea0SLionel Sambuc 
686ebfedea0SLionel Sambuc typedef struct _krb5_prompt {
687ebfedea0SLionel Sambuc     const char *prompt;
688ebfedea0SLionel Sambuc     int hidden;
689ebfedea0SLionel Sambuc     krb5_data *reply;
690ebfedea0SLionel Sambuc     krb5_prompt_type type;
691ebfedea0SLionel Sambuc } krb5_prompt;
692ebfedea0SLionel Sambuc 
693ebfedea0SLionel Sambuc typedef int (KRB5_CALLCONV * krb5_prompter_fct)(krb5_context /*context*/,
694ebfedea0SLionel Sambuc 						void * /*data*/,
695ebfedea0SLionel Sambuc 						const char * /*name*/,
696ebfedea0SLionel Sambuc 						const char * /*banner*/,
697ebfedea0SLionel Sambuc 						int /*num_prompts*/,
698ebfedea0SLionel Sambuc 						krb5_prompt /*prompts*/[]);
699ebfedea0SLionel Sambuc typedef krb5_error_code (KRB5_CALLCONV * krb5_key_proc)(krb5_context /*context*/,
700ebfedea0SLionel Sambuc 							krb5_enctype /*type*/,
701ebfedea0SLionel Sambuc 							krb5_salt /*salt*/,
702ebfedea0SLionel Sambuc 							krb5_const_pointer /*keyseed*/,
703ebfedea0SLionel Sambuc 							krb5_keyblock ** /*key*/);
704ebfedea0SLionel Sambuc typedef krb5_error_code (KRB5_CALLCONV * krb5_decrypt_proc)(krb5_context /*context*/,
705ebfedea0SLionel Sambuc 							    krb5_keyblock * /*key*/,
706ebfedea0SLionel Sambuc 							    krb5_key_usage /*usage*/,
707ebfedea0SLionel Sambuc 							    krb5_const_pointer /*decrypt_arg*/,
708ebfedea0SLionel Sambuc 							    krb5_kdc_rep * /*dec_rep*/);
709ebfedea0SLionel Sambuc typedef krb5_error_code (KRB5_CALLCONV * krb5_s2k_proc)(krb5_context /*context*/,
710ebfedea0SLionel Sambuc 							krb5_enctype /*type*/,
711ebfedea0SLionel Sambuc 							krb5_const_pointer /*keyseed*/,
712ebfedea0SLionel Sambuc 							krb5_salt /*salt*/,
713ebfedea0SLionel Sambuc 							krb5_data * /*s2kparms*/,
714ebfedea0SLionel Sambuc 							krb5_keyblock ** /*key*/);
715ebfedea0SLionel Sambuc 
716ebfedea0SLionel Sambuc struct _krb5_get_init_creds_opt_private;
717ebfedea0SLionel Sambuc 
718ebfedea0SLionel Sambuc struct _krb5_get_init_creds_opt {
719ebfedea0SLionel Sambuc     krb5_flags flags;
720ebfedea0SLionel Sambuc     krb5_deltat tkt_life;
721ebfedea0SLionel Sambuc     krb5_deltat renew_life;
722ebfedea0SLionel Sambuc     int forwardable;
723ebfedea0SLionel Sambuc     int proxiable;
724ebfedea0SLionel Sambuc     int anonymous;
725ebfedea0SLionel Sambuc     krb5_enctype *etype_list;
726ebfedea0SLionel Sambuc     int etype_list_length;
727ebfedea0SLionel Sambuc     krb5_addresses *address_list;
728ebfedea0SLionel Sambuc     /* XXX the next three should not be used, as they may be
729ebfedea0SLionel Sambuc        removed later */
730ebfedea0SLionel Sambuc     krb5_preauthtype *preauth_list;
731ebfedea0SLionel Sambuc     int preauth_list_length;
732ebfedea0SLionel Sambuc     krb5_data *salt;
733ebfedea0SLionel Sambuc     struct _krb5_get_init_creds_opt_private *opt_private;
734ebfedea0SLionel Sambuc };
735ebfedea0SLionel Sambuc 
736ebfedea0SLionel Sambuc typedef struct _krb5_get_init_creds_opt krb5_get_init_creds_opt;
737ebfedea0SLionel Sambuc 
738ebfedea0SLionel Sambuc #define KRB5_GET_INIT_CREDS_OPT_TKT_LIFE	0x0001
739ebfedea0SLionel Sambuc #define KRB5_GET_INIT_CREDS_OPT_RENEW_LIFE	0x0002
740ebfedea0SLionel Sambuc #define KRB5_GET_INIT_CREDS_OPT_FORWARDABLE	0x0004
741ebfedea0SLionel Sambuc #define KRB5_GET_INIT_CREDS_OPT_PROXIABLE	0x0008
742ebfedea0SLionel Sambuc #define KRB5_GET_INIT_CREDS_OPT_ETYPE_LIST	0x0010
743ebfedea0SLionel Sambuc #define KRB5_GET_INIT_CREDS_OPT_ADDRESS_LIST	0x0020
744ebfedea0SLionel Sambuc #define KRB5_GET_INIT_CREDS_OPT_PREAUTH_LIST	0x0040
745ebfedea0SLionel Sambuc #define KRB5_GET_INIT_CREDS_OPT_SALT		0x0080 /* no supported */
746ebfedea0SLionel Sambuc #define KRB5_GET_INIT_CREDS_OPT_ANONYMOUS	0x0100
747ebfedea0SLionel Sambuc #define KRB5_GET_INIT_CREDS_OPT_DISABLE_TRANSITED_CHECK	0x0200
748ebfedea0SLionel Sambuc 
749ebfedea0SLionel Sambuc /* krb5_init_creds_step flags argument */
750ebfedea0SLionel Sambuc #define KRB5_INIT_CREDS_STEP_FLAG_CONTINUE	0x0001
751ebfedea0SLionel Sambuc 
752ebfedea0SLionel Sambuc typedef struct _krb5_verify_init_creds_opt {
753ebfedea0SLionel Sambuc     krb5_flags flags;
754ebfedea0SLionel Sambuc     int ap_req_nofail;
755ebfedea0SLionel Sambuc } krb5_verify_init_creds_opt;
756ebfedea0SLionel Sambuc 
757ebfedea0SLionel Sambuc #define KRB5_VERIFY_INIT_CREDS_OPT_AP_REQ_NOFAIL	0x0001
758ebfedea0SLionel Sambuc 
759ebfedea0SLionel Sambuc typedef struct krb5_verify_opt {
760ebfedea0SLionel Sambuc     unsigned int flags;
761ebfedea0SLionel Sambuc     krb5_ccache ccache;
762ebfedea0SLionel Sambuc     krb5_keytab keytab;
763ebfedea0SLionel Sambuc     krb5_boolean secure;
764ebfedea0SLionel Sambuc     const char *service;
765ebfedea0SLionel Sambuc } krb5_verify_opt;
766ebfedea0SLionel Sambuc 
767ebfedea0SLionel Sambuc #define KRB5_VERIFY_LREALMS		1
768ebfedea0SLionel Sambuc #define KRB5_VERIFY_NO_ADDRESSES	2
769ebfedea0SLionel Sambuc 
770ebfedea0SLionel Sambuc #define KRB5_KPASSWD_VERS_CHANGEPW      1
771ebfedea0SLionel Sambuc #define KRB5_KPASSWD_VERS_SETPW         0xff80
772ebfedea0SLionel Sambuc 
773ebfedea0SLionel Sambuc #define KRB5_KPASSWD_SUCCESS	0
774ebfedea0SLionel Sambuc #define KRB5_KPASSWD_MALFORMED	1
775ebfedea0SLionel Sambuc #define KRB5_KPASSWD_HARDERROR	2
776ebfedea0SLionel Sambuc #define KRB5_KPASSWD_AUTHERROR	3
777ebfedea0SLionel Sambuc #define KRB5_KPASSWD_SOFTERROR	4
778ebfedea0SLionel Sambuc #define KRB5_KPASSWD_ACCESSDENIED 5
779ebfedea0SLionel Sambuc #define KRB5_KPASSWD_BAD_VERSION 6
780ebfedea0SLionel Sambuc #define KRB5_KPASSWD_INITIAL_FLAG_NEEDED 7
781ebfedea0SLionel Sambuc 
782ebfedea0SLionel Sambuc #define KPASSWD_PORT 464
783ebfedea0SLionel Sambuc 
784ebfedea0SLionel Sambuc /* types for the new krbhst interface */
785ebfedea0SLionel Sambuc struct krb5_krbhst_data;
786ebfedea0SLionel Sambuc typedef struct krb5_krbhst_data *krb5_krbhst_handle;
787ebfedea0SLionel Sambuc 
788ebfedea0SLionel Sambuc #define KRB5_KRBHST_KDC		1
789ebfedea0SLionel Sambuc #define KRB5_KRBHST_ADMIN	2
790ebfedea0SLionel Sambuc #define KRB5_KRBHST_CHANGEPW	3
791ebfedea0SLionel Sambuc #define KRB5_KRBHST_KRB524	4
792ebfedea0SLionel Sambuc #define KRB5_KRBHST_KCA		5
793ebfedea0SLionel Sambuc 
794ebfedea0SLionel Sambuc typedef struct krb5_krbhst_info {
795ebfedea0SLionel Sambuc     enum { KRB5_KRBHST_UDP,
796ebfedea0SLionel Sambuc 	   KRB5_KRBHST_TCP,
797ebfedea0SLionel Sambuc 	   KRB5_KRBHST_HTTP } proto;
798ebfedea0SLionel Sambuc     unsigned short port;
799ebfedea0SLionel Sambuc     unsigned short def_port;
800ebfedea0SLionel Sambuc     struct addrinfo *ai;
801ebfedea0SLionel Sambuc     struct krb5_krbhst_info *next;
802ebfedea0SLionel Sambuc     char hostname[1]; /* has to come last */
803ebfedea0SLionel Sambuc } krb5_krbhst_info;
804ebfedea0SLionel Sambuc 
805ebfedea0SLionel Sambuc /* flags for krb5_krbhst_init_flags (and krb5_send_to_kdc_flags) */
806ebfedea0SLionel Sambuc enum {
807ebfedea0SLionel Sambuc     KRB5_KRBHST_FLAGS_MASTER      = 1,
808ebfedea0SLionel Sambuc     KRB5_KRBHST_FLAGS_LARGE_MSG	  = 2
809ebfedea0SLionel Sambuc };
810ebfedea0SLionel Sambuc 
811ebfedea0SLionel Sambuc typedef krb5_error_code
812ebfedea0SLionel Sambuc (KRB5_CALLCONV * krb5_send_to_kdc_func)(krb5_context, void *, krb5_krbhst_info *, time_t,
813ebfedea0SLionel Sambuc 					const krb5_data *, krb5_data *);
814ebfedea0SLionel Sambuc 
815ebfedea0SLionel Sambuc /** flags for krb5_parse_name_flags */
816ebfedea0SLionel Sambuc enum {
817ebfedea0SLionel Sambuc     KRB5_PRINCIPAL_PARSE_NO_REALM = 1, /**< Require that there are no realm */
818ebfedea0SLionel Sambuc     KRB5_PRINCIPAL_PARSE_REQUIRE_REALM = 2, /**< Require a realm present */
819ebfedea0SLionel Sambuc     KRB5_PRINCIPAL_PARSE_ENTERPRISE = 4 /**< Parse as a NT-ENTERPRISE name */
820ebfedea0SLionel Sambuc };
821ebfedea0SLionel Sambuc 
822ebfedea0SLionel Sambuc /** flags for krb5_unparse_name_flags */
823ebfedea0SLionel Sambuc enum {
824ebfedea0SLionel Sambuc     KRB5_PRINCIPAL_UNPARSE_SHORT = 1, /**< No realm if it is the default realm */
825ebfedea0SLionel Sambuc     KRB5_PRINCIPAL_UNPARSE_NO_REALM = 2, /**< No realm */
826ebfedea0SLionel Sambuc     KRB5_PRINCIPAL_UNPARSE_DISPLAY = 4 /**< No quoting */
827ebfedea0SLionel Sambuc };
828ebfedea0SLionel Sambuc 
829ebfedea0SLionel Sambuc typedef struct krb5_sendto_ctx_data *krb5_sendto_ctx;
830ebfedea0SLionel Sambuc 
831ebfedea0SLionel Sambuc #define KRB5_SENDTO_DONE	0
832ebfedea0SLionel Sambuc #define KRB5_SENDTO_RESTART	1
833ebfedea0SLionel Sambuc #define KRB5_SENDTO_CONTINUE	2
834ebfedea0SLionel Sambuc 
835ebfedea0SLionel Sambuc typedef krb5_error_code
836ebfedea0SLionel Sambuc (KRB5_CALLCONV * krb5_sendto_ctx_func)(krb5_context, krb5_sendto_ctx, void *,
837ebfedea0SLionel Sambuc 				       const krb5_data *, int *);
838ebfedea0SLionel Sambuc 
839ebfedea0SLionel Sambuc struct krb5_plugin;
840ebfedea0SLionel Sambuc enum krb5_plugin_type {
841ebfedea0SLionel Sambuc     PLUGIN_TYPE_DATA = 1,
842ebfedea0SLionel Sambuc     PLUGIN_TYPE_FUNC
843ebfedea0SLionel Sambuc };
844ebfedea0SLionel Sambuc 
845ebfedea0SLionel Sambuc struct credentials; /* this is to keep the compiler happy */
846ebfedea0SLionel Sambuc struct getargs;
847ebfedea0SLionel Sambuc struct sockaddr;
848ebfedea0SLionel Sambuc 
849ebfedea0SLionel Sambuc /**
850ebfedea0SLionel Sambuc  * Semi private, not stable yet
851ebfedea0SLionel Sambuc  */
852ebfedea0SLionel Sambuc 
853ebfedea0SLionel Sambuc typedef struct krb5_crypto_iov {
854ebfedea0SLionel Sambuc     unsigned int flags;
855ebfedea0SLionel Sambuc     /* ignored */
856ebfedea0SLionel Sambuc #define KRB5_CRYPTO_TYPE_EMPTY		0
857ebfedea0SLionel Sambuc     /* OUT krb5_crypto_length(KRB5_CRYPTO_TYPE_HEADER) */
858ebfedea0SLionel Sambuc #define KRB5_CRYPTO_TYPE_HEADER		1
859ebfedea0SLionel Sambuc     /* IN and OUT */
860ebfedea0SLionel Sambuc #define KRB5_CRYPTO_TYPE_DATA		2
861ebfedea0SLionel Sambuc     /* IN */
862ebfedea0SLionel Sambuc #define KRB5_CRYPTO_TYPE_SIGN_ONLY	3
863ebfedea0SLionel Sambuc    /* (only for encryption) OUT krb5_crypto_length(KRB5_CRYPTO_TYPE_TRAILER) */
864ebfedea0SLionel Sambuc #define KRB5_CRYPTO_TYPE_PADDING	4
865ebfedea0SLionel Sambuc    /* OUT krb5_crypto_length(KRB5_CRYPTO_TYPE_TRAILER) */
866ebfedea0SLionel Sambuc #define KRB5_CRYPTO_TYPE_TRAILER	5
867ebfedea0SLionel Sambuc    /* OUT krb5_crypto_length(KRB5_CRYPTO_TYPE_CHECKSUM) */
868ebfedea0SLionel Sambuc #define KRB5_CRYPTO_TYPE_CHECKSUM	6
869ebfedea0SLionel Sambuc     krb5_data data;
870ebfedea0SLionel Sambuc } krb5_crypto_iov;
871ebfedea0SLionel Sambuc 
872ebfedea0SLionel Sambuc 
873ebfedea0SLionel Sambuc /* Glue for MIT */
874ebfedea0SLionel Sambuc 
875ebfedea0SLionel Sambuc typedef struct {
876ebfedea0SLionel Sambuc     int32_t lr_type;
877ebfedea0SLionel Sambuc     krb5_timestamp value;
878ebfedea0SLionel Sambuc } krb5_last_req_entry;
879ebfedea0SLionel Sambuc 
880ebfedea0SLionel Sambuc typedef krb5_error_code
881ebfedea0SLionel Sambuc (KRB5_CALLCONV * krb5_gic_process_last_req)(krb5_context, krb5_last_req_entry **, void *);
882ebfedea0SLionel Sambuc 
883ebfedea0SLionel Sambuc /*
884ebfedea0SLionel Sambuc  *
885ebfedea0SLionel Sambuc  */
886ebfedea0SLionel Sambuc 
887ebfedea0SLionel Sambuc struct hx509_certs_data;
888ebfedea0SLionel Sambuc 
889ebfedea0SLionel Sambuc #include <krb5/krb5-protos.h>
890ebfedea0SLionel Sambuc 
891ebfedea0SLionel Sambuc /* variables */
892ebfedea0SLionel Sambuc 
893ebfedea0SLionel Sambuc extern KRB5_LIB_VARIABLE const char *krb5_config_file;
894ebfedea0SLionel Sambuc extern KRB5_LIB_VARIABLE const char *krb5_defkeyname;
895ebfedea0SLionel Sambuc 
896ebfedea0SLionel Sambuc 
897ebfedea0SLionel Sambuc extern KRB5_LIB_VARIABLE const krb5_cc_ops krb5_acc_ops;
898ebfedea0SLionel Sambuc extern KRB5_LIB_VARIABLE const krb5_cc_ops krb5_fcc_ops;
899ebfedea0SLionel Sambuc extern KRB5_LIB_VARIABLE const krb5_cc_ops krb5_mcc_ops;
900ebfedea0SLionel Sambuc extern KRB5_LIB_VARIABLE const krb5_cc_ops krb5_kcm_ops;
901ebfedea0SLionel Sambuc extern KRB5_LIB_VARIABLE const krb5_cc_ops krb5_akcm_ops;
902ebfedea0SLionel Sambuc extern KRB5_LIB_VARIABLE const krb5_cc_ops krb5_scc_ops;
903ebfedea0SLionel Sambuc 
904ebfedea0SLionel Sambuc extern KRB5_LIB_VARIABLE const krb5_kt_ops krb5_fkt_ops;
905ebfedea0SLionel Sambuc extern KRB5_LIB_VARIABLE const krb5_kt_ops krb5_wrfkt_ops;
906ebfedea0SLionel Sambuc extern KRB5_LIB_VARIABLE const krb5_kt_ops krb5_javakt_ops;
907ebfedea0SLionel Sambuc extern KRB5_LIB_VARIABLE const krb5_kt_ops krb5_mkt_ops;
908ebfedea0SLionel Sambuc extern KRB5_LIB_VARIABLE const krb5_kt_ops krb5_akf_ops;
909ebfedea0SLionel Sambuc extern KRB5_LIB_VARIABLE const krb5_kt_ops krb5_any_ops;
910ebfedea0SLionel Sambuc 
911ebfedea0SLionel Sambuc extern KRB5_LIB_VARIABLE const char *krb5_cc_type_api;
912ebfedea0SLionel Sambuc extern KRB5_LIB_VARIABLE const char *krb5_cc_type_file;
913ebfedea0SLionel Sambuc extern KRB5_LIB_VARIABLE const char *krb5_cc_type_memory;
914ebfedea0SLionel Sambuc extern KRB5_LIB_VARIABLE const char *krb5_cc_type_kcm;
915ebfedea0SLionel Sambuc extern KRB5_LIB_VARIABLE const char *krb5_cc_type_scc;
916ebfedea0SLionel Sambuc 
917ebfedea0SLionel Sambuc #endif /* __KRB5_H__ */
918ebfedea0SLionel Sambuc 
919