Exemplo n.º 1
0
        public void SerializeType1Message()
        {
            Type1Message msg = new Type1Message("myDomain", "myWorkstation");

            byte[] serialized = msg.Serialize();
            Assert.IsTrue(type1Message.SequenceEqual(serialized));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Computes the initial client response to an NTLM challenge.
        /// </summary>
        /// <param name="challenge">The challenge sent by the server. Since
        /// NTLM expects an initial client response, this will usually be
        /// empty.</param>
        /// <returns>The initial response to the NTLM challenge.</returns>
        /// <exception cref="SaslException">Thrown if the response could not
        /// be computed.</exception>
        protected byte[] ComputeInitialResponse(byte[] challenge)
        {
            try {
                string domain = Properties.ContainsKey("Domain") ?
                                Properties["Domain"] as string : "domain";
                string workstation = Properties.ContainsKey("Workstation") ?
                                     Properties["Workstation"] as string : "workstation";
                Type1Message msg = new Type1Message(domain, workstation);

                return(msg.Serialize());
            } catch (Exception e) {
                throw new SaslException("The initial client response could not " +
                                        "be computed.", e);
            }
        }