fast_factor.h revision 2
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/*
db7e1bb32ac7dcb73f8d2984819483b1ae7a25b9Gordon Ross * Returns success with a null armor_key if FAST is available but not in use.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Returns failure if the client library does not support FAST.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow/* Solaris Kerberos */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#include <preauth_plugin.h>
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic inline krb5_error_code
4bff34e37def8a90f9194d81bc345c52ba20086athurlowfast_get_armor_key(krb5_context context, preauth_get_client_data_proc get_data,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow struct _krb5_preauth_client_rock *rock,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow krb5_keyblock **armor_key)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow{
4bff34e37def8a90f9194d81bc345c52ba20086athurlow krb5_error_code retval = 0;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow krb5_data *data;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow retval = get_data(context, rock, krb5plugin_preauth_client_fast_armor, &data);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow if (retval == 0) {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow *armor_key = (krb5_keyblock *) data->data;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow data->data = NULL;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow get_data(context, rock, krb5plugin_preauth_client_free_fast_armor,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow &data);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow }
4bff34e37def8a90f9194d81bc345c52ba20086athurlow return retval;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow}
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic inline krb5_error_code
4bff34e37def8a90f9194d81bc345c52ba20086athurlowfast_kdc_get_armor_key(krb5_context context,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow preauth_get_entry_data_proc get_entry,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow krb5_kdc_req *request,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow struct _krb5_db_entry_new *client,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow krb5_keyblock **armor_key)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow{
4bff34e37def8a90f9194d81bc345c52ba20086athurlow krb5_error_code retval;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow krb5_data *data;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow retval = get_entry(context, request, client, krb5plugin_preauth_fast_armor,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow &data);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow if (retval == 0) {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow *armor_key = (krb5_keyblock *) data->data;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow data->data = NULL;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow get_entry(context, request, client,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow krb5plugin_preauth_free_fast_armor, &data);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow }
4bff34e37def8a90f9194d81bc345c52ba20086athurlow return retval;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow}
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic inline krb5_error_code
4bff34e37def8a90f9194d81bc345c52ba20086athurlowfast_kdc_replace_reply_key(krb5_context context,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow preauth_get_entry_data_proc get_data,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow krb5_kdc_req *request)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow{
4bff34e37def8a90f9194d81bc345c52ba20086athurlow return 0;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow}
4bff34e37def8a90f9194d81bc345c52ba20086athurlow
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic inline krb5_error_code
4bff34e37def8a90f9194d81bc345c52ba20086athurlowfast_set_kdc_verified(krb5_context context,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow preauth_get_client_data_proc get_data,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow struct _krb5_preauth_client_rock *rock)
4bff34e37def8a90f9194d81bc345c52ba20086athurlow{
4bff34e37def8a90f9194d81bc345c52ba20086athurlow return 0;
db7e1bb32ac7dcb73f8d2984819483b1ae7a25b9Gordon Ross}
db7e1bb32ac7dcb73f8d2984819483b1ae7a25b9Gordon Ross