OpenVAS Scanner 23.40.3
md4.h File Reference

Unix SMB/CIFS implementation. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void mdfour_ntlmssp (unsigned char *out, const unsigned char *in, int n)

Detailed Description

Unix SMB/CIFS implementation.

A implementation of MD4 designed for use in the SMB authentication protocol

Definition in file md4.h.

Function Documentation

◆ mdfour_ntlmssp()

void mdfour_ntlmssp ( unsigned char * out,
const unsigned char * in,
int n )

Definition at line 165 of file md4.c.

166{
167 unsigned char buf[128];
168 uint32 M[16];
169 uint32 b = n * 8;
170 int i;
171
172 A = 0x67452301;
173 B = 0xefcdab89;
174 C = 0x98badcfe;
175 D = 0x10325476;
176
177 while (n > 64)
178 {
179 copy64_ntlmssp (M, in);
181 in += 64;
182 n -= 64;
183 }
184
185 for (i = 0; i < 128; i++)
186 buf[i] = 0;
187 memcpy (buf, in, n);
188 buf[n] = 0x80;
189
190 if (n <= 55)
191 {
192 copy4_ntlmssp (buf + 56, b);
193 copy64_ntlmssp (M, buf);
195 }
196 else
197 {
198 copy4_ntlmssp (buf + 120, b);
199 copy64_ntlmssp (M, buf);
201 copy64_ntlmssp (M, buf + 64);
203 }
204
205 for (i = 0; i < 128; i++)
206 buf[i] = 0;
207 copy64_ntlmssp (M, buf);
208
209 copy4_ntlmssp (out, A);
210 copy4_ntlmssp (out + 4, B);
211 copy4_ntlmssp (out + 8, C);
212 copy4_ntlmssp (out + 12, D);
213
214 A = B = C = D = 0;
215}
#define uint32
Definition genrand.c:40
static void copy4_ntlmssp(unsigned char *out, uint32 x)
Definition md4.c:155
static uint32 C
Definition md4.c:28
static void copy64_ntlmssp(uint32 *M, const unsigned char *in)
Definition md4.c:145
static uint32 A
Definition md4.c:28
static uint32 D
Definition md4.c:28
static uint32 B
Definition md4.c:28
static void mdfour64_ntlmssp(uint32 *M)
Definition md4.c:63

References A, B, C, copy4_ntlmssp(), copy64_ntlmssp(), D, mdfour64_ntlmssp(), and uint32.

Referenced by do_filehash_ntlmssp(), generate_random_buffer_ntlmssp(), and SMBsesskeygen_ntv1_ntlmssp().

Here is the call graph for this function:
Here is the caller graph for this function: