#include <k5-int.h>
#include "pkinit_accessor.h"
#define DEF_FUNC_PTRS(type) \
krb5_error_code (*k5int_encode_##type)(const type *, krb5_data **); \
krb5_error_code (*k5int_decode_##type)(const krb5_data *, type **)
#define DEF_FUNC_PTRS_ARRAY(type) \
krb5_error_code (*k5int_encode_##type)(const type **, krb5_data **); \
krb5_error_code (*k5int_decode_##type)(const krb5_data *, type ***)
DEF_FUNC_PTRS(krb5_auth_pack);
DEF_FUNC_PTRS(krb5_kdc_dh_key_info);
DEF_FUNC_PTRS(krb5_pa_pk_as_rep);
DEF_FUNC_PTRS(krb5_pa_pk_as_req);
DEF_FUNC_PTRS(krb5_reply_key_pack);
krb5_error_code
(*k5int_decode_krb5_principal_name)(const krb5_data *, krb5_principal_data **);
krb5_error_code
(*k5int_encode_krb5_td_dh_parameters)(krb5_algorithm_identifier *const *,
krb5_data **code);
krb5_error_code
(*k5int_decode_krb5_td_dh_parameters)(const krb5_data *,
krb5_algorithm_identifier ***);
krb5_error_code
(*k5int_encode_krb5_td_trusted_certifiers)
(krb5_external_principal_identifier *const *, krb5_data **code);
krb5_error_code
(*k5int_decode_krb5_td_trusted_certifiers)
(const krb5_data *,
krb5_external_principal_identifier ***);
krb5_error_code
(*k5int_encode_krb5_kdc_req_body)(const krb5_kdc_req *rep, krb5_data **code);
void
(KRB5_CALLCONV *k5int_krb5_free_kdc_req)(krb5_context, krb5_kdc_req * );
void
(*k5int_set_prompt_types)(krb5_context, krb5_prompt_type *);
krb5_error_code
pkinit_accessor_init(void)
{
krb5_error_code retval;
krb5int_access k5int;
retval = krb5int_accessor(&k5int, KRB5INT_ACCESS_VERSION);
if (retval)
return retval;
#define SET_PTRS(type) \
k5int_encode_##type = k5int.encode_##type; \
k5int_decode_##type = k5int.decode_##type;
SET_PTRS(krb5_auth_pack);
SET_PTRS(krb5_kdc_dh_key_info);
SET_PTRS(krb5_pa_pk_as_rep);
SET_PTRS(krb5_pa_pk_as_req);
SET_PTRS(krb5_reply_key_pack);
SET_PTRS(krb5_td_dh_parameters);
SET_PTRS(krb5_td_trusted_certifiers);
k5int_decode_krb5_principal_name = k5int.decode_krb5_principal_name;
k5int_encode_krb5_kdc_req_body = k5int.encode_krb5_kdc_req_body;
k5int_krb5_free_kdc_req = k5int.free_kdc_req;
k5int_set_prompt_types = k5int.set_prompt_types;
return 0;
}