Microsoft.Protocols.TestTools.StackSdk.RemoteDesktop.Rdpbcgr.RdpbcgrServerDecoder.DecodeSecurityExchangePdu C# (CSharp) Method

DecodeSecurityExchangePdu() public method

Decode Security Exchange PDU
public DecodeSecurityExchangePdu ( RdpbcgrServerSessionContext serverSessionContext, byte data, byte decryptedUserData, SecurityHeaderType type ) : Microsoft.Protocols.TestTools.StackSdk.StackPacket
serverSessionContext RdpbcgrServerSessionContext the server session context
data byte data to be parsed
decryptedUserData byte decrypted user data
type SecurityHeaderType the security header type
return Microsoft.Protocols.TestTools.StackSdk.StackPacket
        public StackPacket DecodeSecurityExchangePdu(
            RdpbcgrServerSessionContext serverSessionContext,
            byte[] data,
            byte[] decryptedUserData,
            SecurityHeaderType type)
        {
            int currentIndex = 0;
            Client_Security_Exchange_Pdu pdu = new Client_Security_Exchange_Pdu();
            pdu.commonHeader = ParseMcsCommonHeader(data, ref currentIndex, type);

            int userDataIndex = 0;
            pdu.securityExchangePduData = ParseSecurityExchange(
                serverSessionContext,
                decryptedUserData,
                ref userDataIndex);

            // ETW Provider Dump Message
            if (pdu.commonHeader.securityHeader != null)
            {
                // RDP Standard Security
                string messageName = "RDPBCGR:" + pdu.GetType().Name;
                ExtendedLogger.DumpMessage(messageName, RdpbcgrUtility.DumpLevel_Layer3, pdu.GetType().Name, decryptedUserData);
            }

            // Check if data length exceeded expectation
            VerifyDataLength(decryptedUserData.Length, userDataIndex, ConstValue.ERROR_MESSAGE_DATA_LENGTH_EXCEEDED);
            return pdu;
        }
RdpbcgrServerDecoder