|
Packit |
fd8b60 |
/* #pragma ident "@(#)g_oid_ops.c 1.11 98/01/22 SMI" */
|
|
Packit |
fd8b60 |
/* lib/gssapi/mechglue/g_oid_ops.c - GSSAPI V2 interfaces to manipulate OIDs */
|
|
Packit |
fd8b60 |
/*
|
|
Packit |
fd8b60 |
* Copyright 1995, 2007 by the Massachusetts Institute of Technology.
|
|
Packit |
fd8b60 |
* All Rights Reserved.
|
|
Packit |
fd8b60 |
*
|
|
Packit |
fd8b60 |
* Export of this software from the United States of America may
|
|
Packit |
fd8b60 |
* require a specific license from the United States Government.
|
|
Packit |
fd8b60 |
* It is the responsibility of any person or organization contemplating
|
|
Packit |
fd8b60 |
* export to obtain such a license before exporting.
|
|
Packit |
fd8b60 |
*
|
|
Packit |
fd8b60 |
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
|
|
Packit |
fd8b60 |
* distribute this software and its documentation for any purpose and
|
|
Packit |
fd8b60 |
* without fee is hereby granted, provided that the above copyright
|
|
Packit |
fd8b60 |
* notice appear in all copies and that both that copyright notice and
|
|
Packit |
fd8b60 |
* this permission notice appear in supporting documentation, and that
|
|
Packit |
fd8b60 |
* the name of M.I.T. not be used in advertising or publicity pertaining
|
|
Packit |
fd8b60 |
* to distribution of the software without specific, written prior
|
|
Packit |
fd8b60 |
* permission. Furthermore if you modify this software you must label
|
|
Packit |
fd8b60 |
* your software as modified software and not distribute it in such a
|
|
Packit |
fd8b60 |
* fashion that it might be confused with the original M.I.T. software.
|
|
Packit |
fd8b60 |
* M.I.T. makes no representations about the suitability of
|
|
Packit |
fd8b60 |
* this software for any purpose. It is provided "as is" without express
|
|
Packit |
fd8b60 |
* or implied warranty.
|
|
Packit |
fd8b60 |
*/
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
#include "mglueP.h"
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
/*
|
|
Packit |
fd8b60 |
* gss_release_oid has been moved to g_initialize, becasue it requires access
|
|
Packit |
fd8b60 |
* to the mechanism list. All functions requiring direct access to the
|
|
Packit |
fd8b60 |
* mechanism list are now in g_initialize.c
|
|
Packit |
fd8b60 |
*/
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
OM_uint32 KRB5_CALLCONV
|
|
Packit |
fd8b60 |
gss_create_empty_oid_set(minor_status, oid_set)
|
|
Packit |
fd8b60 |
OM_uint32 *minor_status;
|
|
Packit |
fd8b60 |
gss_OID_set *oid_set;
|
|
Packit |
fd8b60 |
{
|
|
Packit |
fd8b60 |
OM_uint32 status;
|
|
Packit |
fd8b60 |
status = generic_gss_create_empty_oid_set(minor_status, oid_set);
|
|
Packit |
fd8b60 |
if (status != GSS_S_COMPLETE)
|
|
Packit |
fd8b60 |
map_errcode(minor_status);
|
|
Packit |
fd8b60 |
return status;
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
OM_uint32 KRB5_CALLCONV
|
|
Packit |
fd8b60 |
gss_add_oid_set_member(minor_status, member_oid, oid_set)
|
|
Packit |
fd8b60 |
OM_uint32 *minor_status;
|
|
Packit |
fd8b60 |
gss_OID member_oid;
|
|
Packit |
fd8b60 |
gss_OID_set *oid_set;
|
|
Packit |
fd8b60 |
{
|
|
Packit |
fd8b60 |
OM_uint32 status;
|
|
Packit |
fd8b60 |
status = generic_gss_add_oid_set_member(minor_status, member_oid, oid_set);
|
|
Packit |
fd8b60 |
if (status != GSS_S_COMPLETE)
|
|
Packit |
fd8b60 |
map_errcode(minor_status);
|
|
Packit |
fd8b60 |
return status;
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
OM_uint32 KRB5_CALLCONV
|
|
Packit |
fd8b60 |
gss_test_oid_set_member(minor_status, member, set, present)
|
|
Packit |
fd8b60 |
OM_uint32 *minor_status;
|
|
Packit |
fd8b60 |
gss_OID member;
|
|
Packit |
fd8b60 |
gss_OID_set set;
|
|
Packit |
fd8b60 |
int *present;
|
|
Packit |
fd8b60 |
{
|
|
Packit |
fd8b60 |
return generic_gss_test_oid_set_member(minor_status, member, set, present);
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
OM_uint32 KRB5_CALLCONV
|
|
Packit |
fd8b60 |
gss_oid_to_str(minor_status, oid, oid_str)
|
|
Packit |
fd8b60 |
OM_uint32 *minor_status;
|
|
Packit |
fd8b60 |
gss_OID oid;
|
|
Packit |
fd8b60 |
gss_buffer_t oid_str;
|
|
Packit |
fd8b60 |
{
|
|
Packit |
fd8b60 |
OM_uint32 status = generic_gss_oid_to_str(minor_status, oid, oid_str);
|
|
Packit |
fd8b60 |
if (status != GSS_S_COMPLETE)
|
|
Packit |
fd8b60 |
map_errcode(minor_status);
|
|
Packit |
fd8b60 |
return status;
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
OM_uint32 KRB5_CALLCONV
|
|
Packit |
fd8b60 |
gss_str_to_oid(minor_status, oid_str, oid)
|
|
Packit |
fd8b60 |
OM_uint32 *minor_status;
|
|
Packit |
fd8b60 |
gss_buffer_t oid_str;
|
|
Packit |
fd8b60 |
gss_OID *oid;
|
|
Packit |
fd8b60 |
{
|
|
Packit |
fd8b60 |
OM_uint32 status = generic_gss_str_to_oid(minor_status, oid_str, oid);
|
|
Packit |
fd8b60 |
if (status != GSS_S_COMPLETE)
|
|
Packit |
fd8b60 |
map_errcode(minor_status);
|
|
Packit |
fd8b60 |
return status;
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
OM_uint32
|
|
Packit |
fd8b60 |
gssint_copy_oid_set(
|
|
Packit |
fd8b60 |
OM_uint32 *minor_status,
|
|
Packit |
fd8b60 |
const gss_OID_set_desc * const oidset,
|
|
Packit |
fd8b60 |
gss_OID_set *new_oidset)
|
|
Packit |
fd8b60 |
{
|
|
Packit |
fd8b60 |
return generic_gss_copy_oid_set(minor_status, oidset, new_oidset);
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
int KRB5_CALLCONV
|
|
Packit |
fd8b60 |
gss_oid_equal(
|
|
Packit |
fd8b60 |
gss_const_OID first_oid,
|
|
Packit |
fd8b60 |
gss_const_OID second_oid)
|
|
Packit |
fd8b60 |
{
|
|
Packit |
fd8b60 |
/* GSS_C_NO_OID doesn't match itself, per draft-josefsson-gss-capsulate. */
|
|
Packit |
fd8b60 |
if (first_oid == GSS_C_NO_OID || second_oid == GSS_C_NO_OID)
|
|
Packit |
fd8b60 |
return 0;
|
|
Packit |
fd8b60 |
return g_OID_equal(first_oid, second_oid);
|
|
Packit |
fd8b60 |
}
|