|
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. | |
| #define | NTLM_VERSION_NTLMV2 0x01 |
| NTLM version. | |
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) | |
| FILE_SECBOOT (PERMITTED) | |
| int | ntlm_challenge (struct ntlm_challenge *challenge, size_t len, struct ntlm_challenge_info *info) |
| Parse NTLM Challenge. | |
| void | ntlm_key (const char *domain, const char *username, const char *password, struct ntlm_key *key) |
| Calculate NTLM verification key. | |
| 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. | |
| 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. | |
| size_t | ntlm_authenticate_len (struct ntlm_challenge_info *info, const char *domain, const char *username, const char *workstation) |
| Calculate NTLM Authenticate message length. | |
Variables | |
| const struct ntlm_negotiate | ntlm_negotiate |
| Negotiate message. | |
NT LAN Manager (NTLM) authentication.
Definition in file ntlm.h.
| #define NTLM_VERSION_NTLMV2 0x01 |
| enum ntlm_type |
Message types.
| Enumerator | |
|---|---|
| NTLM_NEGOTIATE | Negotiate message type. |
| NTLM_CHALLENGE | Challenge message type. |
| NTLM_AUTHENTICATE | Authenticate message. |
Definition at line 29 of file ntlm.h.
| enum ntlm_flags |
Negotiation flags.
Definition at line 39 of file ntlm.h.
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
| FILE_SECBOOT | ( | PERMITTED | ) |
|
extern |
Parse NTLM Challenge.
| challenge | Challenge message |
| len | Length of Challenge message |
| info | Challenge information to fill in |
| rc | Return status code |
Definition at line 69 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, ntlm_data::offset, and offset.
|
extern |
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 115 of file ntlm.c.
References 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().
|
extern |
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 167 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().
|
extern |
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 267 of file ntlm.c.
References cpu_to_le32, DBGC, DBGC_HDA, ntlm_authenticate::domain, ntlm_authenticate::flags, ntlm_negotiate::flags, ntlm_authenticate::header, ntlm_negotiate::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().
|
extern |
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 326 of file ntlm.c.
References info, ntlm_authenticate(), NULL, and username.
Referenced by http_ntlm_authenticate(), and ntlm_authenticate_okx().
|
extern |
Negotiate message.
This message content is fixed since there is no need to specify the calling workstation name or domain name, and the set of flags is mandated by the MS-NLMP specification.
Definition at line 49 of file ntlm.c.