Path: blob/main/crypto/heimdal/lib/gssapi/ntlm/ntlm.h
34914 views
/*1* Copyright (c) 2006 - 2007 Kungliga Tekniska Högskolan2* (Royal Institute of Technology, Stockholm, Sweden).3* All rights reserved.4*5* Redistribution and use in source and binary forms, with or without6* modification, are permitted provided that the following conditions7* are met:8*9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11*12* 2. Redistributions in binary form must reproduce the above copyright13* notice, this list of conditions and the following disclaimer in the14* documentation and/or other materials provided with the distribution.15*16* 3. Neither the name of the Institute nor the names of its contributors17* may be used to endorse or promote products derived from this software18* without specific prior written permission.19*20* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND21* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE22* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE23* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE24* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL25* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS26* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)27* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT28* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY29* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF30* SUCH DAMAGE.31*/3233/* $Id$ */3435#ifndef NTLM_NTLM_H36#define NTLM_NTLM_H3738#include <config.h>3940#include <stdio.h>41#include <stdlib.h>42#include <assert.h>43#include <string.h>44#include <errno.h>4546#include <roken.h>4748#include <gssapi.h>49#include <gssapi_ntlm.h>50#include <gssapi_mech.h>51#include <gssapi_oid.h>5253#include <krb5.h>54#include <kcm.h>55#include <heim_threads.h>5657#include <heimntlm.h>5859#define HC_DEPRECATED_CRYPTO60#include "crypto-headers.h"6162typedef OM_uint3263(*ntlm_interface_init)(OM_uint32 *, void **);6465typedef OM_uint3266(*ntlm_interface_destroy)(OM_uint32 *, void *);6768typedef int69(*ntlm_interface_probe)(OM_uint32 *, void *, const char *);7071typedef OM_uint3272(*ntlm_interface_type2)(OM_uint32 *, void *, uint32_t, const char *,73const char *, uint32_t *, struct ntlm_buf *);7475typedef OM_uint3276(*ntlm_interface_type3)(OM_uint32 *, void *, const struct ntlm_type3 *,77struct ntlm_buf *);7879typedef void80(*ntlm_interface_free_buffer)(struct ntlm_buf *);8182struct ntlm_server_interface {83ntlm_interface_init nsi_init;84ntlm_interface_destroy nsi_destroy;85ntlm_interface_probe nsi_probe;86ntlm_interface_type2 nsi_type2;87ntlm_interface_type3 nsi_type3;88ntlm_interface_free_buffer nsi_free_buffer;89};909192struct ntlmv2_key {93uint32_t seq;94RC4_KEY sealkey;95RC4_KEY *signsealkey;96unsigned char signkey[16];97};9899extern struct ntlm_server_interface ntlmsspi_kdc_digest;100101typedef struct ntlm_cred {102gss_cred_usage_t usage;103char *username;104char *domain;105struct ntlm_buf key;106} *ntlm_cred;107108typedef struct {109struct ntlm_server_interface *server;110void *ictx;111ntlm_cred client;112OM_uint32 gssflags;113uint32_t kcmflags;114uint32_t flags;115uint32_t status;116#define STATUS_OPEN 1117#define STATUS_CLIENT 2118#define STATUS_SESSIONKEY 4119krb5_data sessionkey;120121gss_buffer_desc pac;122123union {124struct {125struct {126uint32_t seq;127RC4_KEY key;128} crypto_send, crypto_recv;129} v1;130struct {131struct ntlmv2_key send, recv;132} v2;133} u;134} *ntlm_ctx;135136typedef struct {137char *user;138char *domain;139} *ntlm_name;140141#include <ntlm-private.h>142143144#endif /* NTLM_NTLM_H */145146147