reinitialize rc4 cipher for each request
This commit is contained in:
		
							parent
							
								
									9e3a4ab4f4
								
							
						
					
					
						commit
						e83e5a5b29
					
				| @ -77,6 +77,10 @@ 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 { | ||||
| 		// CONOR: Reinitializing the rc4 cipher on every requst, but not using the  | ||||
| 		// algorithm as described in the MS-NTLM document. Just reinitialize it  | ||||
| 		n.serverHandle, _ = rc4Init(n.serverSealingKey) | ||||
| 	} | ||||
| 	sig := mac(n.negotiateFlags, n.serverHandle, n.serverSigningKey, uint32(sequenceNumber), message) | ||||
| 	return sig.Bytes(), nil | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user