From 78e6a32f6e65f4c7b62ec779159b80f6e6a9e8e7 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Sun, 10 Oct 1999 04:53:44 +0000 Subject: [PATCH] (krb5_string_to_salttype): new function git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7127 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/krb5/crypto.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lib/krb5/crypto.c b/lib/krb5/crypto.c index 83a806059..a7301abf7 100644 --- a/lib/krb5/crypto.c +++ b/lib/krb5/crypto.c @@ -509,6 +509,27 @@ krb5_salttype_to_string (krb5_context context, 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_get_pw_salt(krb5_context context, krb5_const_principal principal,