#include "k5-int.h"
#include "int-proto.h"
static void
{
}
void KRB5_CALLCONV
{
}
void KRB5_CALLCONV
{
}
void KRB5_CALLCONV
{
}
void KRB5_CALLCONV
{
}
void KRB5_CALLCONV
{
}
void KRB5_CALLCONV
krb5_get_init_creds_opt_set_etype_list(krb5_get_init_creds_opt *opt, krb5_enctype *etype_list, int etype_list_length)
{
}
void KRB5_CALLCONV
{
}
void KRB5_CALLCONV
krb5_get_init_creds_opt_set_preauth_list(krb5_get_init_creds_opt *opt, krb5_preauthtype *preauth_list, int preauth_list_length)
{
}
void KRB5_CALLCONV
{
}
void KRB5_CALLCONV
{
if (prompt)
else
}
/*
* Extending the krb5_get_init_creds_opt structure. The original
* krb5_get_init_creds_opt structure is defined publicly. The
* new extended version is private. The original interface
* assumed a pre-allocated structure which was passed to
* krb5_get_init_creds_init(). The new interface assumes that
* the caller will call krb5_get_init_creds_alloc() and
* krb5_get_init_creds_free().
*
* Callers MUST NOT call krb5_get_init_creds_init() after allocating an
* opts structure using krb5_get_init_creds_alloc(). To do so will
* introduce memory leaks. Unfortunately, there is no way to enforce
* this behavior.
*
* Two private flags are added for backward compatibility.
* KRB5_GET_INIT_CREDS_OPT_EXTENDED says that the structure was allocated
* with the new krb5_get_init_creds_opt_alloc() function.
* KRB5_GET_INIT_CREDS_OPT_SHADOWED is set to indicate that the extended
* structure is a shadow copy of an original krb5_get_init_creds_opt
* structure.
* If KRB5_GET_INIT_CREDS_OPT_SHADOWED is set after a call to
* krb5int_gic_opt_to_opte(), the resulting extended structure should be
* freed (using krb5_get_init_creds_free). Otherwise, the original
* structure was already extended and there is no need to free it.
*/
/* Forward prototype */
static void
static krb5_error_code
{
return EINVAL;
return ENOMEM;
}
/* Allocate any private stuff */
return 0;
}
static krb5_error_code
{
return EINVAL;
/* Free up any private stuff */
return 0;
}
static krb5_gic_opt_ext *
{
return NULL;
if (code) {
"krb5int_gic_opte_alloc: krb5int_gic_opte_private_alloc failed");
return NULL;
}
return(opte);
}
{
return EINVAL;
/*
* We return a new extended structure cast as a krb5_get_init_creds_opt
*/
return ENOMEM;
init_common(*opt);
return 0;
}
void KRB5_CALLCONV
{
return;
/* Don't touch it if we didn't allocate it */
if (!krb5_gic_opt_is_extended(opt))
return;
if (opte->opt_private)
}
static krb5_error_code
{
return ENOMEM;
if (opt)
/*
* Fix the flags -- the EXTENDED flag would have been
* overwritten by the copy if there was one. The
* SHADOWED flag is necessary to ensure that the
* krb5_gic_opt_ext structure that was allocated
* here will be freed by the library because the
* application is unaware of its existence.
*/
return 0;
}
/*
* Convert a krb5_get_init_creds_opt pointer to a pointer to
* an extended, krb5_gic_opt_ext pointer. If the original
* pointer already points to an extended structure, then simply
* return the original pointer. Otherwise, if 'force' is non-zero,
* allocate an extended structure and copy the original over it.
* If the original pointer did not point to an extended structure
* and 'force' is zero, then return an error. This is used in
* cases where the original *should* be an extended structure.
*/
unsigned int force,
const char *where)
{
if (!krb5_gic_opt_is_extended(opt)) {
if (force) {
} else {
"%s: attempt to convert non-extended krb5_get_init_creds_opt",
where);
return EINVAL;
}
}
/* If it is already extended, just return it */
return 0;
}
static void
{
int i;
return;
return;
}
}
static krb5_error_code
const char *attr,
const char *value)
{
int i;
else
return ENOMEM;
return ENOMEM;
return ENOMEM;
}
return 0;
}
/*
* This function allows the caller to supply options to preauth
* plugins. Preauth plugin modules are given a chance to look
* at each option at the time this function is called in ordre
* to check the validity of the option.
* The 'opt' pointer supplied to this function must have been
* obtained using krb5_get_init_creds_opt_alloc()
*/
const char *attr,
const char *value)
{
"krb5_get_init_creds_opt_set_pa");
if (retval)
return retval;
/*
* Copy the option into the extended get_init_creds_opt structure
*/
if (retval)
return retval;
/*
* Give the plugins a chance to look at the option now.
*/
return retval;
}
/*
* This function allows a preauth plugin to obtain preauth
* options. The preauth_data returned from this function
* should be freed by calling krb5_get_init_creds_opt_free_pa().
*
* The 'opt' pointer supplied to this function must have been
* obtained using krb5_get_init_creds_opt_alloc()
*/
int *num_preauth_data,
{
krb5_gic_opt_pa_data *p = NULL;
int i;
"krb5_get_init_creds_opt_get_pa");
if (retval)
return retval;
return EINVAL;
*num_preauth_data = 0;
*preauth_data = NULL;
return 0;
if (p == NULL)
return ENOMEM;
/* Init these to make cleanup easier */
}
goto cleanup;
}
*num_preauth_data = i;
*preauth_data = p;
return 0;
}
free(p);
return ENOMEM;
}
/*
* This function frees the preauth_data that was returned by
* krb5_get_init_creds_opt_get_pa().
*/
void KRB5_CALLCONV
int num_preauth_data,
{
int i;
return;
for (i = 0; i < num_preauth_data; i++) {
}
}