90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose/*
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose SSSD - MIT Kerberos authdata plugin
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose This file contains definitions and declarations to build authdata plugins
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose for MIT Kerberos outside of the MIT Kerberos source tree.
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose*/
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose#ifndef _KRB5_AUTHDATA_INT_H
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose#define _KRB5_AUTHDATA_INT_H
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bosekrb5_error_code KRB5_CALLCONV
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bosekrb5_ser_pack_int32(krb5_int32, krb5_octet **, size_t *);
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bosekrb5_error_code KRB5_CALLCONV
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bosekrb5_ser_unpack_int32(krb5_int32 *, krb5_octet **, size_t *);
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bosekrb5_error_code KRB5_CALLCONV
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bosekrb5_ser_pack_bytes(krb5_octet *, size_t, krb5_octet **, size_t *);
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose#define AD_USAGE_AS_REQ 0x01
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose#define AD_USAGE_TGS_REQ 0x02
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose#define AD_USAGE_AP_REQ 0x04
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose#define AD_USAGE_KDC_ISSUED 0x08
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose#define AD_USAGE_MASK 0x0F
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose#define AD_INFORMATIONAL 0x10
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bosestruct _krb5_authdata_context;
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bosetypedef struct _krb5_authdata_context *krb5_authdata_context;
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bosetypedef void
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose(*authdata_client_plugin_flags_proc)(krb5_context kcontext,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *plugin_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose krb5_authdatatype ad_type,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose krb5_flags *flags);
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bosetypedef krb5_error_code
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose(*authdata_client_plugin_init_proc)(krb5_context context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void **plugin_context);
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bosetypedef void
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose(*authdata_client_plugin_fini_proc)(krb5_context kcontext,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *plugin_context);
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bosetypedef krb5_error_code
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose(*authdata_client_request_init_proc)(krb5_context kcontext,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose struct _krb5_authdata_context *context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *plugin_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void **request_context);
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bosetypedef void
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose(*authdata_client_request_fini_proc)(krb5_context kcontext,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose struct _krb5_authdata_context *context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *plugin_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *request_context);
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bosetypedef krb5_error_code
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose(*authdata_client_import_authdata_proc)(krb5_context kcontext,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose struct _krb5_authdata_context *context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *plugin_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *request_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose krb5_authdata **authdata,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose krb5_boolean kdc_issued_flag,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose krb5_const_principal issuer);
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bosetypedef krb5_error_code
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose(*authdata_client_export_authdata_proc)(krb5_context kcontext,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose struct _krb5_authdata_context *context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *plugin_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *request_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose krb5_flags usage,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose krb5_authdata ***authdata);
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bosetypedef krb5_error_code
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose(*authdata_client_get_attribute_types_proc)(krb5_context kcontext,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose struct _krb5_authdata_context *context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *plugin_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *request_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose krb5_data **attrs);
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bosetypedef krb5_error_code
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose(*authdata_client_get_attribute_proc)(krb5_context kcontext,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose struct _krb5_authdata_context *context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *plugin_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *request_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose const krb5_data *attribute,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose krb5_boolean *authenticated,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose krb5_boolean *complete,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose krb5_data *value,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose krb5_data *display_value,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose int *more);
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bosetypedef krb5_error_code
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose(*authdata_client_set_attribute_proc)(krb5_context kcontext,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose struct _krb5_authdata_context *context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *plugin_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *request_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose krb5_boolean complete,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose const krb5_data *attribute,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose const krb5_data *value);
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bosetypedef krb5_error_code
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose(*authdata_client_delete_attribute_proc)(krb5_context kcontext,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose struct _krb5_authdata_context *context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *plugin_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *request_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose const krb5_data *attribute);
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bosetypedef krb5_error_code
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose(*authdata_client_export_internal_proc)(krb5_context kcontext,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose struct _krb5_authdata_context *context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *plugin_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *request_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose krb5_boolean restrict_authenticated,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void **ptr);
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bosetypedef void
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose(*authdata_client_free_internal_proc)(krb5_context kcontext,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose struct _krb5_authdata_context *context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *plugin_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *request_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *ptr);
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bosetypedef krb5_error_code
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose(*authdata_client_verify_proc)(krb5_context kcontext,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose struct _krb5_authdata_context *context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *plugin_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *request_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose const krb5_auth_context *auth_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose const krb5_keyblock *key,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose const krb5_ap_req *req);
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bosetypedef krb5_error_code
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose(*authdata_client_size_proc)(krb5_context kcontext,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose struct _krb5_authdata_context *context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *plugin_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *request_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose size_t *sizep);
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bosetypedef krb5_error_code
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose(*authdata_client_externalize_proc)(krb5_context kcontext,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose struct _krb5_authdata_context *context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *plugin_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *request_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose krb5_octet **buffer,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose size_t *lenremain);
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bosetypedef krb5_error_code
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose(*authdata_client_internalize_proc)(krb5_context kcontext,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose struct _krb5_authdata_context *context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *plugin_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *request_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose krb5_octet **buffer,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose size_t *lenremain);
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bosetypedef krb5_error_code
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose(*authdata_client_copy_proc)(krb5_context kcontext,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose struct _krb5_authdata_context *context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *plugin_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *request_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *dst_plugin_context,
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose void *dst_request_context);
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bosetypedef struct krb5plugin_authdata_client_ftable_v0 {
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose char *name;
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose krb5_authdatatype *ad_type_list;
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose authdata_client_plugin_init_proc init;
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose authdata_client_plugin_fini_proc fini;
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose authdata_client_plugin_flags_proc flags;
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose authdata_client_request_init_proc request_init;
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose authdata_client_request_fini_proc request_fini;
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose authdata_client_get_attribute_types_proc get_attribute_types;
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose authdata_client_get_attribute_proc get_attribute;
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose authdata_client_set_attribute_proc set_attribute;
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose authdata_client_delete_attribute_proc delete_attribute;
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose authdata_client_export_authdata_proc export_authdata;
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose authdata_client_import_authdata_proc import_authdata;
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose authdata_client_export_internal_proc export_internal;
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose authdata_client_free_internal_proc free_internal;
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose authdata_client_verify_proc verify;
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose authdata_client_size_proc size;
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose authdata_client_externalize_proc externalize;
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose authdata_client_internalize_proc internalize;
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose authdata_client_copy_proc copy; /* optional */
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose} krb5plugin_authdata_client_ftable_v0;
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose
90fd1bbd6035cdab46faa3a695a2fb2be6508b17Sumit Bose#endif /* _KRB5_AUTHDATA_INT_H */