Provide support for enctype aliases for ease of use.

This should be compatible with MIT krb5 at least from my memory.
This commit is contained in:
Roland C. Dowdeswell
2012-03-05 17:04:17 +00:00
parent 635f5ef5b4
commit 6de861263a
7 changed files with 22 additions and 1 deletions

View File

@@ -679,11 +679,17 @@ krb5_string_to_enctype(krb5_context context,
krb5_enctype *etype)
{
int i;
for(i = 0; i < _krb5_num_etypes; i++)
for(i = 0; i < _krb5_num_etypes; i++) {
if(strcasecmp(_krb5_etypes[i]->name, string) == 0){
*etype = _krb5_etypes[i]->type;
return 0;
}
if(_krb5_etypes[i]->alias != NULL &&
strcasecmp(_krb5_etypes[i]->alias, string) == 0){
*etype = _krb5_etypes[i]->type;
return 0;
}
}
krb5_set_error_message (context, KRB5_PROG_ETYPE_NOSUPP,
N_("encryption type %s not supported", ""),
string);