xref: /titanic_51/usr/src/lib/krb5/plugins/preauth/pkinit/pkinit_accessor.h (revision 159d09a20817016f09b3ea28d1bdada4a336bb91)
1 /*
2  * COPYRIGHT (C) 2006,2007
3  * THE REGENTS OF THE UNIVERSITY OF MICHIGAN
4  * ALL RIGHTS RESERVED
5  *
6  * Permission is granted to use, copy, create derivative works
7  * and redistribute this software and such derivative works
8  * for any purpose, so long as the name of The University of
9  * Michigan is not used in any advertising or publicity
10  * pertaining to the use of distribution of this software
11  * without specific, written prior authorization.  If the
12  * above copyright notice or any other identification of the
13  * University of Michigan is included in any copy of any
14  * portion of this software, then the disclaimer below must
15  * also be included.
16  *
17  * THIS SOFTWARE IS PROVIDED AS IS, WITHOUT REPRESENTATION
18  * FROM THE UNIVERSITY OF MICHIGAN AS TO ITS FITNESS FOR ANY
19  * PURPOSE, AND WITHOUT WARRANTY BY THE UNIVERSITY OF
20  * MICHIGAN OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
21  * WITHOUT LIMITATION THE IMPLIED WARRANTIES OF
22  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
23  * REGENTS OF THE UNIVERSITY OF MICHIGAN SHALL NOT BE LIABLE
24  * FOR ANY DAMAGES, INCLUDING SPECIAL, INDIRECT, INCIDENTAL, OR
25  * CONSEQUENTIAL DAMAGES, WITH RESPECT TO ANY CLAIM ARISING
26  * OUT OF OR IN CONNECTION WITH THE USE OF THE SOFTWARE, EVEN
27  * IF IT HAS BEEN OR IS HEREAFTER ADVISED OF THE POSSIBILITY OF
28  * SUCH DAMAGES.
29  */
30 
31 #ifndef _PKINIT_ACCESSOR_H
32 #define _PKINIT_ACCESSOR_H
33 
34 /*
35  * Function prototypes
36  */
37 krb5_error_code pkinit_accessor_init(void);
38 
39 #define DEF_EXT_FUNC_PTRS(type) \
40 extern krb5_error_code (*k5int_encode_##type)(const type *, krb5_data **); \
41 extern krb5_error_code (*k5int_decode_##type)(const krb5_data *, type **)
42 
43 #define DEF_EXT_FUNC_PTRS_ARRAY(type) \
44 extern krb5_error_code (*k5int_encode_##type)(const type **, krb5_data **); \
45 extern krb5_error_code (*k5int_decode_##type)(const krb5_data *, type ***)
46 
47 DEF_EXT_FUNC_PTRS(krb5_auth_pack);
48 DEF_EXT_FUNC_PTRS(krb5_auth_pack_draft9);
49 DEF_EXT_FUNC_PTRS(krb5_kdc_dh_key_info);
50 DEF_EXT_FUNC_PTRS(krb5_pa_pk_as_rep);
51 DEF_EXT_FUNC_PTRS(krb5_pa_pk_as_rep_draft9);
52 DEF_EXT_FUNC_PTRS(krb5_pa_pk_as_req);
53 DEF_EXT_FUNC_PTRS(krb5_pa_pk_as_req_draft9);
54 DEF_EXT_FUNC_PTRS(krb5_reply_key_pack);
55 DEF_EXT_FUNC_PTRS(krb5_reply_key_pack_draft9);
56 DEF_EXT_FUNC_PTRS_ARRAY(krb5_typed_data);
57 
58 /* special cases... */
59 extern krb5_error_code (*k5int_decode_krb5_principal_name)
60 	(const krb5_data *, krb5_principal_data **);
61 
62 extern krb5_error_code (*k5int_encode_krb5_td_dh_parameters)
63 	(const krb5_algorithm_identifier **, krb5_data **code);
64 extern krb5_error_code (*k5int_decode_krb5_td_dh_parameters)
65 	(const krb5_data *, krb5_algorithm_identifier ***);
66 
67 extern krb5_error_code (*k5int_encode_krb5_td_trusted_certifiers)
68 	(const krb5_external_principal_identifier **, krb5_data **code);
69 extern krb5_error_code (*k5int_decode_krb5_td_trusted_certifiers)
70 	(const krb5_data *, krb5_external_principal_identifier ***);
71 
72 extern krb5_error_code (*k5int_decode_krb5_as_req)
73 	(const krb5_data *output, krb5_kdc_req **rep);
74 extern krb5_error_code (*k5int_encode_krb5_kdc_req_body)
75 	(const krb5_kdc_req *rep, krb5_data **code);
76 extern void KRB5_CALLCONV (*k5int_krb5_free_kdc_req)
77 	(krb5_context, krb5_kdc_req * );
78 extern void (*k5int_set_prompt_types)
79 	(krb5_context, krb5_prompt_type *);
80 extern krb5_error_code (*k5int_encode_krb5_authdata_elt)
81 	(const krb5_authdata *rep, krb5_data **code);
82 
83 #endif /* _PKINIT_ACCESSOR_H */
84