xref: /freebsd/crypto/krb5/src/plugins/preauth/pkinit/pkinit_accessor.h (revision f1c4c3daccbaf3820f0e2224de53df12fc952fcc)
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_kdc_dh_key_info);
49 DEF_EXT_FUNC_PTRS(krb5_pa_pk_as_rep);
50 DEF_EXT_FUNC_PTRS(krb5_pa_pk_as_req);
51 DEF_EXT_FUNC_PTRS(krb5_reply_key_pack);
52 
53 /* special cases... */
54 extern krb5_error_code (*k5int_decode_krb5_principal_name)
55 	(const krb5_data *, krb5_principal_data **);
56 
57 extern krb5_error_code (*k5int_encode_krb5_td_dh_parameters)
58 	(krb5_algorithm_identifier *const *, krb5_data **code);
59 extern krb5_error_code (*k5int_decode_krb5_td_dh_parameters)
60 	(const krb5_data *, krb5_algorithm_identifier ***);
61 
62 extern krb5_error_code (*k5int_encode_krb5_td_trusted_certifiers)
63 	(krb5_external_principal_identifier *const *, krb5_data **code);
64 extern krb5_error_code (*k5int_decode_krb5_td_trusted_certifiers)
65 	(const krb5_data *, krb5_external_principal_identifier ***);
66 
67 extern krb5_error_code (*k5int_encode_krb5_kdc_req_body)
68 	(const krb5_kdc_req *rep, krb5_data **code);
69 extern void (KRB5_CALLCONV *k5int_krb5_free_kdc_req)
70 	(krb5_context, krb5_kdc_req * );
71 extern void (*k5int_set_prompt_types)
72 	(krb5_context, krb5_prompt_type *);
73 
74 #endif /* _PKINIT_ACCESSOR_H */
75