RFC 2743 says (regarding gss_acquire_cred),

``A caller may provide the value NULL (GSS_C_NO_NAME) for
  desired_name, which will be interpreted as a request for a
  credential handle that will invoke default behavior when passed
  to GSS_Init_sec_context(), if cred_usage is GSS_C_INITIATE
  or GSS_C_BOTH, or GSS_Accept_sec_context(), if cred_usage is
  GSS_C_ACCEPT or GSS_C_BOTH.''


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11155 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Jacques A. Vidrine
2002-08-20 12:02:45 +00:00
parent e703d7229f
commit fed304b01c
8 changed files with 48 additions and 22 deletions

View File

@@ -51,10 +51,22 @@ OM_uint32 gss_inquire_cred
}
if (name != NULL) {
ret = gss_duplicate_name(minor_status, cred_handle->principal, name);
if (ret) {
if (cred_handle->principal != NULL) {
ret = gss_duplicate_name(minor_status, cred_handle->principal,
name);
if (ret)
return ret;
}
} else if (cred_handle->usage == GSS_C_ACCEPT) {
*minor_status = krb5_sname_to_principal(gssapi_krb5_context, NULL,
NULL, KRB5_NT_SRV_HST, name);
if (*minor_status)
return GSS_S_FAILURE;
} else {
*minor_status = krb5_get_default_principal(gssapi_krb5_context,
name);
if (*minor_status)
return GSS_S_FAILURE;
}
}
if (lifetime != NULL) {
*lifetime = cred_handle->lifetime;