From 6bfa90e48ada0f5e972d1165521b73368f7345aa Mon Sep 17 00:00:00 2001 From: Conor Hunt Date: Mon, 21 Jan 2013 13:19:00 -0500 Subject: [PATCH] better description of the reinitialization and check for DATAGRAM flag --- src/ntlm/ntlmv2.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ntlm/ntlmv2.go b/src/ntlm/ntlmv2.go index c25dde3..b26585a 100644 --- a/src/ntlm/ntlmv2.go +++ b/src/ntlm/ntlmv2.go @@ -77,9 +77,9 @@ func (n *V2Session) Mac(message []byte, sequenceNumber int) ([]byte, error) { // TODO: Need to keep track of the sequence number for connection oriented NTLM if messages.NTLMSSP_NEGOTIATE_DATAGRAM.IsSet(n.negotiateFlags) && messages.NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY.IsSet(n.negotiateFlags) { n.serverHandle, _ = reinitSealingKey(n.serverSealingKey, sequenceNumber) - } else { + } else if messages.NTLMSSP_NEGOTIATE_DATAGRAM.IsSet(n.negotiateFlags) { // CONOR: Reinitializing the rc4 cipher on every requst, but not using the - // algorithm as described in the MS-NTLM document. Just reinitialize it + // algorithm as described in the MS-NTLM document. Just reinitialize it directly. n.serverHandle, _ = rc4Init(n.serverSealingKey) } sig := mac(n.negotiateFlags, n.serverHandle, n.serverSigningKey, uint32(sequenceNumber), message)