xref: /freebsd/sys/kgssapi/gss_names.c (revision d68cc5a8390f5316400181b77a195f734567abd3)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3  *
4  * Copyright (c) 2005 Doug Rabson
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26  * SUCH DAMAGE.
27  */
28 
29 #include <sys/cdefs.h>
30 __FBSDID("$FreeBSD$");
31 
32 #include <sys/param.h>
33 #include <kgssapi/gssapi.h>
34 
35 /*
36  * The implementation must reserve static storage for a
37  * gss_OID_desc object containing the value
38  * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
39  * "\x01\x02\x01\x01"},
40  * corresponding to an object-identifier value of
41  * {iso(1) member-body(2) United States(840) mit(113554)
42  * infosys(1) gssapi(2) generic(1) user_name(1)}.  The constant
43  * GSS_C_NT_USER_NAME should be initialized to point
44  * to that gss_OID_desc.
45  */
46 static gss_OID_desc GSS_C_NT_USER_NAME_storage =
47 	{10, (void *)(uintptr_t)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x01"};
48 gss_OID GSS_C_NT_USER_NAME = &GSS_C_NT_USER_NAME_storage;
49 
50 /*
51  * The implementation must reserve static storage for a
52  * gss_OID_desc object containing the value
53  * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
54  *              "\x01\x02\x01\x02"},
55  * corresponding to an object-identifier value of
56  * {iso(1) member-body(2) United States(840) mit(113554)
57  * infosys(1) gssapi(2) generic(1) machine_uid_name(2)}.
58  * The constant GSS_C_NT_MACHINE_UID_NAME should be
59  * initialized to point to that gss_OID_desc.
60  */
61 static gss_OID_desc GSS_C_NT_MACHINE_UID_NAME_storage =
62 	{10, (void *)(uintptr_t)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x02"};
63 gss_OID GSS_C_NT_MACHINE_UID_NAME = &GSS_C_NT_MACHINE_UID_NAME_storage;
64 
65 /*
66  * The implementation must reserve static storage for a
67  * gss_OID_desc object containing the value
68  * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
69  *              "\x01\x02\x01\x03"},
70  * corresponding to an object-identifier value of
71  * {iso(1) member-body(2) United States(840) mit(113554)
72  * infosys(1) gssapi(2) generic(1) string_uid_name(3)}.
73  * The constant GSS_C_NT_STRING_UID_NAME should be
74  * initialized to point to that gss_OID_desc.
75  */
76 static gss_OID_desc GSS_C_NT_STRING_UID_NAME_storage =
77 	{10, (void *)(uintptr_t)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x03"};
78 gss_OID GSS_C_NT_STRING_UID_NAME = &GSS_C_NT_STRING_UID_NAME_storage;
79 
80 /*
81  * The implementation must reserve static storage for a
82  * gss_OID_desc object containing the value
83  * {6, (void *)"\x2b\x06\x01\x05\x06\x02"},
84  * corresponding to an object-identifier value of
85  * {iso(1) org(3) dod(6) internet(1) security(5)
86  * nametypes(6) gss-host-based-services(2)).  The constant
87  * GSS_C_NT_HOSTBASED_SERVICE_X should be initialized to point
88  * to that gss_OID_desc.  This is a deprecated OID value, and
89  * implementations wishing to support hostbased-service names
90  * should instead use the GSS_C_NT_HOSTBASED_SERVICE OID,
91  * defined below, to identify such names;
92  * GSS_C_NT_HOSTBASED_SERVICE_X should be accepted a synonym
93  * for GSS_C_NT_HOSTBASED_SERVICE when presented as an input
94  * parameter, but should not be emitted by GSS-API
95  * implementations
96  */
97 static gss_OID_desc GSS_C_NT_HOSTBASED_SERVICE_X_storage =
98 	{6, (void *)(uintptr_t)"\x2b\x06\x01\x05\x06\x02"};
99 gss_OID GSS_C_NT_HOSTBASED_SERVICE_X = &GSS_C_NT_HOSTBASED_SERVICE_X_storage;
100 
101 /*
102  * The implementation must reserve static storage for a
103  * gss_OID_desc object containing the value
104  * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
105  *              "\x01\x02\x01\x04"}, corresponding to an
106  * object-identifier value of {iso(1) member-body(2)
107  * Unites States(840) mit(113554) infosys(1) gssapi(2)
108  * generic(1) service_name(4)}.  The constant
109  * GSS_C_NT_HOSTBASED_SERVICE should be initialized
110  * to point to that gss_OID_desc.
111  */
112 static gss_OID_desc GSS_C_NT_HOSTBASED_SERVICE_storage =
113 	{10, (void *)(uintptr_t)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x04"};
114 gss_OID GSS_C_NT_HOSTBASED_SERVICE = &GSS_C_NT_HOSTBASED_SERVICE_storage;
115 
116 /*
117  * The implementation must reserve static storage for a
118  * gss_OID_desc object containing the value
119  * {6, (void *)"\x2b\x06\01\x05\x06\x03"},
120  * corresponding to an object identifier value of
121  * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
122  * 6(nametypes), 3(gss-anonymous-name)}.  The constant
123  * and GSS_C_NT_ANONYMOUS should be initialized to point
124  * to that gss_OID_desc.
125  */
126 static gss_OID_desc GSS_C_NT_ANONYMOUS_storage =
127 	{6, (void *)(uintptr_t)"\x2b\x06\01\x05\x06\x03"};
128 gss_OID GSS_C_NT_ANONYMOUS = &GSS_C_NT_ANONYMOUS_storage;
129 
130 /*
131  * The implementation must reserve static storage for a
132  * gss_OID_desc object containing the value
133  * {6, (void *)"\x2b\x06\x01\x05\x06\x04"},
134  * corresponding to an object-identifier value of
135  * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
136  * 6(nametypes), 4(gss-api-exported-name)}.  The constant
137  * GSS_C_NT_EXPORT_NAME should be initialized to point
138  * to that gss_OID_desc.
139  */
140 static gss_OID_desc GSS_C_NT_EXPORT_NAME_storage =
141 	{6, (void *)(uintptr_t)"\x2b\x06\x01\x05\x06\x04"};
142 gss_OID GSS_C_NT_EXPORT_NAME = &GSS_C_NT_EXPORT_NAME_storage;
143 
144 /*
145  *   This name form shall be represented by the Object Identifier {iso(1)
146  *   member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
147  *   krb5(2) krb5_name(1)}.  The recommended symbolic name for this type
148  *   is "GSS_KRB5_NT_PRINCIPAL_NAME".
149  */
150 static gss_OID_desc GSS_KRB5_NT_PRINCIPAL_NAME_storage =
151         {10, (void *)(uintptr_t)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x02\x01"};
152 gss_OID GSS_KRB5_NT_PRINCIPAL_NAME = &GSS_KRB5_NT_PRINCIPAL_NAME_storage;
153 
154 /*
155  * This name form shall be represented by the Object Identifier {iso(1)
156  * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
157  * generic(1) user_name(1)}.  The recommended symbolic name for this
158  * type is "GSS_KRB5_NT_USER_NAME".
159  */
160 gss_OID GSS_KRB5_NT_USER_NAME = &GSS_C_NT_USER_NAME_storage;
161 
162 /*
163  * This name form shall be represented by the Object Identifier {iso(1)
164  * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
165  * generic(1) machine_uid_name(2)}.  The recommended symbolic name for
166  * this type is "GSS_KRB5_NT_MACHINE_UID_NAME".
167  */
168 gss_OID GSS_KRB5_NT_MACHINE_UID_NAME = &GSS_C_NT_MACHINE_UID_NAME_storage;
169 
170 /*
171  * This name form shall be represented by the Object Identifier {iso(1)
172  * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
173  * generic(1) string_uid_name(3)}.  The recommended symbolic name for
174  * this type is "GSS_KRB5_NT_STRING_UID_NAME".
175  */
176 gss_OID GSS_KRB5_NT_STRING_UID_NAME = &GSS_C_NT_STRING_UID_NAME_storage;
177