(krb5_string_to_salttype): new function

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7127 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1999-10-10 04:53:44 +00:00
parent dce040288a
commit 78e6a32f6e

View File

@@ -509,6 +509,27 @@ krb5_salttype_to_string (krb5_context context,
return HEIM_ERR_SALTTYPE_NOSUPP; return HEIM_ERR_SALTTYPE_NOSUPP;
} }
krb5_error_code
krb5_string_to_salttype (krb5_context context,
krb5_enctype etype,
const char *string,
krb5_salttype *salttype)
{
struct encryption_type *e;
struct salt_type *st;
e = _find_enctype (etype);
if (e == NULL)
return KRB5_PROG_ETYPE_NOSUPP;
for (st = e->keytype->string_to_key; st && st->type; st++) {
if (strcasecmp (st->name, string) == 0) {
*salttype = st->type;
return 0;
}
}
return HEIM_ERR_SALTTYPE_NOSUPP;
}
krb5_error_code krb5_error_code
krb5_get_pw_salt(krb5_context context, krb5_get_pw_salt(krb5_context context,
krb5_const_principal principal, krb5_const_principal principal,