public StackPacket DecodeLicenseErrorPDU(
byte[] data,
byte[] decryptedUserData,
SecurityHeaderType type)
{
Server_License_Error_Pdu_Valid_Client pdu = new Server_License_Error_Pdu_Valid_Client();
// data index
int currentIndex = 0;
// LicenseErrorPDU: commonHeader
pdu.commonHeader = ParseMcsCommonHeader(data, ref currentIndex, type);
// user data index
int userDataIndex = 0;
// LicenseErrorPDU: preamble
pdu.preamble = ParseLicensePreamble(decryptedUserData, ref userDataIndex);
if (pdu.preamble.bMsgType == bMsgType_Values.ERROR_ALERT)
{
// LicenseErrorPDU: validClientMessage
pdu.validClientMessage = ParseLicenseErrorMessage(decryptedUserData, ref userDataIndex);
// has received ERROR_ALERT packet, change client context status
clientContext.IsWaitingLicenseErrorPdu = false;
}
else
{
// RDPELE Type PDU
RdpelePdu elePdu = new RdpelePdu(clientContext);
elePdu.commonHeader = pdu.commonHeader;
elePdu.rdpeleData = decryptedUserData;
return elePdu;
}
// Check if data length exceeded expectation
VerifyDataLength(decryptedUserData.Length, userDataIndex, ConstValue.ERROR_MESSAGE_DATA_LENGTH_EXCEEDED);
return pdu;
}