Add gss_duplicate_oid_set()

This commit is contained in:
Nicolas Williams
2020-04-18 21:32:45 -05:00
parent 92c288994a
commit 9f3d9e1a0a
6 changed files with 68 additions and 0 deletions

View File

@@ -106,6 +106,7 @@ mechsrc = \
mech/gss_duplicate_cred.c \
mech/gss_duplicate_name.c \
mech/gss_duplicate_oid.c \
mech/gss_duplicate_oid_set.c \
mech/gss_encapsulate_token.c \
mech/gss_export_name.c \
mech/gss_export_name_composite.c \

View File

@@ -123,6 +123,7 @@ mechsrc = \
mech/gss_duplicate_name.c \
mech/gss_duplicate_cred.c \
mech/gss_duplicate_oid.c \
mech/gss_duplicate_oid_set.c \
mech/gss_encapsulate_token.c \
mech/gss_export_name.c \
mech/gss_export_name_composite.c \
@@ -372,6 +373,7 @@ libgssapi_OBJs = \
$(OBJ)\mech/gss_duplicate_cred.obj \
$(OBJ)\mech/gss_duplicate_name.obj \
$(OBJ)\mech/gss_duplicate_oid.obj \
$(OBJ)\mech/gss_duplicate_oid_set.obj \
$(OBJ)\mech/gss_encapsulate_token.obj \
$(OBJ)\mech/gss_export_name.obj \
$(OBJ)\mech/gss_export_name_composite.obj \

View File

@@ -751,6 +751,12 @@ GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_duplicate_oid (
gss_OID * /* dest_oid */
);
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_duplicate_oid_set (
OM_uint32 * /* minor_status */,
gss_OID_set /* src_oid */,
gss_OID_set * /* dest_oid */
);
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
gss_release_oid
(OM_uint32 * /*minor_status*/,

View File

@@ -34,6 +34,7 @@ EXPORTS
gss_display_status
gss_duplicate_name
gss_duplicate_oid
gss_duplicate_oid_set
gss_encapsulate_token
gss_export_cred
gss_export_name

View File

@@ -0,0 +1,57 @@
/*
* Copyright (c) 2020 Kungliga Tekniska Högskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* 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 the Institute 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 THE INSTITUTE 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 THE INSTITUTE 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"
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
gss_duplicate_oid_set(OM_uint32 *minor_status,
gss_OID_set src_oid_set,
gss_OID_set *dest_oid_set)
{
OM_uint32 major_status, junk;
size_t i;
*dest_oid_set = GSS_C_NO_OID_SET;
major_status = gss_create_empty_oid_set(minor_status, dest_oid_set);
for (i = 0; major_status == GSS_S_COMPLETE && i < src_oid_set->count; i++)
major_status = gss_add_oid_set_member(minor_status,
&src_oid_set->elements[i],
dest_oid_set);
if (major_status != GSS_S_COMPLETE)
gss_release_oid_set(&junk, dest_oid_set);
return major_status;
}

View File

@@ -37,6 +37,7 @@ HEIMDAL_GSS_2.0 {
gss_display_status;
gss_duplicate_name;
gss_duplicate_oid;
gss_duplicate_oid_set;
gss_encapsulate_token;
gss_export_cred;
gss_export_name;