From 65f3ad1cbe01601fdafb001fb04798c664979a3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Mon, 16 Feb 2009 18:34:46 +0000 Subject: [PATCH] Switch arguments. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24715 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/gssapi/mech/gss_aeap.c | 55 +++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 21 deletions(-) diff --git a/lib/gssapi/mech/gss_aeap.c b/lib/gssapi/mech/gss_aeap.c index 7c4211d02..3b0e658b5 100644 --- a/lib/gssapi/mech/gss_aeap.c +++ b/lib/gssapi/mech/gss_aeap.c @@ -11,18 +11,20 @@ gss_wrap_iov(OM_uint32 * minor_status, int conf_req_flag, gss_qop_t qop_req, int * conf_state, - int iov_count, - gss_iov_buffer_desc *iov) + gss_iov_buffer_desc *iov, + int iov_count) { struct _gss_context *ctx = (struct _gss_context *) context_handle; gssapi_mech_interface m; + if (minor_status) + *minor_status = 0; if (conf_state) *conf_state = 0; - if (ctx == NULL) { - *minor_status = 0; + if (ctx == NULL) return GSS_S_NO_CONTEXT; - } + if (iov == NULL && iov_count != 0) + return GSS_S_CALL_INACCESSIBLE_READ; m = ctx->gc_mech; @@ -32,7 +34,8 @@ gss_wrap_iov(OM_uint32 * minor_status, } return (m->gm_wrap_iov)(minor_status, ctx->gc_ctx, - conf_req_flag, qop_req, conf_state, iov_count, iov); + conf_req_flag, qop_req, conf_state, + iov, iov_count); } OM_uint32 GSSAPI_LIB_FUNCTION @@ -40,20 +43,22 @@ gss_unwrap_iov(OM_uint32 *minor_status, gss_ctx_id_t context_handle, int *conf_state, gss_qop_t *qop_state, - int iov_count, - gss_iov_buffer_desc *iov) + gss_iov_buffer_desc *iov, + int iov_count) { struct _gss_context *ctx = (struct _gss_context *) context_handle; gssapi_mech_interface m; + if (minor_status) + *minor_status = 0; if (conf_state) *conf_state = 0; if (qop_state) *qop_state = 0; - if (ctx == NULL) { - *minor_status = 0; + if (ctx == NULL) return GSS_S_NO_CONTEXT; - } + if (iov == NULL && iov_count != 0) + return GSS_S_CALL_INACCESSIBLE_READ; m = ctx->gc_mech; @@ -63,7 +68,8 @@ gss_unwrap_iov(OM_uint32 *minor_status, } return (m->gm_unwrap_iov)(minor_status, ctx->gc_ctx, - conf_state, qop_state, iov_count, iov); + conf_state, qop_state, + iov, iov_count); } OM_uint32 GSSAPI_LIB_FUNCTION @@ -71,16 +77,18 @@ gss_wrap_iov_length(OM_uint32 * minor_status, gss_ctx_id_t context_handle, int conf_req_flag, gss_qop_t qop_req, - int iov_count, - gss_iov_buffer_desc *iov) + gss_iov_buffer_desc *iov, + int iov_count) { struct _gss_context *ctx = (struct _gss_context *) context_handle; gssapi_mech_interface m; - if (ctx == NULL) { + if (minor_status) *minor_status = 0; + if (ctx == NULL) return GSS_S_NO_CONTEXT; - } + if (iov == NULL && iov_count != 0) + return GSS_S_CALL_INACCESSIBLE_READ; m = ctx->gc_mech; @@ -90,23 +98,28 @@ gss_wrap_iov_length(OM_uint32 * minor_status, } return (m->gm_wrap_iov_length)(minor_status, ctx->gc_ctx, - conf_req_flag, qop_req, iov_count, iov); + conf_req_flag, qop_req, + iov, iov_count); } OM_uint32 GSSAPI_LIB_FUNCTION gss_release_iov_buffer(OM_uint32 *minor_status, - int iov_count, - gss_iov_buffer_desc *iov) + gss_iov_buffer_desc *iov, + int iov_count) { OM_uint32 junk; size_t i; + if (minor_status) + *minor_status = 0; + if (iov == NULL && iov_count != 0) + return GSS_S_CALL_INACCESSIBLE_READ; + for (i = 0; i < iov_count; i++) { - if ((iov[i].flags & GSS_IOV_BUFFER_FLAG_ALLOCATED) == 0) + if (GSS_IOV_BUFFER_FLAGS(iov[i].type) & GSS_IOV_BUFFER_FLAG_ALLOCATED) continue; gss_release_buffer(&junk, &iov[i].buffer); } - *minor_status = 0; return GSS_S_COMPLETE; }