From: Tomas Kuthan Date: Wed, 16 Sep 2015 10:13:26 +0000 (+0200) Subject: Fix error mappings for IOV MIC mechglue funcs X-Git-Tag: krb5-1.14-alpha1~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=969c976ff021db7e409ce9a38d28316d9acfa2cc;p=thirdparty%2Fkrb5.git Fix error mappings for IOV MIC mechglue funcs The mechglue functions gss_get_mic_iov(), gss_get_mic_iov_length(), and gss_verify_mic_iov() don't call map_error() to map mechanism-specific error codes. As a result, a subsequent call to gss_display_status() fails with GSS_S_BAD_MECH, because no translation for the error code is found in the error table. This patch adds the missing map_error call. [ghudson@mit.edu: correct a whitespace issue, edit commit message] ticket: 8246 (new) target_version: 1.13.3 tags: pullup --- diff --git a/src/lib/gssapi/mechglue/g_unwrap_iov.c b/src/lib/gssapi/mechglue/g_unwrap_iov.c index 9b95c0162c..c0dd314b1b 100644 --- a/src/lib/gssapi/mechglue/g_unwrap_iov.c +++ b/src/lib/gssapi/mechglue/g_unwrap_iov.c @@ -133,6 +133,9 @@ gss_verify_mic_iov(OM_uint32 *minor_status, gss_ctx_id_t context_handle, return GSS_S_BAD_MECH; if (mech->gss_verify_mic_iov == NULL) return GSS_S_UNAVAILABLE; - return mech->gss_verify_mic_iov(minor_status, ctx->internal_ctx_id, - qop_state, iov, iov_count); + status = mech->gss_verify_mic_iov(minor_status, ctx->internal_ctx_id, + qop_state, iov, iov_count); + if (status != GSS_S_COMPLETE) + map_error(minor_status, mech); + return status; } diff --git a/src/lib/gssapi/mechglue/g_wrap_iov.c b/src/lib/gssapi/mechglue/g_wrap_iov.c index 17a2537e0e..40cd98fc91 100644 --- a/src/lib/gssapi/mechglue/g_wrap_iov.c +++ b/src/lib/gssapi/mechglue/g_wrap_iov.c @@ -195,8 +195,11 @@ gss_get_mic_iov(OM_uint32 *minor_status, gss_ctx_id_t context_handle, return GSS_S_BAD_MECH; if (mech->gss_get_mic_iov == NULL) return GSS_S_UNAVAILABLE; - return mech->gss_get_mic_iov(minor_status, ctx->internal_ctx_id, qop_req, - iov, iov_count); + status = mech->gss_get_mic_iov(minor_status, ctx->internal_ctx_id, qop_req, + iov, iov_count); + if (status != GSS_S_COMPLETE) + map_error(minor_status, mech); + return status; } OM_uint32 KRB5_CALLCONV @@ -220,8 +223,11 @@ gss_get_mic_iov_length(OM_uint32 *minor_status, gss_ctx_id_t context_handle, return GSS_S_BAD_MECH; if (mech->gss_get_mic_iov_length == NULL) return GSS_S_UNAVAILABLE; - return mech->gss_get_mic_iov_length(minor_status, ctx->internal_ctx_id, - qop_req, iov, iov_count); + status = mech->gss_get_mic_iov_length(minor_status, ctx->internal_ctx_id, + qop_req, iov, iov_count); + if (status != GSS_S_COMPLETE) + map_error(minor_status, mech); + return status; } OM_uint32 KRB5_CALLCONV