|
|
07d6f2c |
From 26f94f6e8fd99ee0dfc2f71afb38c74a12482601 Mon Sep 17 00:00:00 2001
|
|
|
07d6f2c |
From: Robbie Harwood <rharwood@redhat.com>
|
|
|
07d6f2c |
Date: Wed, 16 Dec 2015 19:31:22 -0500
|
|
|
07d6f2c |
Subject: [PATCH] Fix mechglue on gss_inquire_attrs_for_mech()
|
|
|
07d6f2c |
|
|
|
07d6f2c |
This includes proper mechanism selection in gss_inquire_attrs_for_mech()
|
|
|
07d6f2c |
itself as well as passing the correct mech down from gss_accept_sec_context()
|
|
|
07d6f2c |
through allow_mech_by_default().
|
|
|
07d6f2c |
|
|
|
07d6f2c |
Also-authored-by: Simo Sorce <simo@redhat.com>
|
|
|
07d6f2c |
---
|
|
|
07d6f2c |
src/lib/gssapi/mechglue/g_accept_sec_context.c | 2 +-
|
|
|
07d6f2c |
src/lib/gssapi/mechglue/g_mechattr.c | 7 ++++++-
|
|
|
07d6f2c |
2 files changed, 7 insertions(+), 2 deletions(-)
|
|
|
07d6f2c |
|
|
|
07d6f2c |
diff --git a/src/lib/gssapi/mechglue/g_accept_sec_context.c b/src/lib/gssapi/mechglue/g_accept_sec_context.c
|
|
|
07d6f2c |
index 6c72d1f..4a86024 100644
|
|
|
07d6f2c |
--- a/src/lib/gssapi/mechglue/g_accept_sec_context.c
|
|
|
07d6f2c |
+++ b/src/lib/gssapi/mechglue/g_accept_sec_context.c
|
|
|
07d6f2c |
@@ -245,7 +245,7 @@ gss_cred_id_t * d_cred;
|
|
|
07d6f2c |
status = GSS_S_NO_CRED;
|
|
|
07d6f2c |
goto error_out;
|
|
|
07d6f2c |
}
|
|
|
07d6f2c |
- } else if (!allow_mech_by_default(selected_mech)) {
|
|
|
07d6f2c |
+ } else if (!allow_mech_by_default(gssint_get_public_oid(selected_mech))) {
|
|
|
07d6f2c |
status = GSS_S_NO_CRED;
|
|
|
07d6f2c |
goto error_out;
|
|
|
07d6f2c |
}
|
|
|
07d6f2c |
diff --git a/src/lib/gssapi/mechglue/g_mechattr.c b/src/lib/gssapi/mechglue/g_mechattr.c
|
|
|
07d6f2c |
index e9299f4..4bd44b5 100644
|
|
|
07d6f2c |
--- a/src/lib/gssapi/mechglue/g_mechattr.c
|
|
|
07d6f2c |
+++ b/src/lib/gssapi/mechglue/g_mechattr.c
|
|
|
07d6f2c |
@@ -161,6 +161,7 @@ gss_inquire_attrs_for_mech(
|
|
|
07d6f2c |
{
|
|
|
07d6f2c |
OM_uint32 status, tmpMinor;
|
|
|
07d6f2c |
gss_mechanism mech;
|
|
|
07d6f2c |
+ gss_OID selected_mech;
|
|
|
07d6f2c |
|
|
|
07d6f2c |
if (minor == NULL)
|
|
|
07d6f2c |
return GSS_S_CALL_INACCESSIBLE_WRITE;
|
|
|
07d6f2c |
@@ -173,7 +174,11 @@ gss_inquire_attrs_for_mech(
|
|
|
07d6f2c |
if (known_mech_attrs != NULL)
|
|
|
07d6f2c |
*known_mech_attrs = GSS_C_NO_OID_SET;
|
|
|
07d6f2c |
|
|
|
07d6f2c |
- mech = gssint_get_mechanism((gss_OID)mech_oid);
|
|
|
07d6f2c |
+ status = gssint_select_mech_type(minor, mech_oid, &selected_mech);
|
|
|
07d6f2c |
+ if (status != GSS_S_COMPLETE)
|
|
|
07d6f2c |
+ return (status);
|
|
|
07d6f2c |
+
|
|
|
07d6f2c |
+ mech = gssint_get_mechanism(selected_mech);
|
|
|
07d6f2c |
if (mech != NULL && mech->gss_inquire_attrs_for_mech != NULL) {
|
|
|
07d6f2c |
status = mech->gss_inquire_attrs_for_mech(minor,
|
|
|
07d6f2c |
mech_oid,
|
|
|
07d6f2c |
--
|
|
|
07d6f2c |
2.6.4
|
|
|
07d6f2c |
|