Add naming extension SPIs
This commit is contained in:
65
lib/gssapi/mech/gss_delete_name_attribute.c
Normal file
65
lib/gssapi/mech/gss_delete_name_attribute.c
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright (c) 2010, PADL Software Pty Ltd.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of PADL Software nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY PADL SOFTWARE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL PADL SOFTWARE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "mech_locl.h"
|
||||
|
||||
OM_uint32
|
||||
gss_delete_name_attribute(OM_uint32 *minor_status,
|
||||
gss_name_t input_name,
|
||||
gss_buffer_t attr)
|
||||
{
|
||||
OM_uint32 major_status = GSS_S_UNAVAILABLE;
|
||||
struct _gss_name *name = (struct _gss_name *) input_name;
|
||||
struct _gss_mechanism_name *mn;
|
||||
|
||||
*minor_status = 0;
|
||||
|
||||
if (input_name == GSS_C_NO_NAME)
|
||||
return GSS_S_BAD_NAME;
|
||||
|
||||
HEIM_SLIST_FOREACH(mn, &name->gn_mn, gmn_link) {
|
||||
gssapi_mech_interface m = mn->gmn_mech;
|
||||
|
||||
if (!m->gm_delete_name_attribute)
|
||||
continue;
|
||||
|
||||
major_status = m->gm_delete_name_attribute(minor_status,
|
||||
mn->gmn_name,
|
||||
attr);
|
||||
if (GSS_ERROR(major_status))
|
||||
_gss_mg_error(m, major_status, *minor_status);
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
return major_status;
|
||||
}
|
68
lib/gssapi/mech/gss_display_name_ext.c
Normal file
68
lib/gssapi/mech/gss_display_name_ext.c
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Copyright (c) 2010, PADL Software Pty Ltd.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of PADL Software nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY PADL SOFTWARE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL PADL SOFTWARE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "mech_locl.h"
|
||||
|
||||
OM_uint32
|
||||
gss_display_name_ext(OM_uint32 *minor_status,
|
||||
gss_name_t input_name,
|
||||
gss_OID display_as_name_type,
|
||||
gss_buffer_t display_name)
|
||||
{
|
||||
OM_uint32 major_status = GSS_S_UNAVAILABLE;
|
||||
struct _gss_name *name = (struct _gss_name *) input_name;
|
||||
struct _gss_mechanism_name *mn;
|
||||
|
||||
*minor_status = 0;
|
||||
_mg_buffer_zero(display_name);
|
||||
|
||||
if (input_name == GSS_C_NO_NAME)
|
||||
return GSS_S_BAD_NAME;
|
||||
|
||||
HEIM_SLIST_FOREACH(mn, &name->gn_mn, gmn_link) {
|
||||
gssapi_mech_interface m = mn->gmn_mech;
|
||||
|
||||
if (!m->gm_display_name_ext)
|
||||
continue;
|
||||
|
||||
major_status = m->gm_display_name_ext(minor_status,
|
||||
mn->gmn_name,
|
||||
display_as_name_type,
|
||||
display_name);
|
||||
if (GSS_ERROR(major_status))
|
||||
_gss_mg_error(m, major_status, *minor_status);
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
return major_status;
|
||||
}
|
66
lib/gssapi/mech/gss_export_name_composite.c
Normal file
66
lib/gssapi/mech/gss_export_name_composite.c
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright (c) 2010, PADL Software Pty Ltd.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of PADL Software nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY PADL SOFTWARE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL PADL SOFTWARE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "mech_locl.h"
|
||||
|
||||
OM_uint32
|
||||
gss_export_name_composite(OM_uint32 *minor_status,
|
||||
gss_name_t input_name,
|
||||
gss_buffer_t exp_composite_name)
|
||||
{
|
||||
OM_uint32 major_status = GSS_S_UNAVAILABLE;
|
||||
struct _gss_name *name = (struct _gss_name *) input_name;
|
||||
struct _gss_mechanism_name *mn;
|
||||
|
||||
*minor_status = 0;
|
||||
_mg_buffer_zero(exp_composite_name);
|
||||
|
||||
if (input_name == GSS_C_NO_NAME)
|
||||
return GSS_S_BAD_NAME;
|
||||
|
||||
HEIM_SLIST_FOREACH(mn, &name->gn_mn, gmn_link) {
|
||||
gssapi_mech_interface m = mn->gmn_mech;
|
||||
|
||||
if (!m->gm_export_name_composite)
|
||||
continue;
|
||||
|
||||
major_status = m->gm_export_name_composite(minor_status,
|
||||
mn->gmn_name,
|
||||
exp_composite_name);
|
||||
if (GSS_ERROR(major_status))
|
||||
_gss_mg_error(m, major_status, *minor_status);
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
return major_status;
|
||||
}
|
@@ -1,17 +1,79 @@
|
||||
|
||||
/**
|
||||
/*
|
||||
* Copyright (c) 2010, PADL Software Pty Ltd.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of PADL Software nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY PADL SOFTWARE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL PADL SOFTWARE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "mech_locl.h"
|
||||
|
||||
OM_uint32
|
||||
gss_get_name_attribute(OM_uint32 *minor_status,
|
||||
gss_name_t name,
|
||||
gss_name_t input_name,
|
||||
gss_buffer_t attr,
|
||||
int *authenticated,
|
||||
int *complete,
|
||||
int *complete,
|
||||
gss_buffer_t value,
|
||||
gss_buffer_t display_value,
|
||||
int *more)
|
||||
{
|
||||
return GSS_S_FAILURE;
|
||||
OM_uint32 major_status = GSS_S_UNAVAILABLE;
|
||||
struct _gss_name *name = (struct _gss_name *) input_name;
|
||||
struct _gss_mechanism_name *mn;
|
||||
|
||||
*minor_status = 0;
|
||||
*authenticated = 0;
|
||||
*complete = 0;
|
||||
_mg_buffer_zero(value);
|
||||
_mg_buffer_zero(display_value);
|
||||
|
||||
if (input_name == GSS_C_NO_NAME)
|
||||
return GSS_S_BAD_NAME;
|
||||
|
||||
HEIM_SLIST_FOREACH(mn, &name->gn_mn, gmn_link) {
|
||||
gssapi_mech_interface m = mn->gmn_mech;
|
||||
|
||||
if (!m->gm_get_name_attribute)
|
||||
continue;
|
||||
|
||||
major_status = m->gm_get_name_attribute(minor_status,
|
||||
mn->gmn_name,
|
||||
attr,
|
||||
authenticated,
|
||||
complete,
|
||||
value,
|
||||
display_value,
|
||||
more);
|
||||
if (GSS_ERROR(major_status))
|
||||
_gss_mg_error(m, major_status, *minor_status);
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
return major_status;
|
||||
}
|
||||
|
@@ -1,23 +1,77 @@
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
/*
|
||||
* Copyright (c) 2010, PADL Software Pty Ltd.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of PADL Software nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY PADL SOFTWARE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL PADL SOFTWARE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "mech_locl.h"
|
||||
|
||||
OM_uint32
|
||||
gss_inquire_name(OM_uint32 *minor_status,
|
||||
gss_name_t name,
|
||||
gss_name_t input_name,
|
||||
int *name_is_MN,
|
||||
gss_OID *MN_mech,
|
||||
gss_buffer_set_t *attrs)
|
||||
{
|
||||
OM_uint32 major_status = GSS_S_UNAVAILABLE;
|
||||
struct _gss_name *name = (struct _gss_name *) input_name;
|
||||
struct _gss_mechanism_name *mn;
|
||||
|
||||
*minor_status = 0;
|
||||
*name_is_MN = 0;
|
||||
*MN_mech = NULL;
|
||||
attrs->count = 0;
|
||||
attrs->elements = NULL;
|
||||
*MN_mech = GSS_C_NO_OID;
|
||||
*attrs = GSS_C_NO_BUFFER_SET;
|
||||
|
||||
return GSS_S_FAILURE;
|
||||
if (input_name == GSS_C_NO_NAME)
|
||||
return GSS_S_BAD_NAME;
|
||||
|
||||
HEIM_SLIST_FOREACH(mn, &name->gn_mn, gmn_link) {
|
||||
gssapi_mech_interface m = mn->gmn_mech;
|
||||
|
||||
if (!m->gm_inquire_name)
|
||||
continue;
|
||||
|
||||
major_status = m->gm_inquire_name(minor_status,
|
||||
mn->gmn_name,
|
||||
NULL,
|
||||
MN_mech,
|
||||
attrs);
|
||||
if (major_status == GSS_S_COMPLETE) {
|
||||
*name_is_MN = 1;
|
||||
#if 0
|
||||
if (*MN_mech == GSS_C_NO_OID)
|
||||
*MN_mech = &m->gm_mech_oid;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
_gss_mg_error(m, major_status, *minor_status);
|
||||
}
|
||||
|
||||
return major_status;
|
||||
}
|
||||
|
70
lib/gssapi/mech/gss_map_name_to_any.c
Normal file
70
lib/gssapi/mech/gss_map_name_to_any.c
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright (c) 2010, PADL Software Pty Ltd.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of PADL Software nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY PADL SOFTWARE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL PADL SOFTWARE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "mech_locl.h"
|
||||
|
||||
OM_uint32
|
||||
gss_map_name_to_any(OM_uint32 *minor_status,
|
||||
gss_name_t input_name,
|
||||
int authenticated,
|
||||
gss_buffer_t type_id,
|
||||
gss_any_t *output)
|
||||
{
|
||||
OM_uint32 major_status = GSS_S_UNAVAILABLE;
|
||||
struct _gss_name *name = (struct _gss_name *) input_name;
|
||||
struct _gss_mechanism_name *mn;
|
||||
|
||||
*minor_status = 0;
|
||||
*output = (gss_any_t)0;
|
||||
|
||||
if (input_name == GSS_C_NO_NAME)
|
||||
return GSS_S_BAD_NAME;
|
||||
|
||||
HEIM_SLIST_FOREACH(mn, &name->gn_mn, gmn_link) {
|
||||
gssapi_mech_interface m = mn->gmn_mech;
|
||||
|
||||
if (!m->gm_map_name_to_any)
|
||||
continue;
|
||||
|
||||
major_status = m->gm_map_name_to_any(minor_status,
|
||||
mn->gmn_name,
|
||||
authenticated,
|
||||
type_id,
|
||||
output);
|
||||
if (GSS_ERROR(major_status))
|
||||
_gss_mg_error(m, major_status, *minor_status);
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
return major_status;
|
||||
}
|
@@ -348,6 +348,14 @@ _gss_load_mech(void)
|
||||
OPTSYM(wrap_iov_length);
|
||||
OPTSPISYM(acquire_cred_with_password);
|
||||
OPTSYM(add_cred_with_password);
|
||||
OPTSYM(display_name_ext);
|
||||
OPTSYM(inquire_name);
|
||||
OPTSYM(get_name_attribute);
|
||||
OPTSYM(set_name_attribute);
|
||||
OPTSYM(delete_name_attribute);
|
||||
OPTSYM(export_name_composite);
|
||||
OPTSYM(map_name_to_any);
|
||||
OPTSYM(release_any_name_mapping);
|
||||
|
||||
/* pick up the oid sets of names */
|
||||
|
||||
|
69
lib/gssapi/mech/gss_release_any_name_mapping.c
Normal file
69
lib/gssapi/mech/gss_release_any_name_mapping.c
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (c) 2010, PADL Software Pty Ltd.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of PADL Software nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY PADL SOFTWARE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL PADL SOFTWARE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "mech_locl.h"
|
||||
|
||||
OM_uint32
|
||||
gss_release_any_name_mapping(OM_uint32 *minor_status,
|
||||
gss_name_t input_name,
|
||||
gss_buffer_t type_id,
|
||||
gss_any_t *input)
|
||||
{
|
||||
OM_uint32 major_status = GSS_S_UNAVAILABLE;
|
||||
struct _gss_name *name = (struct _gss_name *) input_name;
|
||||
struct _gss_mechanism_name *mn;
|
||||
|
||||
*minor_status = 0;
|
||||
|
||||
if (input_name == GSS_C_NO_NAME)
|
||||
return GSS_S_BAD_NAME;
|
||||
|
||||
HEIM_SLIST_FOREACH(mn, &name->gn_mn, gmn_link) {
|
||||
gssapi_mech_interface m = mn->gmn_mech;
|
||||
|
||||
if (!m->gm_release_any_name_mapping)
|
||||
continue;
|
||||
|
||||
major_status = m->gm_release_any_name_mapping(minor_status,
|
||||
mn->gmn_name,
|
||||
type_id,
|
||||
input);
|
||||
if (GSS_ERROR(major_status))
|
||||
_gss_mg_error(m, major_status, *minor_status);
|
||||
else {
|
||||
*input = (gss_any_t)0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return major_status;
|
||||
}
|
69
lib/gssapi/mech/gss_set_name_attribute.c
Normal file
69
lib/gssapi/mech/gss_set_name_attribute.c
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (c) 2010, PADL Software Pty Ltd.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of PADL Software nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY PADL SOFTWARE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL PADL SOFTWARE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "mech_locl.h"
|
||||
|
||||
OM_uint32
|
||||
gss_set_name_attribute(OM_uint32 *minor_status,
|
||||
gss_name_t input_name,
|
||||
int complete,
|
||||
gss_buffer_t attr,
|
||||
gss_buffer_t value)
|
||||
{
|
||||
OM_uint32 major_status = GSS_S_UNAVAILABLE;
|
||||
struct _gss_name *name = (struct _gss_name *) input_name;
|
||||
struct _gss_mechanism_name *mn;
|
||||
|
||||
*minor_status = 0;
|
||||
|
||||
if (input_name == GSS_C_NO_NAME)
|
||||
return GSS_S_BAD_NAME;
|
||||
|
||||
HEIM_SLIST_FOREACH(mn, &name->gn_mn, gmn_link) {
|
||||
gssapi_mech_interface m = mn->gmn_mech;
|
||||
|
||||
if (!m->gm_set_name_attribute)
|
||||
continue;
|
||||
|
||||
major_status = m->gm_set_name_attribute(minor_status,
|
||||
mn->gmn_name,
|
||||
complete,
|
||||
attr,
|
||||
value);
|
||||
if (GSS_ERROR(major_status))
|
||||
_gss_mg_error(m, major_status, *minor_status);
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
return major_status;
|
||||
}
|
Reference in New Issue
Block a user