17c478bdstevel@tonic-gate/*
25e01956Glenn Barry * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
37c478bdstevel@tonic-gate */
47c478bdstevel@tonic-gate/*
57c478bdstevel@tonic-gate * lib/gssapi/mechglue/g_oid_ops.c
67c478bdstevel@tonic-gate *
77c478bdstevel@tonic-gate * Copyright 1995 by the Massachusetts Institute of Technology.
87c478bdstevel@tonic-gate * All Rights Reserved.
97c478bdstevel@tonic-gate *
107c478bdstevel@tonic-gate * Export of this software from the United States of America may
117c478bdstevel@tonic-gate *   require a specific license from the United States Government.
127c478bdstevel@tonic-gate *   It is the responsibility of any person or organization contemplating
137c478bdstevel@tonic-gate *   export to obtain such a license before exporting.
147c478bdstevel@tonic-gate *
157c478bdstevel@tonic-gate * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
167c478bdstevel@tonic-gate * distribute this software and its documentation for any purpose and
177c478bdstevel@tonic-gate * without fee is hereby granted, provided that the above copyright
187c478bdstevel@tonic-gate * notice appear in all copies and that both that copyright notice and
197c478bdstevel@tonic-gate * this permission notice appear in supporting documentation, and that
207c478bdstevel@tonic-gate * the name of M.I.T. not be used in advertising or publicity pertaining
217c478bdstevel@tonic-gate * to distribution of the software without specific, written prior
227c478bdstevel@tonic-gate * permission.  M.I.T. makes no representations about the suitability of
237c478bdstevel@tonic-gate * this software for any purpose.  It is provided "as is" without express
247c478bdstevel@tonic-gate * or implied warranty.
257c478bdstevel@tonic-gate *
267c478bdstevel@tonic-gate */
277c478bdstevel@tonic-gate
287c478bdstevel@tonic-gate/*
297c478bdstevel@tonic-gate * oid_ops.c - GSS-API V2 interfaces to manipulate OIDs
307c478bdstevel@tonic-gate */
317c478bdstevel@tonic-gate
327c478bdstevel@tonic-gate#include <mechglueP.h>
335e01956Glenn Barry#include "gssapiP_generic.h"
347c478bdstevel@tonic-gate
357c478bdstevel@tonic-gate/*
367c478bdstevel@tonic-gate * gss_release_oid has been moved to g_initialize, becasue it requires access
377c478bdstevel@tonic-gate * to the mechanism list.  All functions requiring direct access to the
387c478bdstevel@tonic-gate * mechanism list are now in g_initialize.c
397c478bdstevel@tonic-gate */
407c478bdstevel@tonic-gate
417c478bdstevel@tonic-gateOM_uint32
427c478bdstevel@tonic-gategss_create_empty_oid_set(minor_status, oid_set)
437c478bdstevel@tonic-gate	OM_uint32		*minor_status;
447c478bdstevel@tonic-gate	gss_OID_set		*oid_set;
457c478bdstevel@tonic-gate{
465e01956Glenn Barry	OM_uint32 status;
475e01956Glenn Barry	status = generic_gss_create_empty_oid_set(minor_status, oid_set);
485e01956Glenn Barry	if (status != GSS_S_COMPLETE)
495e01956Glenn Barry		map_errcode(minor_status);
505e01956Glenn Barry	return status;
517c478bdstevel@tonic-gate}
527c478bdstevel@tonic-gate
537c478bdstevel@tonic-gateOM_uint32
547c478bdstevel@tonic-gategss_add_oid_set_member(minor_status, member_oid, oid_set)
557c478bdstevel@tonic-gate	OM_uint32		*minor_status;
567c478bdstevel@tonic-gate	const gss_OID		member_oid;
577c478bdstevel@tonic-gate	gss_OID_set		*oid_set;
587c478bdstevel@tonic-gate{
595e01956Glenn Barry	OM_uint32 status;
605e01956Glenn Barry	status = generic_gss_add_oid_set_member(minor_status, member_oid,
615e01956Glenn Barry						oid_set);
625e01956Glenn Barry	if (status != GSS_S_COMPLETE)
635e01956Glenn Barry		map_errcode(minor_status);
645e01956Glenn Barry	return status;
657c478bdstevel@tonic-gate}
667c478bdstevel@tonic-gate
677c478bdstevel@tonic-gateOM_uint32
687c478bdstevel@tonic-gategss_test_oid_set_member(minor_status, member, set, present)
697c478bdstevel@tonic-gate	OM_uint32		*minor_status;
707c478bdstevel@tonic-gate	const gss_OID		member;
717c478bdstevel@tonic-gate	const gss_OID_set	set;
727c478bdstevel@tonic-gate	int			*present;
737c478bdstevel@tonic-gate{
747c478bdstevel@tonic-gate	return (generic_gss_test_oid_set_member(minor_status, member, set,
757c478bdstevel@tonic-gate				present));
767c478bdstevel@tonic-gate}
777c478bdstevel@tonic-gate
787c478bdstevel@tonic-gateOM_uint32
797c478bdstevel@tonic-gategss_oid_to_str(minor_status, oid, oid_str)
807c478bdstevel@tonic-gate	OM_uint32		*minor_status;
817c478bdstevel@tonic-gate	const gss_OID		oid;
827c478bdstevel@tonic-gate	gss_buffer_t		oid_str;
837c478bdstevel@tonic-gate{
845e01956Glenn Barry	OM_uint32 status = generic_gss_oid_to_str(minor_status, oid, oid_str);
855e01956Glenn Barry	if (status != GSS_S_COMPLETE)
865e01956Glenn Barry		map_errcode(minor_status);
875e01956Glenn Barry	return status;
887c478bdstevel@tonic-gate}
897c478bdstevel@tonic-gate
907c478bdstevel@tonic-gateOM_uint32
917c478bdstevel@tonic-gategss_str_to_oid(minor_status, oid_str, oid)
927c478bdstevel@tonic-gate	OM_uint32		*minor_status;
937c478bdstevel@tonic-gate	const gss_buffer_t	oid_str;
947c478bdstevel@tonic-gate	gss_OID			*oid;
957c478bdstevel@tonic-gate{
965e01956Glenn Barry	OM_uint32 status = generic_gss_str_to_oid(minor_status, oid_str, oid);
975e01956Glenn Barry	if (status != GSS_S_COMPLETE)
985e01956Glenn Barry		map_errcode(minor_status);
995e01956Glenn Barry	return status;
1007c478bdstevel@tonic-gate}
101