xref: /freebsd/crypto/heimdal/lib/gssapi/spnego/external.c (revision 39beb93c3f8bdbf72a61fda42300b5ebed7390c8)
1 /*
2  * Copyright (c) 2004, PADL Software Pty Ltd.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  *
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  * 3. Neither the name of PADL Software nor the names of its contributors
17  *    may be used to endorse or promote products derived from this software
18  *    without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY PADL SOFTWARE AND CONTRIBUTORS ``AS IS'' AND
21  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED.  IN NO EVENT SHALL PADL SOFTWARE OR CONTRIBUTORS BE LIABLE
24  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30  * SUCH DAMAGE.
31  */
32 
33 #include "spnego/spnego_locl.h"
34 #include <gssapi_mech.h>
35 
36 RCSID("$Id: external.c 18336 2006-10-07 22:27:13Z lha $");
37 
38 /*
39  * RFC2478, SPNEGO:
40  *  The security mechanism of the initial
41  *  negotiation token is identified by the Object Identifier
42  *  iso.org.dod.internet.security.mechanism.snego (1.3.6.1.5.5.2).
43  */
44 
45 static gssapi_mech_interface_desc spnego_mech = {
46     GMI_VERSION,
47     "spnego",
48     {6, (void *)"\x2b\x06\x01\x05\x05\x02"},
49     _gss_spnego_acquire_cred,
50     _gss_spnego_release_cred,
51     _gss_spnego_init_sec_context,
52     _gss_spnego_accept_sec_context,
53     _gss_spnego_process_context_token,
54     _gss_spnego_internal_delete_sec_context,
55     _gss_spnego_context_time,
56     _gss_spnego_get_mic,
57     _gss_spnego_verify_mic,
58     _gss_spnego_wrap,
59     _gss_spnego_unwrap,
60     _gss_spnego_display_status,
61     NULL,
62     _gss_spnego_compare_name,
63     _gss_spnego_display_name,
64     _gss_spnego_import_name,
65     _gss_spnego_export_name,
66     _gss_spnego_release_name,
67     _gss_spnego_inquire_cred,
68     _gss_spnego_inquire_context,
69     _gss_spnego_wrap_size_limit,
70     _gss_spnego_add_cred,
71     _gss_spnego_inquire_cred_by_mech,
72     _gss_spnego_export_sec_context,
73     _gss_spnego_import_sec_context,
74     _gss_spnego_inquire_names_for_mech,
75     _gss_spnego_inquire_mechs_for_name,
76     _gss_spnego_canonicalize_name,
77     _gss_spnego_duplicate_name
78 };
79 
80 gssapi_mech_interface
81 __gss_spnego_initialize(void)
82 {
83 	return &spnego_mech;
84 }
85 
86 static gss_OID_desc _gss_spnego_mechanism_desc =
87     {6, (void *)"\x2b\x06\x01\x05\x05\x02"};
88 
89 gss_OID GSS_SPNEGO_MECHANISM = &_gss_spnego_mechanism_desc;
90