krb5 commit: Fix error mappings for IOV MIC mechglue funcs

Greg Hudson ghudson at mit.edu
Thu Sep 17 12:34:44 EDT 2015


https://github.com/krb5/krb5/commit/969c976ff021db7e409ce9a38d28316d9acfa2cc
commit 969c976ff021db7e409ce9a38d28316d9acfa2cc
Author: Tomas Kuthan <tkuthan at gmail.com>
Date:   Wed Sep 16 12:13:26 2015 +0200

    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 at mit.edu: correct a whitespace issue, edit commit message]
    
    ticket: 8246 (new)
    target_version: 1.13.3
    tags: pullup

 src/lib/gssapi/mechglue/g_unwrap_iov.c |    7 +++++--
 src/lib/gssapi/mechglue/g_wrap_iov.c   |   14 ++++++++++----
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/src/lib/gssapi/mechglue/g_unwrap_iov.c b/src/lib/gssapi/mechglue/g_unwrap_iov.c
index 9b95c01..c0dd314 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 17a2537..40cd98f 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


More information about the cvs-krb5 mailing list