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