private SecurityHeaderType GetSecurityHeaderTypeByContext(RdpbcgrServerSessionContext serverSessionContext)
{
SecurityHeaderType securityHeaderType;
switch (serverSessionContext.RdpEncryptionLevel)
{
case EncryptionLevel.ENCRYPTION_LEVEL_NONE:
securityHeaderType = SecurityHeaderType.None;
break;
case EncryptionLevel.ENCRYPTION_LEVEL_LOW:
//securityHeaderType = SecurityHeaderType.Basic;
//break;
case EncryptionLevel.ENCRYPTION_LEVEL_CLIENT_COMPATIBLE:
case EncryptionLevel.ENCRYPTION_LEVEL_HIGH:
case EncryptionLevel.ENCRYPTION_LEVEL_FIPS:
default: //To enable invalid encryption level test.
// The following logic is implemented according to actual situation observed,
// since related TD section is involved with [TDI #39940]
if (serverSessionContext.RdpEncryptionMethod == EncryptionMethods.ENCRYPTION_METHOD_40BIT
|| serverSessionContext.RdpEncryptionMethod == EncryptionMethods.ENCRYPTION_METHOD_56BIT
|| serverSessionContext.RdpEncryptionMethod == EncryptionMethods.ENCRYPTION_METHOD_128BIT)
{
securityHeaderType = SecurityHeaderType.NonFips;
}
else if (serverSessionContext.RdpEncryptionMethod == EncryptionMethods.ENCRYPTION_METHOD_FIPS)
{
securityHeaderType = SecurityHeaderType.Fips;
}
else
{
securityHeaderType = SecurityHeaderType.None;
}
break;
}
return securityHeaderType;
}