72 DBGC ( challenge,
"NTLM challenge message:\n" );
76 if (
len <
sizeof ( *challenge ) ) {
77 DBGC ( challenge,
"NTLM underlength challenge (%zd bytes)\n",
84 DBGC ( challenge,
"NTLM challenge nonce:\n" );
92 DBGC ( challenge,
"NTLM target information outside " 97 info->target = ( ( (
void * ) challenge ) +
offset );
98 DBGC ( challenge,
"NTLM challenge target information:\n" );
148 while ( (
c = *(domain++) ) ) {
176 for ( i = 0 ; i <
sizeof ( tmp_nonce ) ; i++ )
187 DBGC (
key,
"NTLM LAN Manager response:\n" );
203 DBGC (
key,
"NTLM NT response prefix:\n" );
217 void *payload,
size_t len ) {
225 return ( payload +
len );
239 const char *
string ) {
244 for (
tmp = payload ; (
string && (
c = *(
string++) ) ) ;
tmp++ ) {
251 ( ( (
void * )
tmp ) - payload ) );
267 const char *
username,
const char *workstation,
277 memset ( auth, 0,
sizeof ( *auth ) );
283 tmp = ( ( (
void * ) auth ) +
sizeof ( *auth ) );
291 nt_len = (
sizeof ( *nt ) +
info->len +
sizeof (
nt->zero ) );
296 sizeof (
nt->zero ) );
307 len = (
tmp - ( (
void * ) auth ) );
309 DBGC ( auth,
"NTLM authenticate message:\n" );
326 const char *domain,
const char *
username,
327 const char *workstation ) {
#define MD4_DIGEST_SIZE
MD4 digest size.
void hmac_init(struct digest_algorithm *digest, void *ctx, const void *key, size_t key_len)
Initialise HMAC.
#define EINVAL
Invalid argument.
static void digest_update(struct digest_algorithm *digest, void *ctx, const void *data, size_t len)
A variable-length data descriptor.
static __always_inline void off_t int c
struct ntlm_data lm
LAN Manager response.
#define le32_to_cpu(value)
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
static void digest_final(struct digest_algorithm *digest, void *ctx, void *out)
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.
#define offsetof(type, field)
Get offset of a field within a structure.
struct golan_eq_context ctx
struct ntlm_header header
Message header.
uint16_t len
Length (in bytes)
size_t ntlm_authenticate(struct ntlm_challenge_info *info, const char *domain, const char *username, const char *workstation, struct ntlm_lm_response *lm, struct ntlm_nt_response *nt, struct ntlm_authenticate *auth)
Construct NTLM Authenticate message.
static int toupper(int character)
Convert character to upper case.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
u32 version
Driver version.
struct ntlm_data domain
Domain name.
Keyed-Hashing for Message Authentication.
uint8_t digest[MD5_DIGEST_SIZE]
HMAC-MD5 digest.
#define NTLM_MAGIC
Magic signature.
An NTLM verification key.
#define cpu_to_le32(value)
uint32_t flags
Negotiation flags.
static void digest_init(struct digest_algorithm *digest, void *ctx)
static void hmac_update(struct digest_algorithm *digest, void *ctx, const void *data, size_t len)
Update HMAC.
struct ntlm_data workstation
Workstation name.
static void * ntlm_append_string(struct ntlm_header *header, struct ntlm_data *data, void *payload, const char *string)
Append Unicode string data to NTLM message.
#define MD5_CTX_SIZE
MD5 context size.
long int random(void)
Generate a pseudo-random number between 0 and 2147483647L or 2147483562?
struct ntlm_data domain
Domain name.
static void * ntlm_append(struct ntlm_header *header, struct ntlm_data *data, void *payload, size_t len)
Append data to NTLM message.
struct ntlm_header header
Message header.
#define MD5_BLOCK_SIZE
MD5 block size.
struct ntlm_nonce nonce
Client nonce.
Negotiate extended security.
#define le16_to_cpu(value)
static struct dynamic_item password
struct ntlm_data nt
NT response.
uint32_t flags
Negotiation flags.
struct ntlm_data user
User name.
#define MD4_CTX_SIZE
MD4 context size.
struct ntlm_data info
Target information.
size_t ntlm_authenticate_len(struct ntlm_challenge_info *info, const char *domain, const char *username, const char *workstation)
Calculate NTLM Authenticate message length.
#define NTLM_VERSION_NTLMV2
NTLM version.
uint32_t offset
Offset from start of message header.
struct ena_aq_header header
Header.
#define cpu_to_le16(value)
A message digest algorithm.
int ntlm_challenge(struct ntlm_challenge *challenge, size_t len, struct ntlm_challenge_info *info)
Parse NTLM Challenge.
uint8_t data[48]
Additional event data.
static struct dynamic_item username
void hmac_final(struct digest_algorithm *digest, void *ctx, void *hmac)
Finalise HMAC.
void ntlm_key(const char *domain, const char *username, const char *password, struct ntlm_key *key)
Calculate NTLM verification key.
uint16_t offset
Offset to command line.
NT LAN Manager (NTLM) authentication.
struct digest_algorithm md4_algorithm
MD4 algorithm.
struct ntlm_nonce nonce
Server nonce.
typeof(acpi_finder=acpi_find)
ACPI table finder.
NTLM challenge information.
Request target name and information.
#define NULL
NULL pointer (VOID *)
Negotiate Unicode character encoding.
struct mschapv2_nt_response nt
NT response.
struct digest_algorithm md5_algorithm
MD5 algorithm.
void * memset(void *dest, int character, size_t len) __nonnull