(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:
@@ -485,25 +485,21 @@ krb5_digest_set_username(krb5_context context,
|
|||||||
krb5_error_code
|
krb5_error_code
|
||||||
krb5_digest_set_authentication_user(krb5_context context,
|
krb5_digest_set_authentication_user(krb5_context context,
|
||||||
krb5_digest digest,
|
krb5_digest digest,
|
||||||
const char *authentication_user)
|
krb5_principal authentication_user)
|
||||||
{
|
{
|
||||||
|
krb5_error_code ret;
|
||||||
|
|
||||||
if (digest->request.authentication_user) {
|
if (digest->request.authentication_user) {
|
||||||
krb5_set_error_string(context, "authentication_user already set");
|
krb5_set_error_string(context, "authentication_user already set");
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
digest->request.authentication_user =
|
ret = krb5_copy_principal(context,
|
||||||
malloc(sizeof(*digest->request.authentication_user));
|
authentication_user,
|
||||||
|
&digest->request.authentication_user);
|
||||||
if (digest->request.authentication_user == NULL) {
|
if (digest->request.authentication_user == NULL) {
|
||||||
krb5_set_error_string(context, "out of memory");
|
krb5_set_error_string(context, "out of memory");
|
||||||
return ENOMEM;
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user