pull up r24469, r24530, r24533, r24534, r24535, r24537 from trunk
[krb5.git] / src / lib / gssapi / mechglue / g_oid_ops.c
1 /* #pragma ident        "@(#)g_oid_ops.c        1.11    98/01/22 SMI" */
2 /*
3  * lib/gssapi/mechglue/g_oid_ops.c
4  *
5  * Copyright 1995, 2007 by the Massachusetts Institute of Technology.
6  * All Rights Reserved.
7  *
8  * Export of this software from the United States of America may
9  *   require a specific license from the United States Government.
10  *   It is the responsibility of any person or organization contemplating
11  *   export to obtain such a license before exporting.
12  *
13  * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
14  * distribute this software and its documentation for any purpose and
15  * without fee is hereby granted, provided that the above copyright
16  * notice appear in all copies and that both that copyright notice and
17  * this permission notice appear in supporting documentation, and that
18  * the name of M.I.T. not be used in advertising or publicity pertaining
19  * to distribution of the software without specific, written prior
20  * permission.  Furthermore if you modify this software you must label
21  * your software as modified software and not distribute it in such a
22  * fashion that it might be confused with the original M.I.T. software.
23  * M.I.T. makes no representations about the suitability of
24  * this software for any purpose.  It is provided "as is" without express
25  * or implied warranty.
26  *
27  */
28
29 /*
30  * oid_ops.c - GSS-API V2 interfaces to manipulate OIDs
31  */
32
33 #include "mglueP.h"
34 /* should include to get protos #include "../generic/gssapiP_generic.h" */
35
36 extern gss_mechanism *gssint_mechs_array;
37
38 /*
39  * gss_release_oid has been moved to g_initialize, becasue it requires access
40  * to the mechanism list.  All functions requiring direct access to the
41  * mechanism list are now in g_initialize.c
42  */
43
44 OM_uint32 KRB5_CALLCONV
45 gss_create_empty_oid_set(minor_status, oid_set)
46     OM_uint32   *minor_status;
47     gss_OID_set *oid_set;
48 {
49     OM_uint32 status;
50     status = generic_gss_create_empty_oid_set(minor_status, oid_set);
51     if (status != GSS_S_COMPLETE)
52         map_errcode(minor_status);
53     return status;
54 }
55
56 OM_uint32 KRB5_CALLCONV
57 gss_add_oid_set_member(minor_status, member_oid, oid_set)
58     OM_uint32   *minor_status;
59     gss_OID     member_oid;
60     gss_OID_set *oid_set;
61 {
62     OM_uint32 status;
63     status = generic_gss_add_oid_set_member(minor_status, member_oid, oid_set);
64     if (status != GSS_S_COMPLETE)
65         map_errcode(minor_status);
66     return status;
67 }
68
69 OM_uint32 KRB5_CALLCONV
70 gss_test_oid_set_member(minor_status, member, set, present)
71     OM_uint32   *minor_status;
72     gss_OID     member;
73     gss_OID_set set;
74     int         *present;
75 {
76     return generic_gss_test_oid_set_member(minor_status, member, set, present);
77 }
78
79 OM_uint32 KRB5_CALLCONV
80 gss_oid_to_str(minor_status, oid, oid_str)
81     OM_uint32           *minor_status;
82     gss_OID             oid;
83     gss_buffer_t        oid_str;
84 {
85     OM_uint32 status = generic_gss_oid_to_str(minor_status, oid, oid_str);
86     if (status != GSS_S_COMPLETE)
87         map_errcode(minor_status);
88     return status;
89 }
90
91 OM_uint32 KRB5_CALLCONV
92 gss_str_to_oid(minor_status, oid_str, oid)
93     OM_uint32           *minor_status;
94     gss_buffer_t        oid_str;
95     gss_OID             *oid;
96 {
97     OM_uint32 status = generic_gss_str_to_oid(minor_status, oid_str, oid);
98     if (status != GSS_S_COMPLETE)
99         map_errcode(minor_status);
100     return status;
101 }
102
103 OM_uint32
104 gssint_copy_oid_set(
105     OM_uint32 *minor_status,
106     const gss_OID_set_desc * const oidset,
107     gss_OID_set *new_oidset)
108 {
109     return generic_gss_copy_oid_set(minor_status, oidset, new_oidset);
110 }