move messages out of unecessary messages package and in to ntlm package

This commit is contained in:
Conor Hunt
2013-07-23 15:27:25 -05:00
parent e3fb7332f7
commit af256c1a87
24 changed files with 207 additions and 236 deletions

View File

@@ -7,7 +7,6 @@ import (
"encoding/binary"
"encoding/hex"
"fmt"
"github.com/ThomsonReutersEikon/go-ntlm/ntlm/messages"
)
type NtlmsspMessageSignature struct {
@@ -48,7 +47,7 @@ func sign(negFlags uint32, handle *rc4P.Cipher, signingKey []byte, seqNum uint32
}
func mac(negFlags uint32, handle *rc4P.Cipher, signingKey []byte, seqNum uint32, message []byte) (result *NtlmsspMessageSignature) {
if messages.NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY.IsSet(negFlags) {
if NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY.IsSet(negFlags) {
result = macWithExtendedSessionSecurity(negFlags, handle, signingKey, seqNum, message)
} else {
result = macWithoutExtendedSessionSecurity(handle, seqNum, message)
@@ -105,7 +104,7 @@ func macWithExtendedSessionSecurity(negFlags uint32, handle *rc4P.Cipher, signin
seqNumBytes := make([]byte, 4)
binary.LittleEndian.PutUint32(seqNumBytes, seqNum)
sig.CheckSum = hmacMd5(signingKey, concat(seqNumBytes, message))[0:8]
if messages.NTLMSSP_NEGOTIATE_KEY_EXCH.IsSet(negFlags) {
if NTLMSSP_NEGOTIATE_KEY_EXCH.IsSet(negFlags) {
sig.CheckSum = rc4(handle, sig.CheckSum)
}
sig.SeqNum = seqNumBytes