reimplement

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20617 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2007-05-08 12:10:53 +00:00
parent f6710e4719
commit 98b5a48e90

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003 Kungliga Tekniska H<>gskolan * Copyright (c) 2003, 2006, 2007 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden). * (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved. * All rights reserved.
* *
@@ -45,39 +45,23 @@ OM_uint32 _gsskrb5_inquire_cred_by_mech (
gss_cred_usage_t * cred_usage gss_cred_usage_t * cred_usage
) )
{ {
OM_uint32 ret; gss_cred_usage_t usage;
OM_uint32 maj_stat;
OM_uint32 lifetime; OM_uint32 lifetime;
if (gss_oid_equal(mech_type, GSS_C_NO_OID) == 0 && maj_stat =
gss_oid_equal(mech_type, GSS_KRB5_MECHANISM) == 0) { _gsskrb5_inquire_cred (minor_status, cred_handle,
*minor_status = EINVAL; name, &lifetime, &usage, NULL);
return GSS_S_BAD_MECH; if (maj_stat)
} return maj_stat;
ret = _gsskrb5_inquire_cred (minor_status, if (initiator_lifetime)
cred_handle,
name,
&lifetime,
cred_usage,
NULL);
if (ret == 0 && cred_handle != GSS_C_NO_CREDENTIAL) {
gsskrb5_cred cred = (gsskrb5_cred)cred_handle;
gss_cred_usage_t usage;
HEIMDAL_MUTEX_lock(&cred->cred_id_mutex);
usage = cred->usage;
HEIMDAL_MUTEX_unlock(&cred->cred_id_mutex);
if (initiator_lifetime) {
if (usage == GSS_C_INITIATE || usage == GSS_C_BOTH) if (usage == GSS_C_INITIATE || usage == GSS_C_BOTH)
*initiator_lifetime = lifetime; *initiator_lifetime = lifetime;
}
if (acceptor_lifetime) { if (acceptor_lifetime)
if (usage == GSS_C_ACCEPT || usage == GSS_C_BOTH) if (usage == GSS_C_ACCEPT || usage == GSS_C_BOTH)
*acceptor_lifetime = lifetime; *acceptor_lifetime = lifetime;
}
}
return ret; return GSS_S_COMPLETE;
} }