1 /* Copyright (C) 2010-2021 Greenbone Networks GmbH
2  *
3  * SPDX-License-Identifier: GPL-2.0-or-later
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 /**
21  * @file ntlmssp.h
22  * @brief Functions to support Authentication(type3 message) for NTLMSSP
23  * (NTLMv2, NTLM2, NTLM, KEY GEN)
24  */
25 
26 #ifndef _NTLMSSP_H_
27 #define _NTLMSSP_H_
28 #include "byteorder.h"
29 #include "hmacmd5.h"
30 #include "md5.h"
31 #include "proto.h"
32 #include "smb_crypt.h"
33 
34 #ifndef uchar
35 #define uchar unsigned char
36 #endif
37 
38 #ifndef uint8
39 #define uint8 uint8_t
40 #endif
41 
42 void
43 ntlmssp_genauth_ntlmv2 (char *user, char *domain, char *address_list,
44                         int address_list_len, char *challenge_data,
45                         uint8_t *lm_response, uint8_t *nt_response,
46                         uint8_t *session_key, unsigned char *ntlmv2_hash);
47 void
48 ntlmssp_genauth_ntlm2 (char *password, uint8_t pass_len, uint8_t *lm_response,
49                        uint8_t *nt_response, uint8_t *session_key,
50                        char *challenge_data, unsigned char *nt_hash);
51 
52 void
53 ntlmssp_genauth_ntlm (char *password, uint8_t pass_len, uint8_t *lm_response,
54                       uint8_t *nt_response, uint8_t *session_key,
55                       char *challenge_data, unsigned char *nt_hash,
56                       int neg_flags);
57 uint8_t *
58 ntlmssp_genauth_keyexchg (uint8_t *session_key, char *challenge_data,
59                           unsigned char *nt_hash, uint8_t *new_sess_key);
60 
61 #endif
62