hacking up the ntlm tests to work

This commit is contained in:
Matthew Kanwisher
2013-04-15 17:43:20 -04:00
parent 632d9d2622
commit 413d3231d7
3 changed files with 71 additions and 15 deletions

View File

@@ -2,9 +2,11 @@
package ntlm
import (
rc4P "crypto/rc4"
"bytes"
// l4g "code.google.com/p/log4go"
rc4P "crypto/rc4"
"errors"
"fmt"
"ntlm/messages"
"strings"
)
@@ -160,6 +162,11 @@ func (n *V1ServerSession) ProcessAuthenticateMessage(am *messages.Authenticate)
n.negotiateFlags = am.NegotiateFlags
n.clientChallenge = am.ClientChallenge()
n.encryptedRandomSessionKey = am.EncryptedRandomSessionKey.Payload
// Ignore the values used in SetUserInfo and use these instead from the authenticate message
// They should always be correct (I hope)
n.user = am.UserName.String()
n.userDomain = am.DomainName.String()
fmt.Printf("(ProcessAuthenticateMessage)NTLM v1 User %s Domain %s \n", n.user, n.userDomain)
err = n.fetchResponseKeys()
if err != nil {

View File

@@ -177,7 +177,7 @@ func (n *V2ServerSession) ProcessAuthenticateMessage(am *messages.Authenticate)
// They should always be correct (I hope)
n.user = am.UserName.String()
n.userDomain = am.DomainName.String()
l4g.Info("NTLM User %s Domain %s", n.user, n.userDomain)
l4g.Info("(ProcessAuthenticateMessage)NTLM v2 User %s Domain %s", n.user, n.userDomain)
err = n.fetchResponseKeys()
if err != nil {