4#ifndef PROTOCORE_NTLMSSP_H
5#define PROTOCORE_NTLMSSP_H
35#define NTLMSSP_NEGOTIATE_UNICODE 0x00000001
36#define NTLMSSP_REQUEST_TARGET 0x00000004
37#define NTLMSSP_NEGOTIATE_NTLM 0x00000200
38#define NTLMSSP_NEGOTIATE_ALWAYS_SIGN 0x00008000
39#define NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY 0x00080000
40#define NTLMSSP_NEGOTIATE_TARGET_INFO 0x00800000
41#define NTLMSSP_NEGOTIATE_VERSION 0x02000000
42#define NTLMSSP_NEGOTIATE_128 0x20000000
43#define NTLMSSP_NEGOTIATE_56 0x80000000
46#define NTLMSSP_CLIENT_DEFAULT_FLAGS \
47 (NTLMSSP_NEGOTIATE_UNICODE | NTLMSSP_REQUEST_TARGET | NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_ALWAYS_SIGN | \
48 NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY)
55#define PROTOCORE_NTLMSSP_MIC_OFFSET 72
58#define PROTOCORE_NTLMSSP_MIC_LEN 16
64 uint8_t server_challenge[8];
72 size_t (*build_negotiate)(uint8_t *, uint8_t *, size_t, uint32_t);
74 size_t (*build_authenticate)(uint8_t *, uint8_t *, size_t,
const uint8_t *, size_t,
const uint8_t *, size_t,
75 const char *,
const char *,
const char *, uint32_t,
proto_bool);
114 size_t lm_len,
const uint8_t *nt_resp,
size_t nt_len,
const char *domain,
115 const char *user,
const char *workstation, uint32_t flags,
#define PROTOCORE_NS_LAYOUT(T,...)
Pin every dispatch slot of a table that is nothing but function pointers.
#define PROTOCORE_NS
Storage for a dispatch table. The const is load bearing.
proto_bool protocore_ntlmssp_parse_challenge(uint8_t *work, const uint8_t *msg, size_t len, NtlmChallenge *out)
Parse a CHALLENGE_MESSAGE (type 2): extract the flags, the 8-byte .
PROTOCORE_NS NtlmsspNs Ntlmssp PROTOCORE_UNUSED
Module namespace.
size_t protocore_ntlmssp_build_authenticate(uint8_t *work, uint8_t *buf, size_t cap, const uint8_t *lm_resp, size_t lm_len, const uint8_t *nt_resp, size_t nt_len, const char *domain, const char *user, const char *workstation, uint32_t flags, proto_bool with_mic)
Build an AUTHENTICATE_MESSAGE (type 3) carrying the LM + NT .
size_t protocore_ntlmssp_build_negotiate(uint8_t *work, uint8_t *buf, size_t cap, uint32_t flags)
Build a NEGOTIATE_MESSAGE (type 1) with flags and empty .
Parsed CHALLENGE_MESSAGE (type 2). target_info points INTO the source message.
const uint8_t * target_info
the AV_PAIR blob, or nullptr if absent
Dispatch table. Addressed by offset, so the layout is asserted below.
size_t(* build_negotiate)(uint8_t *, uint8_t *, size_t, uint32_t)
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
_Bool proto_bool
The truth value.
#define PROTOCORE_END_DECLS