Path: blob/main/crypto/heimdal/lib/ntlm/heimntlm.h
34889 views
/*1* Copyright (c) 2006 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 HEIM_NTLM_H36#define HEIM_NTLM_H3738/**39* Buffer for storing data in the NTLM library. When filled in by the40* library it should be freed with heim_ntlm_free_buf().41*/42struct ntlm_buf {43size_t length; /**< length buffer data */44void *data; /**< pointer to the data itself */45};4647#define NTLM_NEG_UNICODE 0x0000000148#define NTLM_NEG_OEM 0x0000000249#define NTLM_NEG_TARGET 0x0000000450#define NTLM_MBZ9 0x000000085152#define NTLM_NEG_SIGN 0x0000001053#define NTLM_NEG_SEAL 0x0000002054#define NTLM_NEG_DATAGRAM 0x0000004055#define NTLM_NEG_LM_KEY 0x0000008056#define NTLM_NEG_NTLM 0x0000020057#define NTLM_NEG_ANONYMOUS 0x000008005859#define NTLM_MBZ8 0x0000010060#define NTLM_NEG_NTLM 0x0000020061#define NTLM_NEG_NT_ONLY 0x0000040062#define NTLM_MBZ7 0x00000800 /* anon ? */6364#define NTLM_OEM_SUPPLIED_DOMAIN 0x0000100065#define NTLM_OEM_SUPPLIED_WORKSTATION 0x0000200066#define NTLM_MBZ6 0x00004000 /* local call ? */67#define NTLM_NEG_ALWAYS_SIGN 0x000080006869#define NTLM_TARGET_DOMAIN 0x0001000070#define NTLM_TARGET_SERVER 0x000200007172#define NTLM_TARGET_SHARE 0x0004000073#define NTLM_NEG_NTLM2_SESSION 0x0008000074#define NTLM_NEG_NTLM2 0x000800007576#define NTLM_NEG_IDENTIFY 0x0010000077#define NTLM_MBZ5 0x0020000078#define NTLM_NON_NT_SESSION_KEY 0x0040000079#define NTLM_NEG_TARGET_INFO 0x008000008081#define NTLM_MBZ4 0x0100000082#define NTLM_NEG_VERSION 0x0200000083#define NTLM_MBZ3 0x0400000084#define NTLM_MBZ2 0x080000008586#define NTLM_MBZ1 0x1000000087#define NTLM_ENC_128 0x2000000088#define NTLM_NEG_KEYEX 0x4000000089#define NTLM_ENC_56 0x800000009091/**92* Struct for the NTLM target info, the strings is assumed to be in93* UTF8. When filled in by the library it should be freed with94* heim_ntlm_free_targetinfo().95*/9697#define NTLM_TI_AV_FLAG_GUEST 0x000000019899struct ntlm_targetinfo {100char *servername; /**< */101char *domainname; /**< */102char *dnsdomainname; /**< */103char *dnsservername; /**< */104char *dnstreename; /**< */105uint32_t avflags; /**< */106};107108/**109* Struct for the NTLM type1 message info, the strings is assumed to110* be in UTF8. When filled in by the library it should be freed with111* heim_ntlm_free_type1().112*/113114struct ntlm_type1 {115uint32_t flags; /**< */116char *domain; /**< */117char *hostname; /**< */118uint32_t os[2]; /**< */119};120121/**122* Struct for the NTLM type2 message info, the strings is assumed to123* be in UTF8. When filled in by the library it should be freed with124* heim_ntlm_free_type2().125*/126127struct ntlm_type2 {128uint32_t flags; /**< */129char *targetname; /**< */130struct ntlm_buf targetinfo; /**< */131unsigned char challenge[8]; /**< */132uint32_t context[2]; /**< */133uint32_t os[2]; /**< */134};135136/**137* Struct for the NTLM type3 message info, the strings is assumed to138* be in UTF8. When filled in by the library it should be freed with139* heim_ntlm_free_type3().140*/141142struct ntlm_type3 {143uint32_t flags; /**< */144char *username; /**< */145char *targetname; /**< */146struct ntlm_buf lm; /**< */147struct ntlm_buf ntlm; /**< */148struct ntlm_buf sessionkey; /**< */149char *ws; /**< */150uint32_t os[2]; /**< */151};152153#include <ntlm_err.h>154#include <heimntlm-protos.h>155156#endif /* NTLM_NTLM_H */157158159