iPXE
Data Structures | Macros | Functions | Variables
ntlm_test.c File Reference

NTLM authentication self-tests. More...

#include <stdlib.h>
#include <string.h>
#include <byteswap.h>
#include <ipxe/ntlm.h>
#include <ipxe/test.h>

Go to the source code of this file.

Data Structures

struct  ntlm_key_test
 A key generation test. More...
 
struct  ntlm_authenticate_test
 An authentication test. More...
 

Macros

#define DATA(...)   { __VA_ARGS__ }
 Define inline message data. More...
 
#define KEY_TEST(name, DOMAIN, USERNAME, PASSWORD, EXPECTED)
 Define a key generation digest test. More...
 
#define AUTHENTICATE_TEST(name, DOMAIN, USERNAME, PASSWORD, WORKSTATION, NONCE, CHALLENGE, EXPECTED)
 Define an authentication test. More...
 
#define ntlm_key_ok(test)   ntlm_key_okx ( test, __FILE__, __LINE__ )
 
#define ntlm_data_ok(msg, msg_len, data, expected, expected_data)
 
#define ntlm_authenticate_ok(test)   ntlm_authenticate_okx ( test, __FILE__, __LINE__ )
 

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
 KEY_TEST (msnlmp_ntowfv2, "Domain", "User", "Password", DATA(0x0c, 0x86, 0x8a, 0x40, 0x3b, 0xfd, 0x7a, 0x93, 0xa3, 0x00, 0x1e, 0xf2, 0x2e, 0xf0, 0x2e, 0x3f))
 NTOWFv2() test from MS-NLMP specification. More...
 
 AUTHENTICATE_TEST (msnlmp_authenticate, "Domain", "User", "Password", "COMPUTER", DATA(0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa), DATA(0x4e, 0x54, 0x4c, 0x4d, 0x53, 0x53, 0x50, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x38, 0x00, 0x00, 0x00, 0x33, 0x82, 0x8a, 0xe2, 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x00, 0x24, 0x00, 0x44, 0x00, 0x00, 0x00, 0x06, 0x00, 0x70, 0x17, 0x00, 0x00, 0x00, 0x0f, 0x53, 0x00, 0x65, 0x00, 0x72, 0x00, 0x76, 0x00, 0x65, 0x00, 0x72, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x44, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x61, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x53, 0x00, 0x65, 0x00, 0x72, 0x00, 0x76, 0x00, 0x65, 0x00, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00), DATA(0x4e, 0x54, 0x4c, 0x4d, 0x53, 0x53, 0x50, 0x00, 0x03, 0x00, 0x00, 0x00, 0x18, 0x00, 0x18, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x54, 0x00, 0x54, 0x00, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x48, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x54, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x35, 0x82, 0x88, 0xe2, 0x05, 0x01, 0x28, 0x0a, 0x00, 0x00, 0x00, 0x0f, 0x44, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x61, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x55, 0x00, 0x73, 0x00, 0x65, 0x00, 0x72, 0x00, 0x43, 0x00, 0x4f, 0x00, 0x4d, 0x00, 0x50, 0x00, 0x55, 0x00, 0x54, 0x00, 0x45, 0x00, 0x52, 0x00, 0x86, 0xc3, 0x50, 0x97, 0xac, 0x9c, 0xec, 0x10, 0x25, 0x54, 0x76, 0x4a, 0x57, 0xcc, 0xcc, 0x19, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x68, 0xcd, 0x0a, 0xb8, 0x51, 0xe5, 0x1c, 0x96, 0xaa, 0xbc, 0x92, 0x7b, 0xeb, 0xef, 0x6a, 0x1c, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x44, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x61, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x53, 0x00, 0x65, 0x00, 0x72, 0x00, 0x76, 0x00, 0x65, 0x00, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc5, 0xda, 0xd2, 0x54, 0x4f, 0xc9, 0x79, 0x90, 0x94, 0xce, 0x1c, 0xe9, 0x0b, 0xc9, 0xd0, 0x3e))
 Authentication test from MS-NLMP specification. More...
 
static void ntlm_key_okx (struct ntlm_key_test *test, const char *file, unsigned int line)
 Report key generation test result. More...
 
static void ntlm_data_okx (struct ntlm_header *msg, size_t msg_len, struct ntlm_data *data, struct ntlm_header *expected, struct ntlm_data *expected_data, const char *field, const char *file, unsigned int line)
 Report NTLM variable-length data test result. More...
 
static void ntlm_authenticate_okx (struct ntlm_authenticate_test *test, const char *file, unsigned int line)
 Report NTLM authentication test result. More...
 
static void ntlm_test_exec (void)
 Perform NTLM self-test. More...
 

Variables

struct self_test ntlm_test __self_test
 NTLM self-test. More...
 

Detailed Description

NTLM authentication self-tests.

The test vectors are taken from the MS-NLMP specification document.

Definition in file ntlm_test.c.

Macro Definition Documentation

◆ DATA

#define DATA (   ...)    { __VA_ARGS__ }

Define inline message data.

Definition at line 78 of file ntlm_test.c.

◆ KEY_TEST

#define KEY_TEST (   name,
  DOMAIN,
  USERNAME,
  PASSWORD,
  EXPECTED 
)
Value:
static struct ntlm_key_test name = { \
.domain = DOMAIN, \
.username = USERNAME, \
.password = PASSWORD, \
.expected = { \
.raw = EXPECTED, \
}, \
};
const char * name
Definition: ath9k_hw.c:1984
A key generation test.
Definition: ntlm_test.c:44

Define a key generation digest test.

Definition at line 81 of file ntlm_test.c.

◆ AUTHENTICATE_TEST

#define AUTHENTICATE_TEST (   name,
  DOMAIN,
  USERNAME,
  PASSWORD,
  WORKSTATION,
  NONCE,
  CHALLENGE,
  EXPECTED 
)
Value:
static const uint8_t name ## _challenge[] = CHALLENGE; \
static const uint8_t name ## _expected[] = EXPECTED; \
static struct ntlm_authenticate_test name = { \
.domain = DOMAIN, \
.username = USERNAME, \
.password = PASSWORD, \
.workstation = WORKSTATION, \
.nonce = { \
.raw = NONCE, \
}, \
.challenge = ( ( void * ) name ## _challenge ), \
.challenge_len = sizeof ( name ## _challenge ), \
.expected = ( ( void * ) name ## _expected ), \
.expected_len = sizeof ( name ## _expected ), \
};
const char * name
Definition: ath9k_hw.c:1984
size_t expected_len
Expected length of Authenticate message.
Definition: ntlm_test.c:74
unsigned char uint8_t
Definition: stdint.h:10
struct ntlm_authenticate * expected
Expected Authenticate message.
Definition: ntlm_test.c:72
An authentication test.
Definition: ntlm_test.c:56

Define an authentication test.

Definition at line 92 of file ntlm_test.c.

◆ ntlm_key_ok

#define ntlm_key_ok (   test)    ntlm_key_okx ( test, __FILE__, __LINE__ )

Definition at line 170 of file ntlm_test.c.

◆ ntlm_data_ok

#define ntlm_data_ok (   msg,
  msg_len,
  data,
  expected,
  expected_data 
)
Value:
ntlm_data_okx ( msg, msg_len, data, expected, expected_data, \
__FILE__, __LINE__ )
static void ntlm_data_okx(struct ntlm_header *msg, size_t msg_len, struct ntlm_data *data, struct ntlm_header *expected, struct ntlm_data *expected_data, const char *field, const char *file, unsigned int line)
Report NTLM variable-length data test result.
Definition: ntlm_test.c:185
struct ntlm_authenticate * expected
Expected Authenticate message.
Definition: ntlm_test.c:72
struct arbelprm_port_state_change_st data
Message.
Definition: arbel.h:12
static void msg(unsigned int row, const char *fmt,...)
Print message centred on specified row.
Definition: settings_ui.c:285

Definition at line 214 of file ntlm_test.c.

◆ ntlm_authenticate_ok

#define ntlm_authenticate_ok (   test)    ntlm_authenticate_okx ( test, __FILE__, __LINE__ )

Definition at line 292 of file ntlm_test.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ KEY_TEST()

KEY_TEST ( msnlmp_ntowfv2  ,
"Domain"  ,
"User"  ,
"Password"  ,
DATA(0x0c, 0x86, 0x8a, 0x40, 0x3b, 0xfd, 0x7a, 0x93, 0xa3, 0x00, 0x1e, 0xf2, 0x2e, 0xf0, 0x2e, 0x3f)   
)

NTOWFv2() test from MS-NLMP specification.

◆ AUTHENTICATE_TEST()

AUTHENTICATE_TEST ( msnlmp_authenticate  ,
"Domain"  ,
"User"  ,
"Password"  ,
"COMPUTER"  ,
DATA(0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa)  ,
DATA(0x4e, 0x54, 0x4c, 0x4d, 0x53, 0x53, 0x50, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x38, 0x00, 0x00, 0x00, 0x33, 0x82, 0x8a, 0xe2, 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x00, 0x24, 0x00, 0x44, 0x00, 0x00, 0x00, 0x06, 0x00, 0x70, 0x17, 0x00, 0x00, 0x00, 0x0f, 0x53, 0x00, 0x65, 0x00, 0x72, 0x00, 0x76, 0x00, 0x65, 0x00, 0x72, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x44, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x61, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x53, 0x00, 0x65, 0x00, 0x72, 0x00, 0x76, 0x00, 0x65, 0x00, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00)  ,
DATA(0x4e, 0x54, 0x4c, 0x4d, 0x53, 0x53, 0x50, 0x00, 0x03, 0x00, 0x00, 0x00, 0x18, 0x00, 0x18, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x54, 0x00, 0x54, 0x00, 0x84, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x48, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x54, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x35, 0x82, 0x88, 0xe2, 0x05, 0x01, 0x28, 0x0a, 0x00, 0x00, 0x00, 0x0f, 0x44, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x61, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x55, 0x00, 0x73, 0x00, 0x65, 0x00, 0x72, 0x00, 0x43, 0x00, 0x4f, 0x00, 0x4d, 0x00, 0x50, 0x00, 0x55, 0x00, 0x54, 0x00, 0x45, 0x00, 0x52, 0x00, 0x86, 0xc3, 0x50, 0x97, 0xac, 0x9c, 0xec, 0x10, 0x25, 0x54, 0x76, 0x4a, 0x57, 0xcc, 0xcc, 0x19, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x68, 0xcd, 0x0a, 0xb8, 0x51, 0xe5, 0x1c, 0x96, 0xaa, 0xbc, 0x92, 0x7b, 0xeb, 0xef, 0x6a, 0x1c, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x44, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x61, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x53, 0x00, 0x65, 0x00, 0x72, 0x00, 0x76, 0x00, 0x65, 0x00, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc5, 0xda, 0xd2, 0x54, 0x4f, 0xc9, 0x79, 0x90, 0x94, 0xce, 0x1c, 0xe9, 0x0b, 0xc9, 0xd0, 0x3e)   
)

Authentication test from MS-NLMP specification.

◆ ntlm_key_okx()

static void ntlm_key_okx ( struct ntlm_key_test test,
const char *  file,
unsigned int  line 
)
static

Report key generation test result.

Parameters
testKey generation test
fileTest code file
lineTest code line

Definition at line 162 of file ntlm_test.c.

163  {
164  struct ntlm_key key;
165 
166  ntlm_key ( test->domain, test->username, test->password, &key );
167  okx ( memcmp ( &key, &test->expected, sizeof ( key ) ) == 0,
168  file, line );
169 }
#define okx(success, file, line)
Report test result.
Definition: test.h:44
An NTLM verification key.
Definition: ntlm.h:175
void ntlm_key(const char *domain, const char *username, const char *password, struct ntlm_key *key)
Calculate NTLM verification key.
Definition: ntlm.c:114
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
Definition: string.c:98
static int test
Definition: epic100.c:73
union @375 key
Sense key.
Definition: scsi.h:18

References key, memcmp(), ntlm_key(), okx, and test.

◆ ntlm_data_okx()

static void ntlm_data_okx ( struct ntlm_header msg,
size_t  msg_len,
struct ntlm_data data,
struct ntlm_header expected,
struct ntlm_data expected_data,
const char *  field,
const char *  file,
unsigned int  line 
)
static

Report NTLM variable-length data test result.

Parameters
msgMessage header
msg_lenLength of message
dataVariable-length data descriptor
expectedExpected message header
expected_dataExpected variable-length data descriptor
fieldField name
fileTest code file
lineTest code line

Definition at line 185 of file ntlm_test.c.

190  {
191  size_t offset;
192  size_t len;
193  void *raw;
194  void *expected_raw;
195 
196  /* Verify data lies within message */
197  okx ( data->len == data->max_len, file, line );
198  offset = le32_to_cpu ( data->offset );
199  len = le16_to_cpu ( data->len );
200  okx ( offset <= msg_len, file, line );
201  okx ( len <= ( msg_len - offset ), file, line );
202 
203  /* Verify content matches expected content */
204  raw = ( ( ( void * ) msg ) + offset );
205  expected_raw = ( ( ( void * ) expected ) +
206  le32_to_cpu ( expected_data->offset ) );
207  DBGC ( msg, "NTLM %s expected:\n", field );
208  DBGC_HDA ( msg, 0, expected_raw, le16_to_cpu ( expected_data->len ) );
209  DBGC ( msg, "NTLM %s actual:\n", field );
210  DBGC_HDA ( msg, 0, raw, len );
211  okx ( data->len == expected_data->len, file, line );
212  okx ( memcmp ( raw, expected_raw, len ) == 0, file, line );
213 }
#define le32_to_cpu(value)
Definition: byteswap.h:113
#define DBGC(...)
Definition: compiler.h:505
uint16_t len
Length (in bytes)
Definition: ntlm.h:76
#define okx(success, file, line)
Report test result.
Definition: test.h:44
#define DBGC_HDA(...)
Definition: compiler.h:506
static userptr_t size_t offset
Offset of the first segment within the content.
Definition: deflate.h:259
#define le16_to_cpu(value)
Definition: byteswap.h:112
uint32_t len
Length.
Definition: ena.h:14
uint32_t offset
Offset from start of message header.
Definition: ntlm.h:84
__be32 raw[7]
Definition: CIB_PRM.h:28
struct arbelprm_port_state_change_st data
Message.
Definition: arbel.h:12
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
Definition: string.c:98
static void msg(unsigned int row, const char *fmt,...)
Print message centred on specified row.
Definition: settings_ui.c:285

References data, DBGC, DBGC_HDA, le16_to_cpu, le32_to_cpu, len, ntlm_data::len, memcmp(), msg(), ntlm_data::offset, offset, okx, and raw.

Referenced by ntlm_authenticate_okx().

◆ ntlm_authenticate_okx()

static void ntlm_authenticate_okx ( struct ntlm_authenticate_test test,
const char *  file,
unsigned int  line 
)
static

Report NTLM authentication test result.

Parameters
testAuthentication test
fileTest code file
lineTest code line

Definition at line 225 of file ntlm_test.c.

226  {
227  struct ntlm_authenticate *expected = test->expected;
228  struct ntlm_challenge_info info;
229  struct ntlm_authenticate *auth;
230  struct ntlm_key key;
231  struct ntlm_lm_response lm;
232  struct ntlm_nt_response nt;
233  size_t len;
234 
235  /* Parse Challenge message */
236  okx ( ntlm_challenge ( test->challenge, test->challenge_len,
237  &info ) == 0, file, line );
238 
239  /* Generate key */
240  ntlm_key ( test->domain, test->username, test->password, &key );
241 
242  /* Generate responses */
243  ntlm_response ( &info, &key, &test->nonce, &lm, &nt );
244 
245  /* Allocate buffer for Authenticate message */
246  len = ntlm_authenticate_len ( &info, test->domain, test->username,
247  test->workstation );
248  okx ( len >= sizeof ( *auth ), file, line );
249  auth = malloc ( len );
250  okx ( auth != NULL, file, line );
251 
252  /* Construct Authenticate message */
253  okx ( ntlm_authenticate ( &info, test->domain, test->username,
254  test->workstation, &lm, &nt, auth ) == len,
255  file, line );
256 
257  /* Verify header */
258  okx ( memcmp ( &auth->header, &expected->header,
259  sizeof ( auth->header ) ) == 0, file, line );
260 
261  /* Verify LAN Manager response */
262  ntlm_data_okx ( &auth->header, len, &auth->lm, &expected->header,
263  &expected->lm, "LM", file, line );
264 
265  /* Verify NT response */
266  ntlm_data_okx ( &auth->header, len, &auth->nt, &expected->header,
267  &expected->nt, "NT", file, line );
268 
269  /* Verify domain name */
270  ntlm_data_okx ( &auth->header, len, &auth->domain, &expected->header,
271  &expected->domain, "domain", file, line );
272 
273  /* Verify user name */
274  ntlm_data_okx ( &auth->header, len, &auth->user, &expected->header,
275  &expected->user, "user", file, line );
276 
277  /* Verify workstation name */
278  ntlm_data_okx ( &auth->header, len, &auth->workstation,
279  &expected->header, &expected->workstation,
280  "workstation",file, line );
281 
282  /* Verify session key */
283  if ( auth->flags & NTLM_NEGOTIATE_KEY_EXCH ) {
284  ntlm_data_okx ( &auth->header, len, &auth->session,
285  &expected->header, &expected->session,
286  "session", file, line );
287  }
288 
289  /* Free Authenticate message */
290  free ( auth );
291 }
u32 info
Definition: ar9003_mac.h:67
struct ntlm_data lm
LAN Manager response.
Definition: ntlm.h:120
void ntlm_response(struct ntlm_challenge_info *info, struct ntlm_key *key, struct ntlm_nonce *nonce, struct ntlm_lm_response *lm, struct ntlm_nt_response *nt)
Construct NTLM responses.
Definition: ntlm.c:168
struct ntlm_header header
Message header.
Definition: ntlm.h:118
struct ntlm_data nt
NT response.
Definition: ntlm.h:16
#define okx(success, file, line)
Report test result.
Definition: test.h:44
An Authenticate message.
Definition: ntlm.h:116
An NTLM verification key.
Definition: ntlm.h:175
struct ntlm_data workstation
Workstation name.
Definition: ntlm.h:128
static void(* free)(struct refcnt *refcnt))
Definition: refcnt.h:54
static void ntlm_data_okx(struct ntlm_header *msg, size_t msg_len, struct ntlm_data *data, struct ntlm_header *expected, struct ntlm_data *expected_data, const char *field, const char *file, unsigned int line)
Report NTLM variable-length data test result.
Definition: ntlm_test.c:185
struct ntlm_data domain
Domain name.
Definition: ntlm.h:124
struct ntlm_data lm
LAN Manager response.
Definition: ntlm.h:14
struct ntlm_data session
Session key.
Definition: ntlm.h:130
void * malloc(size_t size)
Allocate memory.
Definition: malloc.c:583
struct ntlm_data nt
NT response.
Definition: ntlm.h:122
uint32_t flags
Negotiation flags.
Definition: ntlm.h:132
struct ntlm_data user
User name.
Definition: ntlm.h:126
Negotiate key exchange.
Definition: ntlm.h:40
uint32_t len
Length.
Definition: ena.h:14
A Challenge message.
Definition: ntlm.h:100
size_t ntlm_authenticate_len(struct ntlm_challenge_info *info, const char *domain, const char *username, const char *workstation)
Calculate NTLM Authenticate message length.
Definition: ntlm.c:328
void ntlm_key(const char *domain, const char *username, const char *password, struct ntlm_key *key)
Calculate NTLM verification key.
Definition: ntlm.c:114
NTLM challenge information.
Definition: ntlm.h:165
An NT response.
Definition: ntlm.h:144
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
Definition: string.c:98
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
A LAN Manager response.
Definition: ntlm.h:136
union @375 key
Sense key.
Definition: scsi.h:18
static int test
Definition: epic100.c:73

References ntlm_authenticate::domain, ntlm_authenticate::flags, free, ntlm_authenticate::header, info, key, len, ntlm_authenticate::lm, lm, malloc(), memcmp(), ntlm_authenticate::nt, nt, ntlm_authenticate_len(), ntlm_data_okx(), ntlm_key(), NTLM_NEGOTIATE_KEY_EXCH, ntlm_response(), NULL, okx, ntlm_authenticate::session, test, ntlm_authenticate::user, and ntlm_authenticate::workstation.

◆ ntlm_test_exec()

static void ntlm_test_exec ( void  )
static

Perform NTLM self-test.

Definition at line 299 of file ntlm_test.c.

299  {
300 
301  /* Verify key generation */
302  ntlm_key_ok ( &msnlmp_ntowfv2 );
303 
304  /* Verify authentication response */
305  ntlm_authenticate_ok ( &msnlmp_authenticate );
306 }
#define ntlm_key_ok(test)
Definition: ntlm_test.c:170
#define ntlm_authenticate_ok(test)
Definition: ntlm_test.c:292

References ntlm_authenticate_ok, and ntlm_key_ok.

Variable Documentation

◆ __self_test

struct self_test ntlm_test __self_test
Initial value:
= {
.name = "ntlm",
.exec = ntlm_test_exec,
}
static void ntlm_test_exec(void)
Perform NTLM self-test.
Definition: ntlm_test.c:299

NTLM self-test.

Definition at line 309 of file ntlm_test.c.