]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix error mappings for IOV MIC mechglue funcs
authorTomas Kuthan <tkuthan@gmail.com>
Wed, 16 Sep 2015 10:13:26 +0000 (12:13 +0200)
committerGreg Hudson <ghudson@mit.edu>
Thu, 17 Sep 2015 16:34:31 +0000 (12:34 -0400)
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

src/lib/gssapi/mechglue/g_unwrap_iov.c
src/lib/gssapi/mechglue/g_wrap_iov.c

index 9b95c0162cc2d57359bb34293279f8569db3ba73..c0dd314b1be8b7325fc06a9bb9cb25f7759c848c 100644 (file)
@@ -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;
 }
index 17a2537e0e5c97da8a2e33c974508b47026aa637..40cd98fc91cdf8c7acb23b9c9ef79c9b3269f177 100644 (file)
@@ -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