Rename local include file, remove global files.

Stop exposing global gssapi symbols.
Rename gss_context_id_t and gss_cred_id_t to local names.
Remove SPNEGO code, its now in its own gssapi module.
Add mechglue inquire functions.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17697 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-06-28 08:54:04 +00:00
parent 2baa7e7d61
commit ee09f98c15
66 changed files with 1727 additions and 6039 deletions

View File

@@ -31,20 +31,21 @@
* SUCH DAMAGE.
*/
#include "gssapi_locl.h"
#include "gsskrb5_locl.h"
RCSID("$Id$");
OM_uint32 gss_inquire_cred
(OM_uint32 * minor_status,
const gss_cred_id_t cred_handle,
gss_name_t * name,
OM_uint32 * lifetime,
gss_cred_usage_t * cred_usage,
gss_OID_set * mechanisms
)
OM_uint32 _gsskrb5_inquire_cred
(OM_uint32 * minor_status,
const gss_cred_id_t cred_handle,
gss_name_t * name,
OM_uint32 * lifetime,
gss_cred_usage_t * cred_usage,
gss_OID_set * mechanisms
)
{
gss_cred_id_t cred;
gss_cred_id_t aqcred = GSS_C_NO_CREDENTIAL;
gsskrb5_cred cred;
OM_uint32 ret;
*minor_status = 0;
@@ -55,37 +56,38 @@ OM_uint32 gss_inquire_cred
*mechanisms = GSS_C_NO_OID_SET;
if (cred_handle == GSS_C_NO_CREDENTIAL) {
ret = gss_acquire_cred(minor_status,
GSS_C_NO_NAME,
GSS_C_INDEFINITE,
GSS_C_NO_OID_SET,
GSS_C_BOTH,
&cred,
NULL,
NULL);
ret = _gsskrb5_acquire_cred(minor_status,
GSS_C_NO_NAME,
GSS_C_INDEFINITE,
GSS_C_NO_OID_SET,
GSS_C_BOTH,
&aqcred,
NULL,
NULL);
if (ret)
return ret;
cred = (gsskrb5_cred)aqcred;
} else
cred = (gss_cred_id_t)cred_handle;
cred = (gsskrb5_cred)cred_handle;
HEIMDAL_MUTEX_lock(&cred->cred_id_mutex);
if (name != NULL) {
if (cred->principal != NULL) {
ret = gss_duplicate_name(minor_status, cred->principal,
name);
ret = _gsskrb5_duplicate_name(minor_status, cred->principal,
name);
if (ret)
goto out;
} else if (cred->usage == GSS_C_ACCEPT) {
*minor_status = krb5_sname_to_principal(gssapi_krb5_context, NULL,
NULL, KRB5_NT_SRV_HST, name);
*minor_status = krb5_sname_to_principal(_gsskrb5_context, NULL,
NULL, KRB5_NT_SRV_HST, name);
if (*minor_status) {
ret = GSS_S_FAILURE;
goto out;
}
} else {
*minor_status = krb5_get_default_principal(gssapi_krb5_context,
name);
*minor_status = krb5_get_default_principal(_gsskrb5_context,
name);
if (*minor_status) {
ret = GSS_S_FAILURE;
goto out;
@@ -93,7 +95,7 @@ OM_uint32 gss_inquire_cred
}
}
if (lifetime != NULL) {
ret = gssapi_lifetime_left(minor_status,
ret = _gsskrb5_lifetime_left(minor_status,
cred->lifetime,
lifetime);
if (ret)
@@ -103,21 +105,21 @@ OM_uint32 gss_inquire_cred
*cred_usage = cred->usage;
if (mechanisms != NULL) {
ret = gss_create_empty_oid_set(minor_status, mechanisms);
ret = _gsskrb5_create_empty_oid_set(minor_status, mechanisms);
if (ret)
goto out;
ret = gss_add_oid_set_member(minor_status,
&cred->mechanisms->elements[0],
mechanisms);
ret = _gsskrb5_add_oid_set_member(minor_status,
&cred->mechanisms->elements[0],
mechanisms);
if (ret)
goto out;
}
ret = GSS_S_COMPLETE;
out:
out:
HEIMDAL_MUTEX_unlock(&cred->cred_id_mutex);
if (cred_handle == GSS_C_NO_CREDENTIAL)
ret = gss_release_cred(minor_status, &cred);
if (aqcred != GSS_C_NO_CREDENTIAL)
ret = _gsskrb5_release_cred(minor_status, &aqcred);
return ret;
}