138898Sjb/*
215903Swosch * Copyright (c) 2006 Kungliga Tekniska H��gskolan
315903Swosch * (Royal Institute of Technology, Stockholm, Sweden).
431074Swosch * All rights reserved.
515903Swosch *
615903Swosch * Redistribution and use in source and binary forms, with or without
715903Swosch * modification, are permitted provided that the following conditions
815903Swosch * are met:
915903Swosch *
1015903Swosch * 1. Redistributions of source code must retain the above copyright
1115903Swosch *    notice, this list of conditions and the following disclaimer.
1215903Swosch *
1315903Swosch * 2. Redistributions in binary form must reproduce the above copyright
1415903Swosch *    notice, this list of conditions and the following disclaimer in the
1515903Swosch *    documentation and/or other materials provided with the distribution.
1615903Swosch *
1715903Swosch * 3. Neither the name of the Institute nor the names of its contributors
1815903Swosch *    may be used to endorse or promote products derived from this software
1915903Swosch *    without specific prior written permission.
2015903Swosch *
2115903Swosch * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
2215903Swosch * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2315903Swosch * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2415903Swosch * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
2515903Swosch * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2615903Swosch * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2715903Swosch * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2823546Swosch * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2923546Swosch * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3015903Swosch * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3115903Swosch * SUCH DAMAGE.
3215903Swosch */
3315903Swosch
3415903Swosch#include "ntlm.h"
3515903Swosch
3615903Swosch#if 0
3715903Swoschstatic gss_mo_desc ntlm_mo[] = {
3815903Swosch    {
3920935Swosch	GSS_C_MA_SASL_MECH_NAME,
4020935Swosch	GSS_MO_MA,
4117511Speter	"SASL mech name",
4217511Speter	rk_UNCONST("NTLM"),
4315903Swosch	_gss_mo_get_ctx_as_string,
4427659Spst	NULL
4527659Spst    },
4627659Spst    {
4727659Spst	GSS_C_MA_MECH_NAME,
4827659Spst	GSS_MO_MA,
4915903Swosch	"Mechanism name",
5015903Swosch	rk_UNCONST("NTLMSPP"),
5115903Swosch	_gss_mo_get_ctx_as_string,
5215903Swosch	NULL
5315903Swosch    },
541638Srgrimes    {
5538183Speter	GSS_C_MA_MECH_DESCRIPTION,
5638183Speter	GSS_MO_MA,
5738183Speter	"Mechanism description",
5838183Speter	rk_UNCONST("Heimdal NTLMSSP Mechanism"),
5938183Speter	_gss_mo_get_ctx_as_string,
6038183Speter	NULL
6138183Speter    }
621844Swollman};
6311468Sbde
641638Srgrimes#endif
6527659Spst
6627659Spststatic gssapi_mech_interface_desc ntlm_mech = {
6727659Spst    GMI_VERSION,
6827659Spst    "ntlm",
6923546Swosch    {10, rk_UNCONST("\x2b\x06\x01\x04\x01\x82\x37\x02\x02\x0a") },
7023546Swosch    0,
7111468Sbde    _gss_ntlm_acquire_cred,
7238898Sjb    _gss_ntlm_release_cred,
7311468Sbde    _gss_ntlm_init_sec_context,
7415168Swosch    _gss_ntlm_accept_sec_context,
7511623Sbde    _gss_ntlm_process_context_token,
7611623Sbde    _gss_ntlm_delete_sec_context,
7711623Sbde    _gss_ntlm_context_time,
7811623Sbde    _gss_ntlm_get_mic,
7915168Swosch    _gss_ntlm_verify_mic,
8011623Sbde    _gss_ntlm_wrap,
8111623Sbde    _gss_ntlm_unwrap,
8211623Sbde    _gss_ntlm_display_status,
8325027Sbde    NULL,
8425027Sbde    _gss_ntlm_compare_name,
8511468Sbde    _gss_ntlm_display_name,
8611468Sbde    _gss_ntlm_import_name,
8711468Sbde    _gss_ntlm_export_name,
8811468Sbde    _gss_ntlm_release_name,
8911623Sbde    _gss_ntlm_inquire_cred,
9018314Speter    _gss_ntlm_inquire_context,
9118314Speter    _gss_ntlm_wrap_size_limit,
9218314Speter    _gss_ntlm_add_cred,
9318314Speter    _gss_ntlm_inquire_cred_by_mech,
9418314Speter    _gss_ntlm_export_sec_context,
9518314Speter    _gss_ntlm_import_sec_context,
9618314Speter    _gss_ntlm_inquire_names_for_mech,
9718314Speter    _gss_ntlm_inquire_mechs_for_name,
9818314Speter    _gss_ntlm_canonicalize_name,
991844Swollman    _gss_ntlm_duplicate_name,
1001638Srgrimes    _gss_ntlm_inquire_sec_context_by_oid,
10117511Speter    NULL,
10217511Speter    NULL,
10317511Speter    NULL,
10418314Speter    NULL,
10527659Spst    NULL,
10617511Speter    NULL,
10718314Speter    NULL,
10817511Speter    NULL,
10917511Speter    NULL,
11017831Speter    NULL,
11117511Speter    NULL,
11227673Sbde    _gss_ntlm_iter_creds_f,
11327659Spst    _gss_ntlm_destroy_cred,
11427659Spst    NULL,
11527659Spst    NULL,
11627659Spst    NULL,
11717511Speter    NULL,
11817511Speter#if 0
11917511Speter    ntlm_mo,
12017511Speter    sizeof(ntlm_mo) / sizeof(ntlm_mo[0]),
12127659Spst#else
12227659Spst    NULL,
12327659Spst    0,
12427659Spst#endif
12527659Spst    NULL,
12627673Sbde    NULL,
12727659Spst    NULL,
12827659Spst    NULL,
12927659Spst    NULL,
13027659Spst    NULL,
13127659Spst};
13227659Spst
13327659Spstgssapi_mech_interface
13427659Spst__gss_ntlm_initialize(void)
13527659Spst{
13627659Spst	return &ntlm_mech;
13727659Spst}
13817511Speter