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) | |
struct ntlm_header | __attribute__ ((packed)) |
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 | |
uint8_t | magic [8] |
Magic signature. More... | |
uint32_t | type |
Message type. More... | |
enum ntlm_type | __attribute__ |
uint8_t | major |
Product major version. More... | |
uint8_t | minor |
Product minor version. More... | |
uint16_t | build |
Product build number. More... | |
uint8_t | reserved [3] |
Reserved. More... | |
uint8_t | revision |
NTLMSSP revision. More... | |
uint8_t | raw [8] |
Raw bytes. More... | |
uint16_t | len |
Length (in bytes) More... | |
uint16_t | max_len |
Maximum length (in bytes) More... | |
uint32_t | offset |
Offset from start of message header. More... | |
struct ntlm_header | header |
Message header. More... | |
uint32_t | flags |
Negotiation flags. More... | |
struct ntlm_data | domain |
Domain name. More... | |
struct ntlm_data | workstation |
Workstation name. More... | |
struct ntlm_data | name |
Target name. More... | |
struct ntlm_nonce | nonce |
Server nonce. More... | |
struct ntlm_data | info |
Target information. More... | |
struct ntlm_data | lm |
LAN Manager response. More... | |
struct ntlm_data | nt |
NT response. More... | |
struct ntlm_data | user |
User name. More... | |
struct ntlm_data | session |
Session key. More... | |
uint8_t | digest [MD5_DIGEST_SIZE] |
HMAC-MD5 digest. More... | |
uint8_t | version |
Response version. More... | |
uint8_t | high |
Highest response version. More... | |
uint8_t | reserved_a [6] |
Reserved. More... | |
uint64_t | time |
Current time. More... | |
uint32_t | zero |
Must be zero. More... | |
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 | ) |
struct ntlm_header __attribute__ | ( | (packed) | ) |
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, ntlm_data::offset, and 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, digest_final(), digest_init(), digest_update(), domain, hmac_final(), hmac_init(), hmac_update(), key, md4_algorithm, MD4_CTX_SIZE, MD4_DIGEST_SIZE, md5_algorithm, MD5_BLOCK_SIZE, MD5_CTX_SIZE, toupper(), 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, hmac_final(), hmac_init(), hmac_update(), info, key, lm, md5_algorithm, MD5_BLOCK_SIZE, MD5_CTX_SIZE, memcpy(), memset(), 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, domain, ntlm_authenticate::domain, ntlm_negotiate::flags, ntlm_authenticate::flags, ntlm_authenticate::header, ntlm_negotiate::header, info, len, ntlm_authenticate::lm, lm, ntlm_header::magic, memcpy(), memset(), ntlm_authenticate::nt, nt, ntlm_append(), ntlm_append_string(), NTLM_AUTHENTICATE, tmp, ntlm_header::type, ntlm_authenticate::user, workstation, 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 domain, info, ntlm_authenticate(), NULL, and workstation.
Referenced by http_ntlm_authenticate(), and ntlm_authenticate_okx().
struct ntlm_challenge_info __attribute__ |
uint16_t build |
uint16_t max_len |
Maximum length (in bytes)
Should always be set equal to the length; this field is entirely superfluous.
Definition at line 18 of file ntlm.h.
Referenced by acpi_settings_fetch(), base16_decode_okx(), base64_decode_okx(), cachedhcp_record(), create_fakedhcpack(), create_fakedhcpdiscover(), create_fakepxebsack(), dhcp_create_packet(), dhcp_create_request(), draw_menu_item(), drbg_instantiate(), drbg_reseed(), efi_file_load(), efi_pecoff_debug_name(), get_entropy_input(), iob_populate(), ipair_rx_pubkey(), netdev_fetch_hwaddr(), netdev_fetch_mac(), nvs_frag_len(), nvs_vpd_read(), nvs_vpd_write(), pxenv_file_cmdline(), read_user(), rsa_encode_digest(), rsa_encrypt(), tcp_process_tx_queue(), tls_send_certificate_verify(), tls_send_client_key_exchange_pubkey(), and xferbuf_write().
struct ntlm_header header |
struct ntlm_data domain |
Domain name.
Definition at line 16 of file ntlm.h.
Referenced by http_format_ntlm_auth(), http_ntlm_authenticate(), netbios_domain_undo(), ntlm_authenticate(), ntlm_authenticate_len(), ntlm_key(), and syslog_send().
struct ntlm_data workstation |
Workstation name.
Definition at line 18 of file ntlm.h.
Referenced by ntlm_authenticate(), and ntlm_authenticate_len().
struct ntlm_nonce nonce |
Server nonce.
Client nonce.
Definition at line 18 of file ntlm.h.
Referenced by ccmp_cbc_mac(), ccmp_ctr_xor(), ccmp_decrypt(), ccmp_encrypt(), get_entropy_input_tmp(), make_next_nonce(), and ntlm_response().
struct ntlm_data lm |
LAN Manager response.
Definition at line 14 of file ntlm.h.
Referenced by ntlm_authenticate(), ntlm_authenticate_okx(), and ntlm_response().
struct ntlm_data nt |
NT response.
Definition at line 16 of file ntlm.h.
Referenced by ntlm_authenticate(), ntlm_authenticate_okx(), and ntlm_response().
struct ntlm_data user |
User name.
Definition at line 20 of file ntlm.h.
Referenced by fc_ulp_attach(), fc_ulp_detach(), fc_ulp_login(), fc_ulp_logout(), fc_ulp_user_get(), fc_ulp_user_init(), fc_ulp_user_put(), and fcpdev_examine().
struct ntlm_data session |
Session key.
Definition at line 24 of file ntlm.h.
Referenced by free_tls(), free_tls_session(), ipair_rx_session(), mount_init_session(), mount_mnt(), mount_umnt(), nfs_init_session(), nfs_lookup(), nfs_read(), nfs_readlink(), oncrpc_call(), oncrpc_init_session(), portmap_getport(), portmap_init_session(), tls_client_hello(), tls_new_finished(), tls_session(), tls_tx_resume_all(), tls_tx_step(), tls_validator_done(), and xsmp_session_name().
uint8_t digest[MD5_DIGEST_SIZE] |
uint64_t time |
Current time.
Definition at line 20 of file ntlm.h.
Referenced by add_tls(), asn1_generalized_time(), cms_verify(), cms_verify_fail_okx(), cms_verify_okx(), cms_verify_signer_info(), efi_get_time(), imgverify(), ntp_request(), ocsp_parse_responses(), ocsp_validate(), rtc_now(), rtc_read_time(), unixtime_fetch(), validator_ocsp_validate(), validator_step(), x509_check_time(), x509_check_time_fail_okx(), x509_check_time_okx(), x509_validate(), x509_validate_chain(), x509_validate_chain_fail_okx(), and x509_validate_chain_okx().
uint32_t zero |
Must be zero.
Definition at line 24 of file ntlm.h.
Referenced by aes_setkey(), b44_set_rx_mode(), genesis_mac_init(), genesis_reset(), profile_test_exec(), rsa_decrypt(), and string_test_exec().
const struct ntlm_negotiate ntlm_negotiate |