summaryrefslogtreecommitdiffstats
path: root/proxy
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2012-08-28 14:55:12 +0200
committerSimo Sorce <simo@redhat.com>2012-08-28 17:17:41 +0200
commita2fe4eeca580b4acf4e1e0965e47b2bd1fc7ab65 (patch)
treeb9bb44f94788bd15f4ad7874f787b19b5fdf0f71 /proxy
parent0761bb31be5b0dd97ca451a5f9ac80154862a99d (diff)
downloadgss-proxy-a2fe4eeca580b4acf4e1e0965e47b2bd1fc7ab65.tar.gz
gss-proxy-a2fe4eeca580b4acf4e1e0965e47b2bd1fc7ab65.tar.xz
gss-proxy-a2fe4eeca580b4acf4e1e0965e47b2bd1fc7ab65.zip
Implement misc spi calls
Diffstat (limited to 'proxy')
-rw-r--r--proxy/Makefile.am1
-rw-r--r--proxy/src/mechglue/gpp_misc.c55
-rw-r--r--proxy/src/mechglue/gss_plugin.h5
3 files changed, 61 insertions, 0 deletions
diff --git a/proxy/Makefile.am b/proxy/Makefile.am
index 2be59af..2dd955f 100644
--- a/proxy/Makefile.am
+++ b/proxy/Makefile.am
@@ -107,6 +107,7 @@ GP_MECHGLUE_OBJ = \
src/mechglue/gpp_import_and_canon_name.c \
src/mechglue/gpp_indicate_mechs.c \
src/mechglue/gpp_priv_integ.c \
+ src/mechglue/gpp_misc.c \
src/mechglue/gss_plugin.c
dist_noinst_HEADERS = \
diff --git a/proxy/src/mechglue/gpp_misc.c b/proxy/src/mechglue/gpp_misc.c
new file mode 100644
index 0000000..abf3169
--- /dev/null
+++ b/proxy/src/mechglue/gpp_misc.c
@@ -0,0 +1,55 @@
+/*
+ GSS-PROXY
+
+ Copyright (C) 2012 Red Hat, Inc.
+ Copyright (C) 2012 Simo Sorce <simo.sorce@redhat.com>
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+*/
+
+#include "gss_plugin.h"
+
+OM_uint32 gssi_mech_invoke(OM_uint32 *minor_status,
+ const gss_OID desired_mech,
+ const gss_OID desired_object,
+ gss_buffer_t value)
+{
+ enum gpp_behavior behavior;
+ OM_uint32 maj, min;
+
+ /* FIXME: implement remote invoke mech, only local for now */
+ behavior = gpp_get_behavior();
+ if (behavior == GPP_REMOTE_ONLY) {
+ return GSS_S_UNAVAILABLE;
+ }
+
+ maj = gssspi_mech_invoke(&min, gpp_special_mech(desired_mech),
+ desired_object, value);
+
+ *minor_status = gpp_map_error(min);
+ return maj;
+}
+
+/* NOTE: This call is currently useful only for the Spnego mech which we
+ * never interpose */
+#if 0
+OM_uint32 gssi_set_neg_mechs(OM_uint32 *minor_status,
+ gss_cred_id_t cred_handle,
+ const gss_OID_set mech_set);
+#endif
diff --git a/proxy/src/mechglue/gss_plugin.h b/proxy/src/mechglue/gss_plugin.h
index dac0f32..defcb2d 100644
--- a/proxy/src/mechglue/gss_plugin.h
+++ b/proxy/src/mechglue/gss_plugin.h
@@ -351,4 +351,9 @@ OM_uint32 gssi_verify_mic(OM_uint32 *minor_status,
gss_buffer_t message_token,
gss_qop_t *qop_state);
+OM_uint32 gssi_mech_invoke(OM_uint32 *minor_status,
+ const gss_OID desired_mech,
+ const gss_OID desired_object,
+ gss_buffer_t value);
+
#endif /* _GGS_PLUGIN_H_ */