fs/smb/server/ntlmssp.h

Source file repositories/reference/linux-study-clean/fs/smb/server/ntlmssp.h

File Facts

System
Linux kernel
Corpus path
fs/smb/server/ntlmssp.h
Extension
.h
Size
5704 bytes
Lines
170
Domain
Core OS
Bucket
VFS And Filesystem Core
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

struct security_buffer {
	__le16 Length;
	__le16 MaximumLength;
	__le32 BufferOffset;	/* offset to buffer */
} __packed;

struct target_info {
	__le16 Type;
	__le16 Length;
	__u8 Content[];
} __packed;

struct negotiate_message {
	__u8 Signature[sizeof(NTLMSSP_SIGNATURE)];
	__le32 MessageType;     /* NtLmNegotiate = 1 */
	__le32 NegotiateFlags;
	struct security_buffer DomainName;	/* RFC 1001 style and ASCII */
	struct security_buffer WorkstationName;	/* RFC 1001 and ASCII */
	/*
	 * struct security_buffer for version info not present since we
	 * do not set the version is present flag
	 */
	char DomainString[];
	/* followed by WorkstationString */
} __packed;

struct challenge_message {
	__u8 Signature[sizeof(NTLMSSP_SIGNATURE)];
	__le32 MessageType;   /* NtLmChallenge = 2 */
	struct security_buffer TargetName;
	__le32 NegotiateFlags;
	__u8 Challenge[CIFS_CRYPTO_KEY_SIZE];
	__u8 Reserved[8];
	struct security_buffer TargetInfoArray;
	/*
	 * struct security_buffer for version info not present since we
	 * do not set the version is present flag
	 */
} __packed;

struct authenticate_message {
	__u8 Signature[sizeof(NTLMSSP_SIGNATURE)];
	__le32 MessageType;  /* NtLmsAuthenticate = 3 */
	struct security_buffer LmChallengeResponse;
	struct security_buffer NtChallengeResponse;
	struct security_buffer DomainName;
	struct security_buffer UserName;
	struct security_buffer WorkstationName;
	struct security_buffer SessionKey;
	__le32 NegotiateFlags;
	/*
	 * struct security_buffer for version info not present since we
	 * do not set the version is present flag
	 */
	char UserString[];
} __packed;

struct ntlmv2_resp {
	char ntlmv2_hash[CIFS_ENCPWD_SIZE];
	__le32 blob_signature;
	__u32  reserved;
	__le64  time;
	__u64  client_chal; /* random */
	__u32  reserved2;
	/* array of name entries could follow ending in minimum 4 byte struct */
} __packed;

/* per smb session structure/fields */
struct ntlmssp_auth {
	/* whether session key is per smb session */
	bool		sesskey_per_smbsess;
	/* sent by client in type 1 ntlmsssp exchange */
	__u32		client_flags;
	/* sent by server in type 2 ntlmssp exchange */
	__u32		conn_flags;
	/* sent to server */
	unsigned char	ciphertext[CIFS_CPHTXT_SIZE];
	/* used by ntlmssp */
	char		cryptkey[CIFS_CRYPTO_KEY_SIZE];
};
#endif /* __KSMBD_NTLMSSP_H */

Annotation

Implementation Notes