17c478bd9Sstevel@tonic-gate /* 2*ba7b222eSGlenn Barry * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 37c478bd9Sstevel@tonic-gate * Use is subject to license terms. 47c478bd9Sstevel@tonic-gate */ 57c478bd9Sstevel@tonic-gate 67c478bd9Sstevel@tonic-gate /* 77c478bd9Sstevel@tonic-gate * Copyright 1993 by OpenVision Technologies, Inc. 87c478bd9Sstevel@tonic-gate * 97c478bd9Sstevel@tonic-gate * Permission to use, copy, modify, distribute, and sell this software 107c478bd9Sstevel@tonic-gate * and its documentation for any purpose is hereby granted without fee, 117c478bd9Sstevel@tonic-gate * provided that the above copyright notice appears in all copies and 127c478bd9Sstevel@tonic-gate * that both that copyright notice and this permission notice appear in 137c478bd9Sstevel@tonic-gate * supporting documentation, and that the name of OpenVision not be used 147c478bd9Sstevel@tonic-gate * in advertising or publicity pertaining to distribution of the software 157c478bd9Sstevel@tonic-gate * without specific, written prior permission. OpenVision makes no 167c478bd9Sstevel@tonic-gate * representations about the suitability of this software for any 177c478bd9Sstevel@tonic-gate * purpose. It is provided "as is" without express or implied warranty. 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 207c478bd9Sstevel@tonic-gate * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 217c478bd9Sstevel@tonic-gate * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR 227c478bd9Sstevel@tonic-gate * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF 237c478bd9Sstevel@tonic-gate * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 247c478bd9Sstevel@tonic-gate * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 257c478bd9Sstevel@tonic-gate * PERFORMANCE OF THIS SOFTWARE. 267c478bd9Sstevel@tonic-gate */ 277c478bd9Sstevel@tonic-gate 287c478bd9Sstevel@tonic-gate #include <mechglueP.h> 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gate /* 317c478bd9Sstevel@tonic-gate * See krb5/gssapi_krb5.c for a description of the algorithm for 327c478bd9Sstevel@tonic-gate * encoding an object identifier. 337c478bd9Sstevel@tonic-gate */ 347c478bd9Sstevel@tonic-gate 357c478bd9Sstevel@tonic-gate /* 367c478bd9Sstevel@tonic-gate * The OID of user_name is(gss_nt_user_name, GSS_C_NT_USER_NAME): 377c478bd9Sstevel@tonic-gate * iso(1) member-body(2) US(840) mit(113554) infosys(1) gssapi(2) 387c478bd9Sstevel@tonic-gate * generic(1) user_name(1) = 1.2.840.113554.1.2.1.1 397c478bd9Sstevel@tonic-gate * machine_uid_name(gss_nt_machine_uid_name, GSS_C_NT_MACHINE_UID_NAME): 407c478bd9Sstevel@tonic-gate * iso(1) member-body(2) US(840) mit(113554) infosys(1) gssapi(2) 417c478bd9Sstevel@tonic-gate * generic(1) machine_uid_name(2) = 1.2.840.113554.1.2.1.2 427c478bd9Sstevel@tonic-gate * string_uid_name(gss_nt_string_uid_name,GSS_C_NT_STRING_UID_NAME): 437c478bd9Sstevel@tonic-gate * iso(1) member-body(2) US(840) mit(113554) infosys(1) gssapi(2) 447c478bd9Sstevel@tonic-gate * generic(1) string_uid_name(3) = 1.2.840.113554.1.2.1.3 457c478bd9Sstevel@tonic-gate * service_name(gss_nt_service_name): 467c478bd9Sstevel@tonic-gate * iso(1) member-body(2) US(840) mit(113554) infosys(1) gssapi(2) 477c478bd9Sstevel@tonic-gate * generic(1) service_name(4) = 1.2.840.113554.1.2.1.4 487c478bd9Sstevel@tonic-gate * hostbased_service_name(GSS_C_NT_HOSTBASED_SERVICE) 497c478bd9Sstevel@tonic-gate * iso(1) org(3) dod(6) 1(internet) 5(security) 6(nametypes) 507c478bd9Sstevel@tonic-gate * 2(gss-host-based-services) == 1.3.6.1.5.6.2 517c478bd9Sstevel@tonic-gate * anonymous_name(GSS_C_NT_ANONYMOUS) 527c478bd9Sstevel@tonic-gate * iso(1) org(3) dod(6) 1(internet) 5(security) 6(nametypes) 537c478bd9Sstevel@tonic-gate * 3(anonymous) = 1.3.6.1.5.6.3 547c478bd9Sstevel@tonic-gate * export_name(GSS_C_NT_EXPORT) 557c478bd9Sstevel@tonic-gate * iso(1) org(3) dod(6) 1(internet) 5(security) 6(nametypes) 567c478bd9Sstevel@tonic-gate * 4(export) = 1.3.6.1.5.6.4 577c478bd9Sstevel@tonic-gate */ 587c478bd9Sstevel@tonic-gate 597c478bd9Sstevel@tonic-gate static const gss_OID_desc oids[] = { 607c478bd9Sstevel@tonic-gate {10, "\052\206\110\206\367\022\001\002\001\001"}, 617c478bd9Sstevel@tonic-gate {10, "\052\206\110\206\367\022\001\002\001\002"}, 627c478bd9Sstevel@tonic-gate {10, "\052\206\110\206\367\022\001\002\001\003"}, 637c478bd9Sstevel@tonic-gate {10, "\052\206\110\206\367\022\001\002\001\004"}, 647c478bd9Sstevel@tonic-gate {6, "\053\006\001\005\006\002"}, 657c478bd9Sstevel@tonic-gate {6, "\053\006\001\005\006\003"}, 667c478bd9Sstevel@tonic-gate {6, "\053\006\001\005\006\004"}, 67*ba7b222eSGlenn Barry {11, "\x2a\x86\x48\x86\xf7\x12\x01\x02\x02\x05\x05"}, 68*ba7b222eSGlenn Barry 697c478bd9Sstevel@tonic-gate }; 707c478bd9Sstevel@tonic-gate 717c478bd9Sstevel@tonic-gate const gss_OID_desc * const gss_nt_user_name = oids+0; 727c478bd9Sstevel@tonic-gate const gss_OID_desc * const gss_nt_machine_uid_name = oids+1; 737c478bd9Sstevel@tonic-gate const gss_OID_desc * const gss_nt_string_uid_name = oids+2; 747c478bd9Sstevel@tonic-gate const gss_OID_desc * const gss_nt_service_name = oids+3; 757c478bd9Sstevel@tonic-gate /* XXXXX These are needed for Kerberos */ 767c478bd9Sstevel@tonic-gate const gss_OID_desc * const gss_nt_service_name_v2 = oids+4; 777c478bd9Sstevel@tonic-gate const gss_OID_desc * const gss_nt_exported_name = oids+6; 787c478bd9Sstevel@tonic-gate 797c478bd9Sstevel@tonic-gate 807c478bd9Sstevel@tonic-gate /* 817c478bd9Sstevel@tonic-gate * These are added to reflect definitions in the 827c478bd9Sstevel@tonic-gate * gss c-bindings spec. 837c478bd9Sstevel@tonic-gate */ 847c478bd9Sstevel@tonic-gate 857c478bd9Sstevel@tonic-gate /* 867c478bd9Sstevel@tonic-gate * The use of the following defines are preferred over the above defines. 877c478bd9Sstevel@tonic-gate * This is because the following are the only ones defined 887c478bd9Sstevel@tonic-gate * in GSS-API Specs. 897c478bd9Sstevel@tonic-gate */ 907c478bd9Sstevel@tonic-gate const gss_OID GSS_C_NT_USER_NAME = (gss_OID)oids+0; 917c478bd9Sstevel@tonic-gate const gss_OID GSS_C_NT_MACHINE_UID_NAME = (gss_OID)oids+1; 927c478bd9Sstevel@tonic-gate const gss_OID GSS_C_NT_STRING_UID_NAME = (gss_OID)oids+2; 937c478bd9Sstevel@tonic-gate const gss_OID GSS_C_NT_HOSTBASED_SERVICE = (gss_OID)oids+4; 947c478bd9Sstevel@tonic-gate const gss_OID GSS_C_NT_ANONYMOUS = (gss_OID)oids+5; 957c478bd9Sstevel@tonic-gate const gss_OID GSS_C_NT_EXPORT_NAME = (gss_OID)oids+6; 96*ba7b222eSGlenn Barry const gss_OID GSS_C_INQ_SSPI_SESSION_KEY = (gss_OID)oids+7; 97