Set princ type to NT-SMTP-NAME when parsing

In krb5_parse_name_flags(), if the principal name is not an enterprise
name, is one component in length and contains an '@', set the principal
type to NT-SMTP-NAME as specified by RFC 4120.
This commit is contained in:
Jeffrey Altman
2016-11-11 17:44:32 -06:00
committed by Nicolas Williams
parent 6a1db3fb1c
commit 961f543a27

View File

@@ -73,6 +73,8 @@ set_default_princ_type(krb5_principal p, NAME_TYPE defnt)
else if (princ_num_comp(p) == 2 &&
strcmp(princ_ncomp(p, 0), KRB5_WELLKNOWN_NAME) == 0)
princ_type(p) = KRB5_NT_WELLKNOWN;
else if (princ_num_comp(p) == 1 && strchr(princ_ncomp(p, 0), '@') != NULL)
princ_type(p) = KRB5_NT_SMTP_NAME;
else
princ_type(p) = defnt;
return 0;