diff options
author | Simo Sorce <simo@redhat.com> | 2012-05-31 19:01:28 -0400 |
---|---|---|
committer | Günther Deschner <gdeschner@redhat.com> | 2012-06-26 14:44:44 +0200 |
commit | a63eba03a7a8cb8c6f7ad68fb2afd53393b7cbc5 (patch) | |
tree | 03efd737cf6e56087563961252c5f0c842b01626 /proxy | |
parent | e8b0db09803276620d7316dd333a4b3d17d6cd72 (diff) | |
download | gss-proxy-a63eba03a7a8cb8c6f7ad68fb2afd53393b7cbc5.tar.gz gss-proxy-a63eba03a7a8cb8c6f7ad68fb2afd53393b7cbc5.tar.xz gss-proxy-a63eba03a7a8cb8c6f7ad68fb2afd53393b7cbc5.zip |
Implement name related mechglue wrappers
Diffstat (limited to 'proxy')
-rw-r--r-- | proxy/Makefile.am | 1 | ||||
-rw-r--r-- | proxy/src/mechglue/gpp_import_and_canon_name.c | 116 |
2 files changed, 117 insertions, 0 deletions
diff --git a/proxy/Makefile.am b/proxy/Makefile.am index c43f72b..3be633a 100644 --- a/proxy/Makefile.am +++ b/proxy/Makefile.am @@ -98,6 +98,7 @@ GP_MECHGLUE_OBJ = \ src/mechglue/gpp_accept_sec_context.c \ src/mechglue/gpp_acquire_cred.c \ src/mechglue/gpp_display_status.c \ + src/mechglue/gpp_import_and_canon_name.c \ src/mechglue/gss_plugin.c dist_noinst_HEADERS = diff --git a/proxy/src/mechglue/gpp_import_and_canon_name.c b/proxy/src/mechglue/gpp_import_and_canon_name.c new file mode 100644 index 0000000..69ecaee --- /dev/null +++ b/proxy/src/mechglue/gpp_import_and_canon_name.c @@ -0,0 +1,116 @@ +/* + 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_name(OM_uint32 *minor_status, + gss_name_t input_name, + gss_buffer_t output_name_buffer, + gss_OID *output_name_type) +{ + OM_uint32 maj, min; + + maj = gpm_display_name(&min, + input_name, + output_name_buffer, + output_name_type); + + *minor_status = gpm_map_error(min); + return maj; +} + +OM_uint32 gssi_import_name(OM_uint32 *minor_status, + gss_buffer_t input_name_buffer, + gss_OID input_name_type, + gss_name_t *output_name) +{ + OM_uint32 maj, min; + + maj = gpm_import_name(&min, + input_name_buffer, + input_name_type, + output_name); + + *minor_status = gpm_map_error(min); + return maj; +} + +OM_uint32 gssi_export_name(OM_uint32 *minor_status, + const gss_name_t input_name, + gss_buffer_t exported_name) +{ + OM_uint32 maj, min; + + maj = gpm_export_name(&min, + input_name, + exported_name); + + *minor_status = gpm_map_error(min); + return maj; +} + +OM_uint32 gssi_duplicate_name(OM_uint32 *minor_status, + const gss_name_t input_name, + gss_name_t *dest_name) +{ + OM_uint32 maj, min; + + maj = gpm_duplicate_name(&min, + input_name, + dest_name); + + *minor_status = gpm_map_error(min); + return maj; +} + +OM_uint32 gssi_inquire_name(OM_uint32 *minor_status, + gss_name_t name, + int *name_is_NM, + gss_OID *NM_mech, + gss_buffer_set_t *attrs) +{ + OM_uint32 maj, min; + + maj = gpm_inquire_name(&min, + name, + name_is_NM, + NM_mech, + attrs); + + *minor_status = gpm_map_error(min); + return maj; +} + +OM_uint32 gssi_release_name(OM_uint32 *minor_status, + gss_name_t *input_name) +{ + OM_uint32 maj, min; + + maj = gpm_release_name(&min, + input_name); + + *minor_status = gpm_map_error(min); + return maj; +} |