1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 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/param.h> 30 #include <kgssapi/gssapi.h> 31 32 /* 33 * The implementation must reserve static storage for a 34 * gss_OID_desc object containing the value 35 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12" 36 * "\x01\x02\x01\x01"}, 37 * corresponding to an object-identifier value of 38 * {iso(1) member-body(2) United States(840) mit(113554) 39 * infosys(1) gssapi(2) generic(1) user_name(1)}. The constant 40 * GSS_C_NT_USER_NAME should be initialized to point 41 * to that gss_OID_desc. 42 */ 43 static gss_OID_desc GSS_C_NT_USER_NAME_storage = 44 {10, (void *)(uintptr_t)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x01"}; 45 gss_OID GSS_C_NT_USER_NAME = &GSS_C_NT_USER_NAME_storage; 46 47 /* 48 * The implementation must reserve static storage for a 49 * gss_OID_desc object containing the value 50 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12" 51 * "\x01\x02\x01\x02"}, 52 * corresponding to an object-identifier value of 53 * {iso(1) member-body(2) United States(840) mit(113554) 54 * infosys(1) gssapi(2) generic(1) machine_uid_name(2)}. 55 * The constant GSS_C_NT_MACHINE_UID_NAME should be 56 * initialized to point to that gss_OID_desc. 57 */ 58 static gss_OID_desc GSS_C_NT_MACHINE_UID_NAME_storage = 59 {10, (void *)(uintptr_t)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x02"}; 60 gss_OID GSS_C_NT_MACHINE_UID_NAME = &GSS_C_NT_MACHINE_UID_NAME_storage; 61 62 /* 63 * The implementation must reserve static storage for a 64 * gss_OID_desc object containing the value 65 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12" 66 * "\x01\x02\x01\x03"}, 67 * corresponding to an object-identifier value of 68 * {iso(1) member-body(2) United States(840) mit(113554) 69 * infosys(1) gssapi(2) generic(1) string_uid_name(3)}. 70 * The constant GSS_C_NT_STRING_UID_NAME should be 71 * initialized to point to that gss_OID_desc. 72 */ 73 static gss_OID_desc GSS_C_NT_STRING_UID_NAME_storage = 74 {10, (void *)(uintptr_t)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x03"}; 75 gss_OID GSS_C_NT_STRING_UID_NAME = &GSS_C_NT_STRING_UID_NAME_storage; 76 77 /* 78 * The implementation must reserve static storage for a 79 * gss_OID_desc object containing the value 80 * {6, (void *)"\x2b\x06\x01\x05\x06\x02"}, 81 * corresponding to an object-identifier value of 82 * {iso(1) org(3) dod(6) internet(1) security(5) 83 * nametypes(6) gss-host-based-services(2)). The constant 84 * GSS_C_NT_HOSTBASED_SERVICE_X should be initialized to point 85 * to that gss_OID_desc. This is a deprecated OID value, and 86 * implementations wishing to support hostbased-service names 87 * should instead use the GSS_C_NT_HOSTBASED_SERVICE OID, 88 * defined below, to identify such names; 89 * GSS_C_NT_HOSTBASED_SERVICE_X should be accepted a synonym 90 * for GSS_C_NT_HOSTBASED_SERVICE when presented as an input 91 * parameter, but should not be emitted by GSS-API 92 * implementations 93 */ 94 static gss_OID_desc GSS_C_NT_HOSTBASED_SERVICE_X_storage = 95 {6, (void *)(uintptr_t)"\x2b\x06\x01\x05\x06\x02"}; 96 gss_OID GSS_C_NT_HOSTBASED_SERVICE_X = &GSS_C_NT_HOSTBASED_SERVICE_X_storage; 97 98 /* 99 * The implementation must reserve static storage for a 100 * gss_OID_desc object containing the value 101 * {10, (void *)"\x2a\x86\x48\x86\xf7\x12" 102 * "\x01\x02\x01\x04"}, corresponding to an 103 * object-identifier value of {iso(1) member-body(2) 104 * Unites States(840) mit(113554) infosys(1) gssapi(2) 105 * generic(1) service_name(4)}. The constant 106 * GSS_C_NT_HOSTBASED_SERVICE should be initialized 107 * to point to that gss_OID_desc. 108 */ 109 static gss_OID_desc GSS_C_NT_HOSTBASED_SERVICE_storage = 110 {10, (void *)(uintptr_t)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x04"}; 111 gss_OID GSS_C_NT_HOSTBASED_SERVICE = &GSS_C_NT_HOSTBASED_SERVICE_storage; 112 113 /* 114 * The implementation must reserve static storage for a 115 * gss_OID_desc object containing the value 116 * {6, (void *)"\x2b\x06\01\x05\x06\x03"}, 117 * corresponding to an object identifier value of 118 * {1(iso), 3(org), 6(dod), 1(internet), 5(security), 119 * 6(nametypes), 3(gss-anonymous-name)}. The constant 120 * and GSS_C_NT_ANONYMOUS should be initialized to point 121 * to that gss_OID_desc. 122 */ 123 static gss_OID_desc GSS_C_NT_ANONYMOUS_storage = 124 {6, (void *)(uintptr_t)"\x2b\x06\01\x05\x06\x03"}; 125 gss_OID GSS_C_NT_ANONYMOUS = &GSS_C_NT_ANONYMOUS_storage; 126 127 /* 128 * The implementation must reserve static storage for a 129 * gss_OID_desc object containing the value 130 * {6, (void *)"\x2b\x06\x01\x05\x06\x04"}, 131 * corresponding to an object-identifier value of 132 * {1(iso), 3(org), 6(dod), 1(internet), 5(security), 133 * 6(nametypes), 4(gss-api-exported-name)}. The constant 134 * GSS_C_NT_EXPORT_NAME should be initialized to point 135 * to that gss_OID_desc. 136 */ 137 static gss_OID_desc GSS_C_NT_EXPORT_NAME_storage = 138 {6, (void *)(uintptr_t)"\x2b\x06\x01\x05\x06\x04"}; 139 gss_OID GSS_C_NT_EXPORT_NAME = &GSS_C_NT_EXPORT_NAME_storage; 140 141 /* 142 * This name form shall be represented by the Object Identifier {iso(1) 143 * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2) 144 * krb5(2) krb5_name(1)}. The recommended symbolic name for this type 145 * is "GSS_KRB5_NT_PRINCIPAL_NAME". 146 */ 147 static gss_OID_desc GSS_KRB5_NT_PRINCIPAL_NAME_storage = 148 {10, (void *)(uintptr_t)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x02\x01"}; 149 gss_OID GSS_KRB5_NT_PRINCIPAL_NAME = &GSS_KRB5_NT_PRINCIPAL_NAME_storage; 150 151 /* 152 * This name form shall be represented by the Object Identifier {iso(1) 153 * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2) 154 * generic(1) user_name(1)}. The recommended symbolic name for this 155 * type is "GSS_KRB5_NT_USER_NAME". 156 */ 157 gss_OID GSS_KRB5_NT_USER_NAME = &GSS_C_NT_USER_NAME_storage; 158 159 /* 160 * This name form shall be represented by the Object Identifier {iso(1) 161 * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2) 162 * generic(1) machine_uid_name(2)}. The recommended symbolic name for 163 * this type is "GSS_KRB5_NT_MACHINE_UID_NAME". 164 */ 165 gss_OID GSS_KRB5_NT_MACHINE_UID_NAME = &GSS_C_NT_MACHINE_UID_NAME_storage; 166 167 /* 168 * This name form shall be represented by the Object Identifier {iso(1) 169 * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2) 170 * generic(1) string_uid_name(3)}. The recommended symbolic name for 171 * this type is "GSS_KRB5_NT_STRING_UID_NAME". 172 */ 173 gss_OID GSS_KRB5_NT_STRING_UID_NAME = &GSS_C_NT_STRING_UID_NAME_storage; 174