xref: /illumos-gate/usr/src/lib/libgss/g_oid_ops.c (revision 7c478bd95313f5f23a4c958a745db2134aa0324)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * Copyright (c) 1996,1997, by Sun Microsystems, Inc.
3*7c478bd9Sstevel@tonic-gate  * All rights reserved.
4*7c478bd9Sstevel@tonic-gate  */
5*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
6*7c478bd9Sstevel@tonic-gate /*
7*7c478bd9Sstevel@tonic-gate  * lib/gssapi/mechglue/g_oid_ops.c
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * Copyright 1995 by the Massachusetts Institute of Technology.
10*7c478bd9Sstevel@tonic-gate  * All Rights Reserved.
11*7c478bd9Sstevel@tonic-gate  *
12*7c478bd9Sstevel@tonic-gate  * Export of this software from the United States of America may
13*7c478bd9Sstevel@tonic-gate  *   require a specific license from the United States Government.
14*7c478bd9Sstevel@tonic-gate  *   It is the responsibility of any person or organization contemplating
15*7c478bd9Sstevel@tonic-gate  *   export to obtain such a license before exporting.
16*7c478bd9Sstevel@tonic-gate  *
17*7c478bd9Sstevel@tonic-gate  * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
18*7c478bd9Sstevel@tonic-gate  * distribute this software and its documentation for any purpose and
19*7c478bd9Sstevel@tonic-gate  * without fee is hereby granted, provided that the above copyright
20*7c478bd9Sstevel@tonic-gate  * notice appear in all copies and that both that copyright notice and
21*7c478bd9Sstevel@tonic-gate  * this permission notice appear in supporting documentation, and that
22*7c478bd9Sstevel@tonic-gate  * the name of M.I.T. not be used in advertising or publicity pertaining
23*7c478bd9Sstevel@tonic-gate  * to distribution of the software without specific, written prior
24*7c478bd9Sstevel@tonic-gate  * permission.  M.I.T. makes no representations about the suitability of
25*7c478bd9Sstevel@tonic-gate  * this software for any purpose.  It is provided "as is" without express
26*7c478bd9Sstevel@tonic-gate  * or implied warranty.
27*7c478bd9Sstevel@tonic-gate  *
28*7c478bd9Sstevel@tonic-gate  */
29*7c478bd9Sstevel@tonic-gate 
30*7c478bd9Sstevel@tonic-gate /*
31*7c478bd9Sstevel@tonic-gate  * oid_ops.c - GSS-API V2 interfaces to manipulate OIDs
32*7c478bd9Sstevel@tonic-gate  */
33*7c478bd9Sstevel@tonic-gate 
34*7c478bd9Sstevel@tonic-gate #include <mechglueP.h>
35*7c478bd9Sstevel@tonic-gate 
36*7c478bd9Sstevel@tonic-gate /*
37*7c478bd9Sstevel@tonic-gate  * gss_release_oid has been moved to g_initialize, becasue it requires access
38*7c478bd9Sstevel@tonic-gate  * to the mechanism list.  All functions requiring direct access to the
39*7c478bd9Sstevel@tonic-gate  * mechanism list are now in g_initialize.c
40*7c478bd9Sstevel@tonic-gate  */
41*7c478bd9Sstevel@tonic-gate 
42*7c478bd9Sstevel@tonic-gate OM_uint32
43*7c478bd9Sstevel@tonic-gate gss_create_empty_oid_set(minor_status, oid_set)
44*7c478bd9Sstevel@tonic-gate 	OM_uint32		*minor_status;
45*7c478bd9Sstevel@tonic-gate 	gss_OID_set		*oid_set;
46*7c478bd9Sstevel@tonic-gate {
47*7c478bd9Sstevel@tonic-gate 		return (generic_gss_create_empty_oid_set(minor_status,
48*7c478bd9Sstevel@tonic-gate 				oid_set));
49*7c478bd9Sstevel@tonic-gate }
50*7c478bd9Sstevel@tonic-gate 
51*7c478bd9Sstevel@tonic-gate OM_uint32
52*7c478bd9Sstevel@tonic-gate gss_add_oid_set_member(minor_status, member_oid, oid_set)
53*7c478bd9Sstevel@tonic-gate 	OM_uint32		*minor_status;
54*7c478bd9Sstevel@tonic-gate 	const gss_OID		member_oid;
55*7c478bd9Sstevel@tonic-gate 	gss_OID_set		*oid_set;
56*7c478bd9Sstevel@tonic-gate {
57*7c478bd9Sstevel@tonic-gate 	return (generic_gss_add_oid_set_member(minor_status, member_oid,
58*7c478bd9Sstevel@tonic-gate 				oid_set));
59*7c478bd9Sstevel@tonic-gate }
60*7c478bd9Sstevel@tonic-gate 
61*7c478bd9Sstevel@tonic-gate OM_uint32
62*7c478bd9Sstevel@tonic-gate gss_test_oid_set_member(minor_status, member, set, present)
63*7c478bd9Sstevel@tonic-gate 	OM_uint32		*minor_status;
64*7c478bd9Sstevel@tonic-gate 	const gss_OID		member;
65*7c478bd9Sstevel@tonic-gate 	const gss_OID_set	set;
66*7c478bd9Sstevel@tonic-gate 	int			*present;
67*7c478bd9Sstevel@tonic-gate {
68*7c478bd9Sstevel@tonic-gate 	return (generic_gss_test_oid_set_member(minor_status, member, set,
69*7c478bd9Sstevel@tonic-gate 				present));
70*7c478bd9Sstevel@tonic-gate }
71*7c478bd9Sstevel@tonic-gate 
72*7c478bd9Sstevel@tonic-gate OM_uint32
73*7c478bd9Sstevel@tonic-gate gss_oid_to_str(minor_status, oid, oid_str)
74*7c478bd9Sstevel@tonic-gate 	OM_uint32		*minor_status;
75*7c478bd9Sstevel@tonic-gate 	const gss_OID		oid;
76*7c478bd9Sstevel@tonic-gate 	gss_buffer_t		oid_str;
77*7c478bd9Sstevel@tonic-gate {
78*7c478bd9Sstevel@tonic-gate 	return (generic_gss_oid_to_str(minor_status, oid, oid_str));
79*7c478bd9Sstevel@tonic-gate }
80*7c478bd9Sstevel@tonic-gate 
81*7c478bd9Sstevel@tonic-gate OM_uint32
82*7c478bd9Sstevel@tonic-gate gss_str_to_oid(minor_status, oid_str, oid)
83*7c478bd9Sstevel@tonic-gate 	OM_uint32		*minor_status;
84*7c478bd9Sstevel@tonic-gate 	const gss_buffer_t	oid_str;
85*7c478bd9Sstevel@tonic-gate 	gss_OID			*oid;
86*7c478bd9Sstevel@tonic-gate {
87*7c478bd9Sstevel@tonic-gate 	return (generic_gss_str_to_oid(minor_status, oid_str, oid));
88*7c478bd9Sstevel@tonic-gate }
89