OpenVAS Scanner
7.0.0~git
|
Go to the documentation of this file.
46 #ifndef HAVE_UCBINCLUDE
50 #include "/usr/ucbinclude/fcntl.h"
54 #define uint32 uint32_t
70 #define ZERO_STRUCT(x) memset ((char *) &(x), 0, sizeof (x))
100 unsigned char buf[1011];
101 unsigned char tmp_md4[16];
104 fd = open (fname, O_RDONLY, 0);
108 while ((n = read (fd, (
char *) buf,
sizeof (buf))) > 0)
111 for (n = 0; n < 16; n++)
112 the_hash[n] ^= tmp_md4[n];
132 unsigned char seed_inbuf[40];
142 fd = open (
"/dev/urandom", O_RDONLY, 0);
148 memset (seed_inbuf,
'\0',
sizeof (seed_inbuf));
156 v1 = (
counter++) + mypid + tval.tv_sec;
157 v2 = (
counter++) * mypid + tval.tv_usec;
159 SIVAL (seed_inbuf, 32, v1 ^
IVAL (seed_inbuf, 32));
160 SIVAL (seed_inbuf, 36, v2 ^
IVAL (seed_inbuf, 36));
170 for (i = 0; i <
sizeof (seed_inbuf); i++)
171 seed_inbuf[i] ^= ((
char *) (&reseed_data))[i %
sizeof (reseed_data)];
186 static int urand_fd = -1;
187 unsigned char md4_buf[64];
188 unsigned char tmp_buf[16];
197 if (urand_fd != -1 && len > 0)
199 if (read (urand_fd, out, len) == len)
219 int copy_len = len > 16 ? 16 : len;
221 bzero (md4_buf,
sizeof (md4_buf));
224 memcpy (p, tmp_buf, copy_len);
void mdfour_ntlmssp(unsigned char *out, const unsigned char *in, int n)
static int do_reseed_ntlmssp(bool use_fd, int fd)
Unix SMB/CIFS implementation. SMB Byte handling.
struct timeval timeval(unsigned long val)
static void get_rand_reseed_data_ntlmssp(int *reseed_data)
#define SIVAL(buf, pos, val)
void smb_arc4_crypt_ntlmssp(unsigned char arc4_state_inout[258], unsigned char *data, size_t len)
static unsigned char smb_arc4_state[258]
Unix SMB/CIFS implementation.
void generate_random_buffer_ntlmssp(unsigned char *out, int len)
static bool done_reseed_ntlmssp
void smb_arc4_init_ntlmssp(unsigned char arc4_state_out[258], const unsigned char *key, size_t keylen)
static void do_filehash_ntlmssp(const char *fname, unsigned char *the_hash)
static void(* reseed_callback_ntlmssp)(int *newseed)
Unix SMB/CIFS implementation.
void GetTimeOfDay_ntlmssp(struct timeval *tval)