Files
Claude 8c0b5016e4 MSN 2.x: NTLM sign-in for mail, news and the web forum
MSN 2.x's programs (Outlook Express, Internet News, the Program Viewer's
Internet Explorer) sign in with MSN's security package, which is NTLM
under the name "MSN".  The NTLM server side moves out of the MSN Classic
front end into internal/ntlm (now with NTLM2 session responses and
NTLMv2), and POP3, IMAP, SMTP submission (AUTH NTLM / MSN), NNTP
(AUTHINFO GENERIC, as MS-NNTP has it) and the forum (/forum/login/ntlm,
by WWW-Authenticate) answer it against the hashes the store keeps.
[security] ntlm = yes keeps them without serving MSN Classic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRSzB4EzF1cUBt1ccvB
2026-11-11 04:36:11 +00:00

33 lines
1.1 KiB
Go

package ntlm
import "encoding/binary"
// ClientNegotiate is a client's NEGOTIATE with flags (for tests).
func ClientNegotiate(flags uint32) []byte {
b := append([]byte(nil), Signature...)
b = binary.LittleEndian.AppendUint32(b, TypeNegotiate)
b = binary.LittleEndian.AppendUint32(b, flags)
return append(b, make([]byte, 16)...)
}
// ClientAuthenticate is a client's AUTHENTICATE (the long header), in
// Unicode (for tests).
func ClientAuthenticate(flags uint32, domain, user string, lm, nt []byte) []byte {
payload := [][]byte{lm, nt, utf16le(domain), utf16le(user), utf16le("WS")}
b := append([]byte(nil), Signature...)
b = binary.LittleEndian.AppendUint32(b, TypeAuthenticate)
off := 64
for _, p := range payload {
b = binary.LittleEndian.AppendUint16(b, uint16(len(p)))
b = binary.LittleEndian.AppendUint16(b, uint16(len(p)))
b = binary.LittleEndian.AppendUint32(b, uint32(off))
off += len(p)
}
b = append(b, 0, 0, 0, 0, 0, 0, 0, 0) // session key: none
b = binary.LittleEndian.AppendUint32(b, flags)
for _, p := range payload {
b = append(b, p...)
}
return b
}