summaryrefslogtreecommitdiffstats
path: root/proxy/src/mechglue
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2012-05-31 18:54:52 -0400
committerSimo Sorce <simo@redhat.com>2012-10-25 15:53:30 -0400
commitefbe70588bccd05dd3964d9e9ceb6dc22719fdb7 (patch)
tree7782a0624c8072105bef2cd59e8f58dbc2182f0e /proxy/src/mechglue
parent27d16d516d5c84aee5ef6ce278977a4fc3bcf836 (diff)
downloadgss-proxy-efbe70588bccd05dd3964d9e9ceb6dc22719fdb7.tar.gz
gss-proxy-efbe70588bccd05dd3964d9e9ceb6dc22719fdb7.tar.xz
gss-proxy-efbe70588bccd05dd3964d9e9ceb6dc22719fdb7.zip
Implement display status mechglue wrappers
Diffstat (limited to 'proxy/src/mechglue')
-rw-r--r--proxy/src/mechglue/gpp_display_status.c68
-rw-r--r--proxy/src/mechglue/gss_plugin.h7
2 files changed, 75 insertions, 0 deletions
diff --git a/proxy/src/mechglue/gpp_display_status.c b/proxy/src/mechglue/gpp_display_status.c
new file mode 100644
index 0000000..68cbf1f
--- /dev/null
+++ b/proxy/src/mechglue/gpp_display_status.c
@@ -0,0 +1,68 @@
+/*
+ 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_display_status(OM_uint32 *minor_status,
+ OM_uint32 status_value,
+ int status_type,
+ const gss_OID mech_type,
+ OM_uint32 *message_context,
+ gss_buffer_t status_string)
+{
+ OM_uint32 maj, min, val;
+
+ /* This function is only ever called for minor status values */
+ if (status_type != GSS_C_MECH_CODE) {
+ return GSS_S_BAD_STATUS;
+ }
+
+ val = gpp_unmap_error(status_value);
+
+ maj = gpm_display_status(&min,
+ val,
+ GSS_C_MECH_CODE,
+ GSS_C_NO_OID,
+ message_context,
+ status_string);
+
+ /* if we do not have a matching saved error code
+ * try to see if we can come up with one from the
+ * mechglue by re-entering it.
+ * We do not spcify the mech in this case it's not used by
+ * the mechglue anyways */
+ if (maj == GSS_S_UNAVAILABLE) {
+
+ return gss_display_status(minor_status,
+ val,
+ GSS_C_MECH_CODE,
+ GSS_C_NO_OID,
+ message_context,
+ status_string);
+ }
+
+ *minor_status = min;
+ return maj;
+}
diff --git a/proxy/src/mechglue/gss_plugin.h b/proxy/src/mechglue/gss_plugin.h
index afc244e..ccfe045 100644
--- a/proxy/src/mechglue/gss_plugin.h
+++ b/proxy/src/mechglue/gss_plugin.h
@@ -220,4 +220,11 @@ OM_uint32 gssi_init_sec_context(OM_uint32 *minor_status,
OM_uint32 *ret_flags,
OM_uint32 *time_rec);
+OM_uint32 gssi_display_status(OM_uint32 *minor_status,
+ OM_uint32 status_value,
+ int status_type,
+ const gss_OID mech_type,
+ OM_uint32 *message_context,
+ gss_buffer_t status_string);
+
#endif /* _GSS_PLUGIN_H_ */