Пример #1
0
        /// <summary>
        /// Recieve a Kpassword response
        /// </summary>
        /// <returns></returns>
        public KpasswordResponse ExpectKpasswordResponse()
        {
            KerberosPdu responsePdu = this.ExpectPdu(KerberosConstValue.TIMEOUT_DEFAULT, typeof(KerberosAsResponse));

            this.testSite.Assert.IsNotNull(responsePdu, "Response Pdu should not be null.");
            if (responsePdu is KerberosKrbError)
            {
                KerberosKrbError error = responsePdu as KerberosKrbError;
                this.testSite.Log.Add(LogEntryKind.Comment, "ERROR CODE: {0}", error.ErrorCode.ToString());
            }
            this.testSite.Assert.IsInstanceOfType(responsePdu, typeof(KpasswordResponse), "Response type mismatches");

            KpasswordResponse response = responsePdu as KpasswordResponse;

            this.testSite.Log.Add(LogEntryKind.Comment, "Recieve Kpassword response.");

            //User the subkey to decrypt the KRB-PRIV
            response.DecryptKrbPriv(Context.Subkey);
            return(response);
        }
 /// <summary>
 /// Initializes a new instance of the KDCProxyMessage class using the specified kerb-message.
 /// </summary>
 /// <param name="pdu">PDU of the inner kerb-message </param>
 public KDCProxyMessage(KerberosPdu pdu)
 {
     Message = new KDC_PROXY_MESSAGE(new Asn1OctetString(pdu.ToBytes()), null, null);
 }
 /// <summary>
 /// Initializes a new instance of the KDCProxyMessage class using the specified kerb-message.
 /// </summary>
 /// <param name="pdu">PDU of the inner kerb-message </param>
 public KDCProxyMessage(KerberosPdu pdu)
 {
     Message = new KDC_PROXY_MESSAGE(new Asn1OctetString(pdu.ToBytes()), null, null);
 }