(krb5_digest_set_authentication_user): use krb5_principal

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17900 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-08-23 11:30:38 +00:00
parent c45391adce
commit b68aa0068d

View File

@@ -485,25 +485,21 @@ krb5_digest_set_username(krb5_context context,
krb5_error_code
krb5_digest_set_authentication_user(krb5_context context,
krb5_digest digest,
const char *authentication_user)
krb5_principal authentication_user)
{
krb5_error_code ret;
if (digest->request.authentication_user) {
krb5_set_error_string(context, "authentication_user already set");
return EINVAL;
}
digest->request.authentication_user =
malloc(sizeof(*digest->request.authentication_user));
ret = krb5_copy_principal(context,
authentication_user,
&digest->request.authentication_user);
if (digest->request.authentication_user == NULL) {
krb5_set_error_string(context, "out of memory");
return ENOMEM;
}
*digest->request.authentication_user = strdup(authentication_user);
if (*digest->request.authentication_user == NULL) {
krb5_set_error_string(context, "out of memory");
free(digest->request.authentication_user);
digest->request.authentication_user = NULL;
return ENOMEM;
}
return 0;
}