diff options
-rw-r--r-- | proxy/Makefile.am | 1 | ||||
-rw-r--r-- | proxy/src/mechglue/gpp_init_sec_context.c | 67 |
2 files changed, 68 insertions, 0 deletions
diff --git a/proxy/Makefile.am b/proxy/Makefile.am index b22bb2f..1d202e2 100644 --- a/proxy/Makefile.am +++ b/proxy/Makefile.am @@ -100,6 +100,7 @@ GP_MECHGLUE_OBJ = \ src/mechglue/gpp_display_status.c \ src/mechglue/gpp_import_and_canon_name.c \ src/mechglue/gpp_indicate_mechs.c \ + src/mechglue/gpp_init_sec_context.c \ src/mechglue/gss_plugin.c dist_noinst_HEADERS = diff --git a/proxy/src/mechglue/gpp_init_sec_context.c b/proxy/src/mechglue/gpp_init_sec_context.c new file mode 100644 index 0000000..7085de6 --- /dev/null +++ b/proxy/src/mechglue/gpp_init_sec_context.c @@ -0,0 +1,67 @@ +/* + 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_init_sec_context(OM_uint32 *minor_status, + gss_cred_id_t claimant_cred_handle, + gss_ctx_id_t *context_handle, + gss_name_t target_name, + gss_OID mech_type, + OM_uint32 req_flags, + OM_uint32 time_req, + gss_channel_bindings_t input_cb, + gss_buffer_t input_token, + gss_OID *actual_mech_type, + gss_buffer_t output_token, + OM_uint32 *ret_flags, + OM_uint32 *time_rec) +{ + OM_uint32 maj, min; + + /* if we get our own mechanism it means the original + * caller did not specify any mechanism, and the default + * (interposed) mechanism was choosen */ + if (gss_oid_equal(mech_type, &gssproxy_mech_interposer)) { + mech_type = GSS_C_NO_OID; + } + + maj = gpm_init_sec_context(&min, + claimant_cred_handle, + context_handle, + target_name, + mech_type, + req_flags, + time_req, + input_cb, + input_token, + actual_mech_type, + output_token, + ret_flags, + time_rec); + + *minor_status = gpm_map_error(min); + return maj; +} |