xref: /freebsd/kerberos5/lib/libgssapi_spnego/freebsd_compat.c (revision 1de7b4b805ddbf2429da511c053686ac4591ed89)
1ae771770SStanislav Sedov /*-
2*1de7b4b8SPedro F. Giffuni  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3*1de7b4b8SPedro F. Giffuni  *
4ae771770SStanislav Sedov  * Copyright (c) 2008 Doug Rabson
5ae771770SStanislav Sedov  * All rights reserved.
6ae771770SStanislav Sedov  *
7ae771770SStanislav Sedov  * Redistribution and use in source and binary forms, with or without
8ae771770SStanislav Sedov  * modification, are permitted provided that the following conditions
9ae771770SStanislav Sedov  * are met:
10ae771770SStanislav Sedov  * 1. Redistributions of source code must retain the above copyright
11ae771770SStanislav Sedov  *    notice, this list of conditions and the following disclaimer.
12ae771770SStanislav Sedov  * 2. Redistributions in binary form must reproduce the above copyright
13ae771770SStanislav Sedov  *    notice, this list of conditions and the following disclaimer in the
14ae771770SStanislav Sedov  *    documentation and/or other materials provided with the distribution.
15ae771770SStanislav Sedov  *
16ae771770SStanislav Sedov  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17ae771770SStanislav Sedov  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18ae771770SStanislav Sedov  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19ae771770SStanislav Sedov  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20ae771770SStanislav Sedov  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21ae771770SStanislav Sedov  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22ae771770SStanislav Sedov  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23ae771770SStanislav Sedov  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24ae771770SStanislav Sedov  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25ae771770SStanislav Sedov  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26ae771770SStanislav Sedov  * SUCH DAMAGE.
27ae771770SStanislav Sedov  *
28ae771770SStanislav Sedov  * $FreeBSD$
29ae771770SStanislav Sedov  */
30ae771770SStanislav Sedov 
31ae771770SStanislav Sedov #include <gssapi/gssapi.h>
32ae771770SStanislav Sedov #include <mech_switch.h>
33ae771770SStanislav Sedov 
34ae771770SStanislav Sedov gss_OID_desc __gss_c_nt_hostbased_service_oid_desc =
35ae771770SStanislav Sedov     {10, (void *)("\x2a\x86\x48\x86\xf7\x12" "\x01\x02\x01\x04")};
36ae771770SStanislav Sedov 
37ae771770SStanislav Sedov const char *
38ae771770SStanislav Sedov _gss_name_prefix(void)
39ae771770SStanislav Sedov {
40ae771770SStanislav Sedov 	return "_gss_spnego";
41ae771770SStanislav Sedov }
42ae771770SStanislav Sedov 
43ae771770SStanislav Sedov void
44ae771770SStanislav Sedov gss_mg_collect_error(gss_OID mech, OM_uint32 maj, OM_uint32 min)
45ae771770SStanislav Sedov {
46ae771770SStanislav Sedov 	_gss_mg_collect_error(mech, maj, min);
47ae771770SStanislav Sedov }
48ae771770SStanislav Sedov 
49ae771770SStanislav Sedov OM_uint32 _gss_spnego_display_status
50ae771770SStanislav Sedov            (OM_uint32 * minor_status,
51ae771770SStanislav Sedov             OM_uint32 status_value,
52ae771770SStanislav Sedov             int status_type,
53ae771770SStanislav Sedov             const gss_OID mech_type,
54ae771770SStanislav Sedov             OM_uint32 * message_context,
55ae771770SStanislav Sedov             gss_buffer_t status_string
56ae771770SStanislav Sedov            )
57ae771770SStanislav Sedov {
58ae771770SStanislav Sedov     return GSS_S_FAILURE;
59ae771770SStanislav Sedov }
60ae771770SStanislav Sedov 
61ae771770SStanislav Sedov OM_uint32 _gss_spnego_add_cred (
62ae771770SStanislav Sedov             OM_uint32 * minor_status,
63ae771770SStanislav Sedov             const gss_cred_id_t input_cred_handle,
64ae771770SStanislav Sedov             const gss_name_t desired_name,
65ae771770SStanislav Sedov             const gss_OID desired_mech,
66ae771770SStanislav Sedov             gss_cred_usage_t cred_usage,
67ae771770SStanislav Sedov             OM_uint32 initiator_time_req,
68ae771770SStanislav Sedov             OM_uint32 acceptor_time_req,
69ae771770SStanislav Sedov             gss_cred_id_t * output_cred_handle,
70ae771770SStanislav Sedov             gss_OID_set * actual_mechs,
71ae771770SStanislav Sedov             OM_uint32 * initiator_time_rec,
72ae771770SStanislav Sedov             OM_uint32 * acceptor_time_rec
73ae771770SStanislav Sedov            )
74ae771770SStanislav Sedov {
75ae771770SStanislav Sedov 	return gss_add_cred(minor_status,
76ae771770SStanislav Sedov                        input_cred_handle,
77ae771770SStanislav Sedov                        desired_name,
78ae771770SStanislav Sedov                        desired_mech,
79ae771770SStanislav Sedov                        cred_usage,
80ae771770SStanislav Sedov                        initiator_time_req,
81ae771770SStanislav Sedov                        acceptor_time_req,
82ae771770SStanislav Sedov                        output_cred_handle,
83ae771770SStanislav Sedov                        actual_mechs,
84ae771770SStanislav Sedov                        initiator_time_rec,
85ae771770SStanislav Sedov                        acceptor_time_rec);
86ae771770SStanislav Sedov }
87