(gss_spnego_acquire_cred): don't care about desired_mechs, get our own
list with indicate_mechs and remote ourself. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17801 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
		| @@ -87,7 +87,7 @@ _gss_spnego_alloc_cred(OM_uint32 *minor_status, | |||||||
|  * more functionality. |  * more functionality. | ||||||
|  */ |  */ | ||||||
| OM_uint32 gss_spnego_acquire_cred | OM_uint32 gss_spnego_acquire_cred | ||||||
|            (OM_uint32 *minor_status, | (OM_uint32 *minor_status, | ||||||
|  const gss_name_t desired_name, |  const gss_name_t desired_name, | ||||||
|  OM_uint32 time_req, |  OM_uint32 time_req, | ||||||
|  const gss_OID_set desired_mechs, |  const gss_OID_set desired_mechs, | ||||||
| @@ -99,14 +99,19 @@ OM_uint32 gss_spnego_acquire_cred | |||||||
| { | { | ||||||
|     OM_uint32 ret, tmp; |     OM_uint32 ret, tmp; | ||||||
|     gss_OID_set_desc actual_desired_mechs; |     gss_OID_set_desc actual_desired_mechs; | ||||||
|  |     gss_OID_set mechs; | ||||||
|     int i, j; |     int i, j; | ||||||
|     gss_cred_id_t cred_handle = GSS_C_NO_CREDENTIAL; |     gss_cred_id_t cred_handle = GSS_C_NO_CREDENTIAL; | ||||||
|     gssspnego_cred cred; |     gssspnego_cred cred; | ||||||
|  |  | ||||||
|     *output_cred_handle = GSS_C_NO_CREDENTIAL; |     *output_cred_handle = GSS_C_NO_CREDENTIAL; | ||||||
|  |  | ||||||
|  |     ret = gss_indicate_mechs(minor_status, &mechs); | ||||||
|  |     if (ret != GSS_S_COMPLETE) | ||||||
|  | 	return ret; | ||||||
|  |  | ||||||
|     /* Remove ourselves from this list */ |     /* Remove ourselves from this list */ | ||||||
|     actual_desired_mechs.count = desired_mechs->count; |     actual_desired_mechs.count = mechs->count; | ||||||
|     actual_desired_mechs.elements = malloc(actual_desired_mechs.count * |     actual_desired_mechs.elements = malloc(actual_desired_mechs.count * | ||||||
| 					   sizeof(gss_OID_desc)); | 					   sizeof(gss_OID_desc)); | ||||||
|     if (actual_desired_mechs.elements == NULL) { |     if (actual_desired_mechs.elements == NULL) { | ||||||
| @@ -115,18 +120,13 @@ OM_uint32 gss_spnego_acquire_cred | |||||||
| 	goto out; | 	goto out; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     for (i = 0, j = 0; i < desired_mechs->count; i++) { |     for (i = 0, j = 0; i < mechs->count; i++) { | ||||||
| 	if (gss_oid_equal(&desired_mechs->elements[i], | 	if (gss_oid_equal(&mechs->elements[i], GSS_SPNEGO_MECHANISM)) | ||||||
| 			  GSS_SPNEGO_MECHANISM)) |  | ||||||
| 	    continue; | 	    continue; | ||||||
|  |  | ||||||
| 	actual_desired_mechs.elements[j].length = | 	actual_desired_mechs.elements[j] = mechs->elements[i]; | ||||||
| 	    desired_mechs->elements[i].length; |  | ||||||
| 	actual_desired_mechs.elements[j].elements = |  | ||||||
| 	    desired_mechs->elements[i].elements; |  | ||||||
| 	j++; | 	j++; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     actual_desired_mechs.count = j; |     actual_desired_mechs.count = j; | ||||||
|  |  | ||||||
|     ret = _gss_spnego_alloc_cred(minor_status, GSS_C_NO_CREDENTIAL, |     ret = _gss_spnego_alloc_cred(minor_status, GSS_C_NO_CREDENTIAL, | ||||||
| @@ -146,6 +146,7 @@ OM_uint32 gss_spnego_acquire_cred | |||||||
|     *output_cred_handle = cred_handle; |     *output_cred_handle = cred_handle; | ||||||
|  |  | ||||||
| out: | out: | ||||||
|  |     gss_release_oid_set(&tmp, &mechs); | ||||||
|     if (actual_desired_mechs.elements != NULL) { |     if (actual_desired_mechs.elements != NULL) { | ||||||
| 	free(actual_desired_mechs.elements); | 	free(actual_desired_mechs.elements); | ||||||
|     } |     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Love Hörnquist Åstrand
					Love Hörnquist Åstrand