Files
heimdal/get_in_tkt_pw.c
Assar Westerlund e2475934ac kinit now builds and works on some machines
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@302 ec53bebd-3082-4978-b11e-865c3cabbd6b
1996-03-17 14:59:05 +00:00

44 lines
1.2 KiB
C

#include "krb5_locl.h"
static krb5_error_code
key_proc (krb5_context context,
krb5_keytype type,
krb5_data *salt,
krb5_const_pointer keyseed,
krb5_keyblock **key)
{
krb5_error_code err;
char *password = (char *)keyseed;
char buf[BUFSIZ];
*key = malloc (sizeof (**key));
if (*key == NULL)
return ENOMEM;
(*key)->keytype = type;
(*key)->contents.length = 0;
(*key)->contents.data = NULL;
if (password == NULL) {
des_read_pw_string (buf, sizeof(buf), "Password: ", 0);
password = buf;
}
err = krb5_string_to_key (password, salt, *key);
memset (buf, 0, sizeof(buf));
return err;
}
krb5_error_code
krb5_get_in_tkt_with_password (krb5_context context,
krb5_flags options,
krb5_address *const *addrs,
const krb5_enctype *etypes,
const krb5_preauthtype *pre_auth_types,
const char *password,
krb5_ccache ccache,
krb5_creds *creds,
krb5_kdc_rep **ret_as_reply)
{
return krb5_get_in_tkt (context, options, addrs, etypes,
pre_auth_types, key_proc, password,
NULL, NULL, creds, ccache, ret_as_reply);
}