Rename gss_context_id_t and gss_cred_id_t to local names
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17699 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -37,6 +37,7 @@ RCSID("$Id$");
|
||||
OM_uint32
|
||||
_gss_spnego_release_cred(OM_uint32 *minor_status, gss_cred_id_t *cred_handle)
|
||||
{
|
||||
gssspnego_cred cred;
|
||||
OM_uint32 ret;
|
||||
|
||||
*minor_status = 0;
|
||||
@@ -44,10 +45,11 @@ _gss_spnego_release_cred(OM_uint32 *minor_status, gss_cred_id_t *cred_handle)
|
||||
if (*cred_handle == GSS_C_NO_CREDENTIAL) {
|
||||
return GSS_S_COMPLETE;
|
||||
}
|
||||
cred = (gssspnego_cred)*cred_handle;
|
||||
|
||||
ret = gss_release_cred(minor_status, &(*cred_handle)->negotiated_cred_id);
|
||||
ret = gss_release_cred(minor_status, &cred->negotiated_cred_id);
|
||||
|
||||
free(*cred_handle);
|
||||
free(cred);
|
||||
*cred_handle = GSS_C_NO_CREDENTIAL;
|
||||
|
||||
return ret;
|
||||
@@ -58,18 +60,23 @@ _gss_spnego_alloc_cred(OM_uint32 *minor_status,
|
||||
gss_cred_id_t mech_cred_handle,
|
||||
gss_cred_id_t *cred_handle)
|
||||
{
|
||||
gssspnego_cred cred;
|
||||
|
||||
if (*cred_handle != GSS_C_NO_CREDENTIAL) {
|
||||
*minor_status = EINVAL;
|
||||
return GSS_S_FAILURE;
|
||||
}
|
||||
|
||||
*cred_handle = (gss_cred_id_t)malloc(sizeof(*cred_handle));
|
||||
if (*cred_handle == GSS_C_NO_CREDENTIAL) {
|
||||
cred = calloc(1, sizeof(*cred));
|
||||
if (cred == NULL) {
|
||||
*cred_handle = GSS_C_NO_CREDENTIAL;
|
||||
*minor_status = ENOMEM;
|
||||
return GSS_S_FAILURE;
|
||||
}
|
||||
|
||||
(*cred_handle)->negotiated_cred_id = mech_cred_handle;
|
||||
cred->negotiated_cred_id = mech_cred_handle;
|
||||
|
||||
*cred_handle = (gss_cred_id_t)cred;
|
||||
|
||||
return GSS_S_COMPLETE;
|
||||
}
|
||||
@@ -94,6 +101,7 @@ OM_uint32 gss_spnego_acquire_cred
|
||||
gss_OID_set_desc actual_desired_mechs;
|
||||
int i, j;
|
||||
gss_cred_id_t cred_handle = GSS_C_NO_CREDENTIAL;
|
||||
gssspnego_cred cred;
|
||||
|
||||
*output_cred_handle = GSS_C_NO_CREDENTIAL;
|
||||
|
||||
@@ -126,15 +134,16 @@ OM_uint32 gss_spnego_acquire_cred
|
||||
if (ret != GSS_S_COMPLETE)
|
||||
goto out;
|
||||
|
||||
cred = (gssspnego_cred)cred_handle;
|
||||
ret = gss_acquire_cred(minor_status, desired_name,
|
||||
time_req, &actual_desired_mechs,
|
||||
cred_usage,
|
||||
&cred_handle->negotiated_cred_id,
|
||||
&cred->negotiated_cred_id,
|
||||
actual_mechs, time_rec);
|
||||
if (ret != GSS_S_COMPLETE)
|
||||
goto out;
|
||||
|
||||
*output_cred_handle = (gss_cred_id_t)cred_handle;
|
||||
*output_cred_handle = cred_handle;
|
||||
|
||||
out:
|
||||
if (actual_desired_mechs.elements != NULL) {
|
||||
@@ -164,6 +173,7 @@ OM_uint32 gss_spnego_inquire_cred
|
||||
gss_OID_set * mechanisms
|
||||
)
|
||||
{
|
||||
gssspnego_cred cred;
|
||||
OM_uint32 ret;
|
||||
|
||||
if (cred_handle == GSS_C_NO_CREDENTIAL) {
|
||||
@@ -171,8 +181,10 @@ OM_uint32 gss_spnego_inquire_cred
|
||||
return GSS_S_NO_CRED;
|
||||
}
|
||||
|
||||
cred = (gssspnego_cred)cred_handle;
|
||||
|
||||
ret = gss_inquire_cred(minor_status,
|
||||
cred_handle->negotiated_cred_id,
|
||||
cred->negotiated_cred_id,
|
||||
name,
|
||||
lifetime,
|
||||
cred_usage,
|
||||
@@ -197,6 +209,7 @@ OM_uint32 gss_spnego_add_cred (
|
||||
{
|
||||
gss_cred_id_t spnego_output_cred_handle = GSS_C_NO_CREDENTIAL;
|
||||
OM_uint32 ret, tmp;
|
||||
gssspnego_cred input_cred, output_cred;
|
||||
|
||||
*output_cred_handle = GSS_C_NO_CREDENTIAL;
|
||||
|
||||
@@ -205,14 +218,17 @@ OM_uint32 gss_spnego_add_cred (
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
input_cred = (gssspnego_cred)input_cred_handle;
|
||||
output_cred = (gssspnego_cred)spnego_output_cred_handle;
|
||||
|
||||
ret = gss_add_cred(minor_status,
|
||||
input_cred_handle->negotiated_cred_id,
|
||||
input_cred->negotiated_cred_id,
|
||||
desired_name,
|
||||
desired_mech,
|
||||
cred_usage,
|
||||
initiator_time_req,
|
||||
acceptor_time_req,
|
||||
&spnego_output_cred_handle->negotiated_cred_id,
|
||||
&output_cred->negotiated_cred_id,
|
||||
actual_mechs,
|
||||
initiator_time_rec,
|
||||
acceptor_time_rec);
|
||||
@@ -236,6 +252,7 @@ OM_uint32 gss_spnego_inquire_cred_by_mech (
|
||||
gss_cred_usage_t * cred_usage
|
||||
)
|
||||
{
|
||||
gssspnego_cred cred;
|
||||
OM_uint32 ret;
|
||||
|
||||
if (cred_handle == GSS_C_NO_CREDENTIAL) {
|
||||
@@ -243,8 +260,10 @@ OM_uint32 gss_spnego_inquire_cred_by_mech (
|
||||
return GSS_S_NO_CRED;
|
||||
}
|
||||
|
||||
cred = (gssspnego_cred)cred_handle;
|
||||
|
||||
ret = gss_inquire_cred_by_mech(minor_status,
|
||||
cred_handle->negotiated_cred_id,
|
||||
cred->negotiated_cred_id,
|
||||
mech_type,
|
||||
name,
|
||||
initiator_lifetime,
|
||||
@@ -260,15 +279,17 @@ OM_uint32 gss_spnego_inquire_cred_by_oid
|
||||
const gss_OID desired_object,
|
||||
gss_buffer_set_t *data_set)
|
||||
{
|
||||
gssspnego_cred cred;
|
||||
OM_uint32 ret;
|
||||
|
||||
if (cred_handle == GSS_C_NO_CREDENTIAL) {
|
||||
*minor_status = 0;
|
||||
return GSS_S_NO_CRED;
|
||||
}
|
||||
cred = (gssspnego_cred)cred_handle;
|
||||
|
||||
ret = gss_inquire_cred_by_oid(minor_status,
|
||||
cred_handle->negotiated_cred_id,
|
||||
cred->negotiated_cred_id,
|
||||
desired_object,
|
||||
data_set);
|
||||
|
||||
|
Reference in New Issue
Block a user