iPXE
|
NT LAN Manager (NTLM) authentication. More...
Go to the source code of this file.
Data Structures | |
struct | ntlm_header |
A message header. More... | |
struct | ntlm_version |
A version descriptor. More... | |
struct | ntlm_nonce |
A nonce. More... | |
struct | ntlm_data |
A variable-length data descriptor. More... | |
struct | ntlm_negotiate |
A Negotiate message. More... | |
struct | ntlm_challenge |
A Challenge message. More... | |
struct | ntlm_authenticate |
An Authenticate message. More... | |
struct | ntlm_lm_response |
A LAN Manager response. More... | |
struct | ntlm_nt_response |
An NT response. More... | |
struct | ntlm_challenge_info |
NTLM challenge information. More... | |
struct | ntlm_key |
An NTLM verification key. More... | |
Macros | |
#define | NTLM_MAGIC { 'N', 'T', 'L', 'M', 'S', 'S', 'P', '\0' } |
Magic signature. More... | |
#define | NTLM_VERSION_NTLMV2 0x01 |
NTLM version. More... | |
Enumerations | |
enum | ntlm_type { NTLM_NEGOTIATE = 0x00000001UL, NTLM_CHALLENGE = 0x00000002UL, NTLM_AUTHENTICATE = 0x00000003UL } |
Message types. More... | |
enum | ntlm_flags { NTLM_NEGOTIATE_KEY_EXCH = 0x20000000UL, NTLM_NEGOTIATE_EXTENDED_SESSIONSECURITY = 0x00080000UL, NTLM_NEGOTIATE_ALWAYS_SIGN = 0x00008000UL, NTLM_NEGOTIATE_NTLM = 0x00000200UL, NTLM_REQUEST_TARGET = 0x00000004UL, NTLM_NEGOTIATE_UNICODE = 0x00000001UL } |
Negotiation flags. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
int | ntlm_challenge (struct ntlm_challenge *challenge, size_t len, struct ntlm_challenge_info *info) |
Parse NTLM Challenge. More... | |
void | ntlm_key (const char *domain, const char *username, const char *password, struct ntlm_key *key) |
Calculate NTLM verification key. More... | |
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. More... | |
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. More... | |
size_t | ntlm_authenticate_len (struct ntlm_challenge_info *info, const char *domain, const char *username, const char *workstation) |
Calculate NTLM Authenticate message length. More... | |
Variables | |
const struct ntlm_negotiate | ntlm_negotiate |
Negotiate message. More... | |
NT LAN Manager (NTLM) authentication.
Definition in file ntlm.h.
enum ntlm_type |
enum ntlm_flags |
Negotiation flags.
Definition at line 38 of file ntlm.h.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
int ntlm_challenge | ( | struct ntlm_challenge * | challenge, |
size_t | len, | ||
struct ntlm_challenge_info * | info | ||
) |
Parse NTLM Challenge.
challenge | Challenge message |
len | Length of Challenge message |
info | Challenge information to fill in |
rc | Return status code |
Definition at line 68 of file ntlm.c.
References DBGC, DBGC_HDA, EINVAL, info, ntlm_challenge::info, le16_to_cpu, le32_to_cpu, len, ntlm_data::len, ntlm_challenge::nonce, offset, and ntlm_data::offset.
void ntlm_key | ( | const char * | domain, |
const char * | username, | ||
const char * | password, | ||
struct ntlm_key * | key | ||
) |
Calculate NTLM verification key.
domain | Domain name (or NULL) |
username | User name (or NULL) |
password | Password (or NULL) |
key | Key to fill in |
This is the NTOWFv2() function as defined in MS-NLMP.
Definition at line 114 of file ntlm.c.
References c, cpu_to_le16, ctx, DBGC, DBGC_HDA, digest_final(), digest_init(), digest_update(), hmac_final(), hmac_init(), hmac_update(), key, md4_algorithm, MD4_CTX_SIZE, MD4_DIGEST_SIZE, md5_algorithm, MD5_BLOCK_SIZE, MD5_CTX_SIZE, password, toupper(), username, and wc.
Referenced by http_ntlm_authenticate(), ntlm_authenticate_okx(), and ntlm_key_okx().
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.
info | Challenge information |
key | Verification key |
nonce | Nonce, or NULL to use a random nonce |
lm | LAN Manager response to fill in |
nt | NT response to fill in |
Definition at line 166 of file ntlm.c.
References ctx, DBGC, DBGC_HDA, ntlm_lm_response::digest, hmac_final(), hmac_init(), hmac_update(), info, key, md5_algorithm, MD5_BLOCK_SIZE, MD5_CTX_SIZE, memcpy(), memset(), nonce, ntlm_lm_response::nonce, nt, NTLM_VERSION_NTLMV2, offsetof, random(), ntlm_nonce::raw, typeof(), and version.
Referenced by http_ntlm_authenticate(), and ntlm_authenticate_okx().
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.
info | Challenge information |
domain | Domain name, or NULL |
username | User name, or NULL |
workstation | Workstation name, or NULL |
lm | LAN Manager response |
nt | NT response |
auth | Message to fill in, or NULL to only calculate length |
len | Length of message |
Definition at line 266 of file ntlm.c.
References cpu_to_le32, DBGC, DBGC_HDA, ntlm_authenticate::domain, ntlm_negotiate::flags, ntlm_authenticate::flags, ntlm_negotiate::header, ntlm_authenticate::header, info, len, ntlm_authenticate::lm, ntlm_header::magic, memcpy(), memset(), nt, ntlm_authenticate::nt, ntlm_append(), ntlm_append_string(), NTLM_AUTHENTICATE, tmp, ntlm_header::type, ntlm_authenticate::user, username, and ntlm_authenticate::workstation.
Referenced by http_format_ntlm_auth(), and ntlm_authenticate_len().
size_t ntlm_authenticate_len | ( | struct ntlm_challenge_info * | info, |
const char * | domain, | ||
const char * | username, | ||
const char * | workstation | ||
) |
Calculate NTLM Authenticate message length.
info | Challenge information |
domain | Domain name, or NULL |
username | User name, or NULL |
workstation | Workstation name, or NULL |
len | Length of Authenticate message |
Definition at line 325 of file ntlm.c.
References info, ntlm_authenticate(), NULL, and username.
Referenced by http_ntlm_authenticate(), and ntlm_authenticate_okx().
const struct ntlm_negotiate ntlm_negotiate |