Example #1
0
        public NtlmNegotiateMessage(NegotiationMessageStruct message, string domainName, string hostName)
        {
            Message = message;
            Domain  = domainName;
            Host    = hostName;

            Rectify();
        }
Example #2
0
        public void Fill(byte[] data)
        {
            if (data == null)
            {
                throw new ArgumentNullException(nameof(data));
            }
            if (data.Length == 0)
            {
                throw new ArgumentException($"{nameof(data)} array is empty.");
            }

            Message = data.ToStruct <NegotiationMessageStruct>();

            if (Message.HostNameLength > 0)
            {
                var tmp = data.NewCopy(Message.HostNameOffset, Message.HostNameLength);
                Host = Encoding.ASCII.GetString(tmp);
            }
            if (Message.DomainNameLength > 0)
            {
                var tmp = data.NewCopy(Message.DomainNameOffset, Message.DomainNameLength);
                Domain = Encoding.ASCII.GetString(tmp);
            }
        }