SEBWIN-510: Implemented configuration tool changes.
This commit is contained in:
parent
20ff39493d
commit
4d0f9797c6
4 changed files with 1149 additions and 1061 deletions
|
@ -36,7 +36,7 @@
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<Optimize>false</Optimize>
|
<Optimize>false</Optimize>
|
||||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>TRACE;DEBUG;X86</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>0</WarningLevel>
|
<WarningLevel>0</WarningLevel>
|
||||||
<Prefer32Bit>false</Prefer32Bit>
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<OutputPath>bin\x86\Release\</OutputPath>
|
<OutputPath>bin\x86\Release\</OutputPath>
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
<DefineConstants>TRACE;X86</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<Prefer32Bit>false</Prefer32Bit>
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
|
@ -198,8 +198,17 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>IF EXIST "C:\SEB\seb_$(PlatformName).dll" (
|
||||||
</PostBuildEvent>
|
robocopy "C:\SEB" "$(TargetDir)\" "seb_$(PlatformName).dll" /np
|
||||||
|
|
||||||
|
IF %2525ERRORLEVEL%2525 GEQ 8 (
|
||||||
|
EXIT 1
|
||||||
|
)
|
||||||
|
) ELSE (
|
||||||
|
ECHO WARNING: Integrity module not included!
|
||||||
|
)
|
||||||
|
|
||||||
|
EXIT 0</PostBuildEvent>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -16,7 +16,7 @@ namespace SebWindowsConfig
|
||||||
|
|
||||||
// Boolean values
|
// Boolean values
|
||||||
const int IntFalse = 0;
|
const int IntFalse = 0;
|
||||||
const int IntTrue = 1;
|
const int IntTrue = 1;
|
||||||
|
|
||||||
// Operating systems
|
// Operating systems
|
||||||
const int IntOSX = 0;
|
const int IntOSX = 0;
|
||||||
|
@ -28,29 +28,29 @@ namespace SebWindowsConfig
|
||||||
// URL filter actions
|
// URL filter actions
|
||||||
const int IntBlock = 0;
|
const int IntBlock = 0;
|
||||||
const int IntAllow = 1;
|
const int IntAllow = 1;
|
||||||
const int IntSkip = 2;
|
const int IntSkip = 2;
|
||||||
const int IntAnd = 3;
|
const int IntAnd = 3;
|
||||||
const int IntOr = 4;
|
const int IntOr = 4;
|
||||||
|
|
||||||
const String StringBlock = "block";
|
const String StringBlock = "block";
|
||||||
const String StringAllow = "allow";
|
const String StringAllow = "allow";
|
||||||
const String StringSkip = "skip";
|
const String StringSkip = "skip";
|
||||||
const String StringAnd = "and";
|
const String StringAnd = "and";
|
||||||
const String StringOr = "or";
|
const String StringOr = "or";
|
||||||
|
|
||||||
// URL filter table operations
|
// URL filter table operations
|
||||||
const String StringCollapse = "Collapse";
|
const String StringCollapse = "Collapse";
|
||||||
const String StringExpand = "Expand";
|
const String StringExpand = "Expand";
|
||||||
|
|
||||||
const int IntOperationInsert = 0;
|
const int IntOperationInsert = 0;
|
||||||
const int IntOperationPaste = 1;
|
const int IntOperationPaste = 1;
|
||||||
const int IntOperationDelete = 2;
|
const int IntOperationDelete = 2;
|
||||||
const int IntOperationCut = 3;
|
const int IntOperationCut = 3;
|
||||||
const int IntOperationCopy = 4;
|
const int IntOperationCopy = 4;
|
||||||
|
|
||||||
const int IntLocationBefore = 0;
|
const int IntLocationBefore = 0;
|
||||||
const int IntLocationAfter = 1;
|
const int IntLocationAfter = 1;
|
||||||
const int IntLocationAt = 2;
|
const int IntLocationAt = 2;
|
||||||
|
|
||||||
// Embedded Certificate types
|
// Embedded Certificate types
|
||||||
const int IntSSLClientCertificate = 0;
|
const int IntSSLClientCertificate = 0;
|
||||||
|
@ -64,85 +64,85 @@ namespace SebWindowsConfig
|
||||||
const String StringSSLDebugCertificate = "Debug Certificate";
|
const String StringSSLDebugCertificate = "Debug Certificate";
|
||||||
|
|
||||||
// Proxy Protocol types
|
// Proxy Protocol types
|
||||||
const int IntProxyAutoDiscovery = 0;
|
const int IntProxyAutoDiscovery = 0;
|
||||||
const int IntProxyAutoConfiguration = 1;
|
const int IntProxyAutoConfiguration = 1;
|
||||||
const int IntProxyHTTP = 2;
|
const int IntProxyHTTP = 2;
|
||||||
const int IntProxyHTTPS = 3;
|
const int IntProxyHTTPS = 3;
|
||||||
const int IntProxyFTP = 4;
|
const int IntProxyFTP = 4;
|
||||||
const int IntProxySOCKS = 5;
|
const int IntProxySOCKS = 5;
|
||||||
const int IntProxyRTSP = 6;
|
const int IntProxyRTSP = 6;
|
||||||
const int NumProxyProtocols = 7;
|
const int NumProxyProtocols = 7;
|
||||||
|
|
||||||
// Captions for table dataGridViewProxyProtocols
|
// Captions for table dataGridViewProxyProtocols
|
||||||
const String StringTableCaptionProxyAutoDiscovery = "Auto Proxy Discovery";
|
const String StringTableCaptionProxyAutoDiscovery = "Auto Proxy Discovery";
|
||||||
const String StringTableCaptionProxyAutoConfiguration = "Automatic Proxy Configuration";
|
const String StringTableCaptionProxyAutoConfiguration = "Automatic Proxy Configuration";
|
||||||
const String StringTableCaptionProxyHTTP = "Web Proxy (HTTP)";
|
const String StringTableCaptionProxyHTTP = "Web Proxy (HTTP)";
|
||||||
const String StringTableCaptionProxyHTTPS = "Secure Web Proxy (HTTPS)";
|
const String StringTableCaptionProxyHTTPS = "Secure Web Proxy (HTTPS)";
|
||||||
const String StringTableCaptionProxyFTP = "FTP Proxy";
|
const String StringTableCaptionProxyFTP = "FTP Proxy";
|
||||||
const String StringTableCaptionProxySOCKS = "SOCKS Proxy";
|
const String StringTableCaptionProxySOCKS = "SOCKS Proxy";
|
||||||
const String StringTableCaptionProxyRTSP = "Streaming Proxy (RTSP)";
|
const String StringTableCaptionProxyRTSP = "Streaming Proxy (RTSP)";
|
||||||
|
|
||||||
// Texts for labelProxyServerHost
|
// Texts for labelProxyServerHost
|
||||||
const String StringServerLabelProxyAutoDiscovery = "";
|
const String StringServerLabelProxyAutoDiscovery = "";
|
||||||
const String StringServerLabelProxyAutoConfiguration = "";
|
const String StringServerLabelProxyAutoConfiguration = "";
|
||||||
const String StringServerLabelProxyHTTP = "Web";
|
const String StringServerLabelProxyHTTP = "Web";
|
||||||
const String StringServerLabelProxyHTTPS = "Secure Web";
|
const String StringServerLabelProxyHTTPS = "Secure Web";
|
||||||
const String StringServerLabelProxyFTP = "FTP";
|
const String StringServerLabelProxyFTP = "FTP";
|
||||||
const String StringServerLabelProxySOCKS = "SOCKS";
|
const String StringServerLabelProxySOCKS = "SOCKS";
|
||||||
const String StringServerLabelProxyRTSP = "Streaming";
|
const String StringServerLabelProxyRTSP = "Streaming";
|
||||||
|
|
||||||
// Permitted and Prohibited Processes table columns (0,1,2,3).
|
// Permitted and Prohibited Processes table columns (0,1,2,3).
|
||||||
// Permitted Processes: Active, OS, Executable, Title
|
// Permitted Processes: Active, OS, Executable, Title
|
||||||
// Prohibited Processes: Active, OS, Executable, Description
|
// Prohibited Processes: Active, OS, Executable, Description
|
||||||
// Process Arguments: ArgumentActive, ArgumentParameter
|
// Process Arguments: ArgumentActive, ArgumentParameter
|
||||||
const int IntColumnProcessActive = 0;
|
const int IntColumnProcessActive = 0;
|
||||||
const int IntColumnProcessOS = 1;
|
const int IntColumnProcessOS = 1;
|
||||||
const int IntColumnProcessExecutable = 2;
|
const int IntColumnProcessExecutable = 2;
|
||||||
const int IntColumnProcessTitle = 3;
|
const int IntColumnProcessTitle = 3;
|
||||||
const int IntColumnProcessDescription = 3;
|
const int IntColumnProcessDescription = 3;
|
||||||
|
|
||||||
const int IntColumnProcessArgument = 1;
|
const int IntColumnProcessArgument = 1;
|
||||||
/*
|
/*
|
||||||
const String StringColumnProcessActive = "Active";
|
const String StringColumnProcessActive = "Active";
|
||||||
const String StringColumnProcessOS = "OS";
|
const String StringColumnProcessOS = "OS";
|
||||||
const String StringColumnProcessExecutable = "Executable";
|
const String StringColumnProcessExecutable = "Executable";
|
||||||
const String StringColumnProcessTitle = "Title";
|
const String StringColumnProcessTitle = "Title";
|
||||||
const String StringColumnProcessDescription = "Description";
|
const String StringColumnProcessDescription = "Description";
|
||||||
|
|
||||||
const String StringColumnProcessArgument = "Argument";
|
const String StringColumnProcessArgument = "Argument";
|
||||||
*/
|
*/
|
||||||
// URL Filter Rules table columns (0,1,2,3,4).
|
// URL Filter Rules table columns (0,1,2,3,4).
|
||||||
// Show, Active, Regex, Expression, Action
|
// Show, Active, Regex, Expression, Action
|
||||||
const int IntColumnURLFilterRuleShow = 0;
|
const int IntColumnURLFilterRuleShow = 0;
|
||||||
const int IntColumnURLFilterRuleActive = 1;
|
const int IntColumnURLFilterRuleActive = 1;
|
||||||
const int IntColumnURLFilterRuleRegex = 2;
|
const int IntColumnURLFilterRuleRegex = 2;
|
||||||
const int IntColumnURLFilterRuleExpression = 3;
|
const int IntColumnURLFilterRuleExpression = 3;
|
||||||
const int IntColumnURLFilterRuleAction = 4;
|
const int IntColumnURLFilterRuleAction = 4;
|
||||||
/*
|
/*
|
||||||
const String StringColumnURLFilterRuleShow = "Show";
|
const String StringColumnURLFilterRuleShow = "Show";
|
||||||
const String StringColumnURLFilterRuleActive = "Active";
|
const String StringColumnURLFilterRuleActive = "Active";
|
||||||
const String StringColumnURLFilterRuleRegex = "Regex";
|
const String StringColumnURLFilterRuleRegex = "Regex";
|
||||||
const String StringColumnURLFilterRuleExpression = "Expression";
|
const String StringColumnURLFilterRuleExpression = "Expression";
|
||||||
const String StringColumnURLFilterRuleAction = "Action";
|
const String StringColumnURLFilterRuleAction = "Action";
|
||||||
*/
|
*/
|
||||||
// Embedded Certificates table columns (0,1).
|
// Embedded Certificates table columns (0,1).
|
||||||
// Type, Name
|
// Type, Name
|
||||||
const int IntColumnCertificateType = 0;
|
const int IntColumnCertificateType = 0;
|
||||||
const int IntColumnCertificateName = 1;
|
const int IntColumnCertificateName = 1;
|
||||||
//const String StringColumnCertificateType = "Type";
|
//const String StringColumnCertificateType = "Type";
|
||||||
//const String StringColumnCertificateName = "Name";
|
//const String StringColumnCertificateName = "Name";
|
||||||
|
|
||||||
// Proxy Protocols table columns (0,1).
|
// Proxy Protocols table columns (0,1).
|
||||||
// Enable, Type
|
// Enable, Type
|
||||||
const int IntColumnProxyProtocolEnable = 0;
|
const int IntColumnProxyProtocolEnable = 0;
|
||||||
const int IntColumnProxyProtocolType = 1;
|
const int IntColumnProxyProtocolType = 1;
|
||||||
//const String StringColumnProxyProtocolEnable = "Enable";
|
//const String StringColumnProxyProtocolEnable = "Enable";
|
||||||
//const String StringColumnProxyProtocolType = "Type";
|
//const String StringColumnProxyProtocolType = "Type";
|
||||||
|
|
||||||
// Bypassed Proxies table column (0).
|
// Bypassed Proxies table column (0).
|
||||||
// DomainHostPort
|
// DomainHostPort
|
||||||
const int IntColumnDomainHostPort = 0;
|
const int IntColumnDomainHostPort = 0;
|
||||||
//const String StringColumnDomainHostPort = "Domain, Host, Port";
|
//const String StringColumnDomainHostPort = "Domain, Host, Port";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -151,24 +151,24 @@ namespace SebWindowsConfig
|
||||||
// ********************************
|
// ********************************
|
||||||
|
|
||||||
// Prevent double events from switching to false process index
|
// Prevent double events from switching to false process index
|
||||||
static Boolean ignoreCellEventPermittedProcessesActive = false;
|
static Boolean ignoreCellEventPermittedProcessesActive = false;
|
||||||
static Boolean ignoreCellEventPermittedProcessesOS = false;
|
static Boolean ignoreCellEventPermittedProcessesOS = false;
|
||||||
static Boolean ignoreCellEventPermittedProcessesExecutable = false;
|
static Boolean ignoreCellEventPermittedProcessesExecutable = false;
|
||||||
static Boolean ignoreCellEventPermittedProcessesTitle = false;
|
static Boolean ignoreCellEventPermittedProcessesTitle = false;
|
||||||
|
|
||||||
static Boolean ignoreCellEventProhibitedProcessesActive = false;
|
static Boolean ignoreCellEventProhibitedProcessesActive = false;
|
||||||
static Boolean ignoreCellEventProhibitedProcessesOS = false;
|
static Boolean ignoreCellEventProhibitedProcessesOS = false;
|
||||||
static Boolean ignoreCellEventProhibitedProcessesExecutable = false;
|
static Boolean ignoreCellEventProhibitedProcessesExecutable = false;
|
||||||
static Boolean ignoreCellEventProhibitedProcessesDescription = false;
|
static Boolean ignoreCellEventProhibitedProcessesDescription = false;
|
||||||
|
|
||||||
static Boolean ignoreWidgetEventPermittedProcessesActive = false;
|
static Boolean ignoreWidgetEventPermittedProcessesActive = false;
|
||||||
static Boolean ignoreWidgetEventPermittedProcessesOS = false;
|
static Boolean ignoreWidgetEventPermittedProcessesOS = false;
|
||||||
static Boolean ignoreWidgetEventPermittedProcessesExecutable = false;
|
static Boolean ignoreWidgetEventPermittedProcessesExecutable = false;
|
||||||
static Boolean ignoreWidgetEventPermittedProcessesTitle = false;
|
static Boolean ignoreWidgetEventPermittedProcessesTitle = false;
|
||||||
|
|
||||||
static Boolean ignoreWidgetEventProhibitedProcessesActive = false;
|
static Boolean ignoreWidgetEventProhibitedProcessesActive = false;
|
||||||
static Boolean ignoreWidgetEventProhibitedProcessesOS = false;
|
static Boolean ignoreWidgetEventProhibitedProcessesOS = false;
|
||||||
static Boolean ignoreWidgetEventProhibitedProcessesExecutable = false;
|
static Boolean ignoreWidgetEventProhibitedProcessesExecutable = false;
|
||||||
static Boolean ignoreWidgetEventProhibitedProcessesDescription = false;
|
static Boolean ignoreWidgetEventProhibitedProcessesDescription = false;
|
||||||
|
|
||||||
// The current SEB configuration file
|
// The current SEB configuration file
|
||||||
|
@ -182,39 +182,39 @@ namespace SebWindowsConfig
|
||||||
// Strings for encryption identities (KeyChain, Certificate Store)
|
// Strings for encryption identities (KeyChain, Certificate Store)
|
||||||
//static ArrayList chooseIdentityStringArrayList = new ArrayList();
|
//static ArrayList chooseIdentityStringArrayList = new ArrayList();
|
||||||
//static String[] chooseIdentityStringArray = new String[1];
|
//static String[] chooseIdentityStringArray = new String[1];
|
||||||
static List<String> StringCryptoIdentity = new List<String>();
|
static readonly List<String> StringCryptoIdentity = new List<String>();
|
||||||
static ArrayList certificateReferences = new ArrayList();
|
static ArrayList certificateReferences = new ArrayList();
|
||||||
static ArrayList certificateSSLReferences = new ArrayList();
|
static ArrayList certificateSSLReferences = new ArrayList();
|
||||||
|
|
||||||
// Entries of ListBoxes
|
// Entries of ListBoxes
|
||||||
//static Byte[] ByteArrayExamKeySalt = new Byte[] {};
|
//static Byte[] ByteArrayExamKeySalt = new Byte[] {};
|
||||||
static String[] StringCryptoIdentityArray;
|
static String[] StringCryptoIdentityArray;
|
||||||
static String[] StringSebPurpose = new String[2];
|
static readonly String[] StringSebPurpose = new String[2];
|
||||||
static String[] StringSebMode = new String[2];
|
static readonly String[] StringSebMode = new String[2];
|
||||||
static String[] StringBrowserViewMode = new String[2];
|
static readonly String[] StringBrowserViewMode = new String[2];
|
||||||
static String[] StringWindowWidth = new String[5];
|
static readonly String[] StringWindowWidth = new String[5];
|
||||||
static String[] StringWindowHeight = new String[5];
|
static readonly String[] StringWindowHeight = new String[5];
|
||||||
static String[] StringWindowPositioning = new String[3];
|
static readonly String[] StringWindowPositioning = new String[3];
|
||||||
static String[] StringTaskBarHeight = new String[3];
|
static readonly String[] StringTaskBarHeight = new String[3];
|
||||||
static String[] StringPolicyLinkOpening = new String[3];
|
static readonly String[] StringPolicyLinkOpening = new String[3];
|
||||||
static String[] StringPolicyFileUpload = new String[3];
|
static readonly String[] StringPolicyFileUpload = new String[3];
|
||||||
static String[] StringPolicyProxySettings = new String[2];
|
static readonly String[] StringPolicyProxySettings = new String[2];
|
||||||
static String[] StringPolicySebService = new String[3];
|
static readonly String[] StringPolicySebService = new String[3];
|
||||||
static String[] StringFunctionKey = new String[12];
|
static readonly String[] StringFunctionKey = new String[12];
|
||||||
static String[] StringActive = new String[2];
|
static readonly String[] StringActive = new String[2];
|
||||||
static String[] StringOS = new String[2];
|
static readonly String[] StringOS = new String[2];
|
||||||
static String[] StringAction = new String[5];
|
static readonly String[] StringAction = new String[5];
|
||||||
static String[] StringCertificateType = new String[4];
|
static readonly String[] StringCertificateType = new String[4];
|
||||||
static String[] StringProxyProtocolTableCaption = new String[7];
|
static readonly String[] StringProxyProtocolTableCaption = new String[7];
|
||||||
static String[] StringProxyProtocolServerLabel = new String[7];
|
static readonly String[] StringProxyProtocolServerLabel = new String[7];
|
||||||
static Boolean[] BooleanProxyProtocolEnabled = new Boolean[7];
|
static readonly Boolean[] BooleanProxyProtocolEnabled = new Boolean[7];
|
||||||
|
|
||||||
static String[] KeyProxyProtocolType = new String[7];
|
static readonly String[] KeyProxyProtocolType = new String[7];
|
||||||
static String[] KeyProxyProtocolAttribute = new String[7];
|
static readonly String[] KeyProxyProtocolAttribute = new String[7];
|
||||||
static String[] KeyProxyProtocolEnable = new String[7];
|
static readonly String[] KeyProxyProtocolEnable = new String[7];
|
||||||
|
|
||||||
static String[] StringMinMacOSVersion = new String[11];
|
static readonly String[] StringMinMacOSVersion = new String[11];
|
||||||
static String[] StringAllowedDisplaysMaxNumber = new String[3];
|
static readonly String[] StringAllowedDisplaysMaxNumber = new String[3];
|
||||||
|
|
||||||
// ***********************
|
// ***********************
|
||||||
// Methods for GUI widgets
|
// Methods for GUI widgets
|
||||||
|
@ -226,10 +226,10 @@ namespace SebWindowsConfig
|
||||||
private void InitialiseGlobalVariablesForGUIWidgets()
|
private void InitialiseGlobalVariablesForGUIWidgets()
|
||||||
{
|
{
|
||||||
|
|
||||||
SEBSettings. permittedProcessIndex = 0;
|
SEBSettings.permittedProcessIndex = 0;
|
||||||
SEBSettings. prohibitedProcessIndex = 0;
|
SEBSettings.prohibitedProcessIndex = 0;
|
||||||
SEBSettings.embeddedCertificateIndex = 0;
|
SEBSettings.embeddedCertificateIndex = 0;
|
||||||
SEBSettings. bypassedProxyIndex = 0;
|
SEBSettings.bypassedProxyIndex = 0;
|
||||||
|
|
||||||
// Define the strings for the Encryption Identity
|
// Define the strings for the Encryption Identity
|
||||||
StringCryptoIdentity.Add("none");
|
StringCryptoIdentity.Add("none");
|
||||||
|
@ -302,7 +302,7 @@ namespace SebWindowsConfig
|
||||||
|
|
||||||
// Define the strings for the Permitted and Prohibited Processes
|
// Define the strings for the Permitted and Prohibited Processes
|
||||||
StringActive[IntFalse] = "false";
|
StringActive[IntFalse] = "false";
|
||||||
StringActive[IntTrue ] = "true";
|
StringActive[IntTrue] = "true";
|
||||||
|
|
||||||
StringOS[IntOSX] = StringOSX;
|
StringOS[IntOSX] = StringOSX;
|
||||||
StringOS[IntWin] = StringWin;
|
StringOS[IntWin] = StringWin;
|
||||||
|
@ -310,9 +310,9 @@ namespace SebWindowsConfig
|
||||||
// Define the strings for the URL Filter Rule Actions
|
// Define the strings for the URL Filter Rule Actions
|
||||||
StringAction[IntBlock] = StringBlock;
|
StringAction[IntBlock] = StringBlock;
|
||||||
StringAction[IntAllow] = StringAllow;
|
StringAction[IntAllow] = StringAllow;
|
||||||
StringAction[IntSkip ] = StringSkip;
|
StringAction[IntSkip] = StringSkip;
|
||||||
StringAction[IntAnd ] = StringAnd;
|
StringAction[IntAnd] = StringAnd;
|
||||||
StringAction[IntOr ] = StringOr;
|
StringAction[IntOr] = StringOr;
|
||||||
|
|
||||||
// Define the strings for the Embedded Certificates
|
// Define the strings for the Embedded Certificates
|
||||||
StringCertificateType[IntSSLClientCertificate] = StringSSLServerCertificate;
|
StringCertificateType[IntSSLClientCertificate] = StringSSLServerCertificate;
|
||||||
|
@ -397,6 +397,8 @@ namespace SebWindowsConfig
|
||||||
// *******************************************************
|
// *******************************************************
|
||||||
private void InitialiseGUIWidgets()
|
private void InitialiseGUIWidgets()
|
||||||
{
|
{
|
||||||
|
tabControlSebWindowsConfig.Dock = DockStyle.Fill;
|
||||||
|
|
||||||
// At program start, the local client settings configuration file is loaded
|
// At program start, the local client settings configuration file is loaded
|
||||||
currentDireSebConfigFile = SEBClientInfo.SebClientSettingsAppDataDirectory;
|
currentDireSebConfigFile = SEBClientInfo.SebClientSettingsAppDataDirectory;
|
||||||
currentFileSebConfigFile = SEBClientInfo.SEB_CLIENT_CONFIG;
|
currentFileSebConfigFile = SEBClientInfo.SEB_CLIENT_CONFIG;
|
||||||
|
@ -405,8 +407,8 @@ namespace SebWindowsConfig
|
||||||
|
|
||||||
openFileDialogSebConfigFile.InitialDirectory = Environment.CurrentDirectory;
|
openFileDialogSebConfigFile.InitialDirectory = Environment.CurrentDirectory;
|
||||||
saveFileDialogSebConfigFile.InitialDirectory = Environment.CurrentDirectory;
|
saveFileDialogSebConfigFile.InitialDirectory = Environment.CurrentDirectory;
|
||||||
//folderBrowserDialogDownloadDirectoryWin.RootFolder = Environment.SpecialFolder.DesktopDirectory;
|
//folderBrowserDialogDownloadDirectoryWin.RootFolder = Environment.SpecialFolder.DesktopDirectory;
|
||||||
//folderBrowserDialogLogDirectoryWin .RootFolder = Environment.SpecialFolder.MyDocuments;
|
//folderBrowserDialogLogDirectoryWin .RootFolder = Environment.SpecialFolder.MyDocuments;
|
||||||
|
|
||||||
// Assign the fixed entries to the ListBoxes and ComboBoxes
|
// Assign the fixed entries to the ListBoxes and ComboBoxes
|
||||||
listBoxExitKey1.Items.AddRange(StringFunctionKey);
|
listBoxExitKey1.Items.AddRange(StringFunctionKey);
|
||||||
|
@ -432,13 +434,13 @@ namespace SebWindowsConfig
|
||||||
// At program start, no file has yet been opened, so revert is not possible
|
// At program start, no file has yet been opened, so revert is not possible
|
||||||
buttonRevertToLastOpened.Enabled = false;
|
buttonRevertToLastOpened.Enabled = false;
|
||||||
|
|
||||||
comboBoxMainBrowserWindowWidth .Items.AddRange(StringWindowWidth);
|
comboBoxMainBrowserWindowWidth.Items.AddRange(StringWindowWidth);
|
||||||
comboBoxMainBrowserWindowHeight .Items.AddRange(StringWindowHeight);
|
comboBoxMainBrowserWindowHeight.Items.AddRange(StringWindowHeight);
|
||||||
listBoxMainBrowserWindowPositioning.Items.AddRange(StringWindowPositioning);
|
listBoxMainBrowserWindowPositioning.Items.AddRange(StringWindowPositioning);
|
||||||
|
|
||||||
comboBoxNewBrowserWindowWidth .Items.AddRange(StringWindowWidth);
|
comboBoxNewBrowserWindowWidth.Items.AddRange(StringWindowWidth);
|
||||||
comboBoxNewBrowserWindowHeight .Items.AddRange(StringWindowHeight);
|
comboBoxNewBrowserWindowHeight.Items.AddRange(StringWindowHeight);
|
||||||
listBoxNewBrowserWindowPositioning .Items.AddRange(StringWindowPositioning);
|
listBoxNewBrowserWindowPositioning.Items.AddRange(StringWindowPositioning);
|
||||||
|
|
||||||
comboBoxUrlPolicyMainWindow.Items.Add("Never");
|
comboBoxUrlPolicyMainWindow.Items.Add("Never");
|
||||||
comboBoxUrlPolicyMainWindow.Items.Add("OnlyLoadError");
|
comboBoxUrlPolicyMainWindow.Items.Add("OnlyLoadError");
|
||||||
|
@ -452,10 +454,10 @@ namespace SebWindowsConfig
|
||||||
|
|
||||||
comboBoxTaskBarHeight.Items.AddRange(StringTaskBarHeight);
|
comboBoxTaskBarHeight.Items.AddRange(StringTaskBarHeight);
|
||||||
|
|
||||||
listBoxOpenLinksHTML.Items.AddRange(StringPolicyLinkOpening);
|
listBoxOpenLinksHTML.Items.AddRange(StringPolicyLinkOpening);
|
||||||
|
|
||||||
listBoxChooseFileToUploadPolicy.Items.AddRange(StringPolicyFileUpload);
|
listBoxChooseFileToUploadPolicy.Items.AddRange(StringPolicyFileUpload);
|
||||||
listBoxSebServicePolicy .Items.AddRange(StringPolicySebService);
|
listBoxSebServicePolicy.Items.AddRange(StringPolicySebService);
|
||||||
comboBoxMinMacOSVersion.Items.AddRange(StringMinMacOSVersion);
|
comboBoxMinMacOSVersion.Items.AddRange(StringMinMacOSVersion);
|
||||||
comboBoxAllowedDisplaysMaxNumber.Items.AddRange(StringAllowedDisplaysMaxNumber);
|
comboBoxAllowedDisplaysMaxNumber.Items.AddRange(StringAllowedDisplaysMaxNumber);
|
||||||
|
|
||||||
|
@ -464,113 +466,113 @@ namespace SebWindowsConfig
|
||||||
// Set "AllowUserToAddRows" to false, to avoid an initial empty first row
|
// Set "AllowUserToAddRows" to false, to avoid an initial empty first row
|
||||||
// Set "RowHeadersVisible" to false, to avoid an initial empty first column
|
// Set "RowHeadersVisible" to false, to avoid an initial empty first column
|
||||||
// Set "FullRowSelect" to true , to select whole row when clicking on a cell
|
// Set "FullRowSelect" to true , to select whole row when clicking on a cell
|
||||||
dataGridViewPermittedProcesses.Enabled = false;
|
dataGridViewPermittedProcesses.Enabled = false;
|
||||||
dataGridViewPermittedProcesses.ReadOnly = false;
|
dataGridViewPermittedProcesses.ReadOnly = false;
|
||||||
dataGridViewPermittedProcesses.AllowUserToAddRows = false;
|
dataGridViewPermittedProcesses.AllowUserToAddRows = false;
|
||||||
dataGridViewPermittedProcesses.RowHeadersVisible = false;
|
dataGridViewPermittedProcesses.RowHeadersVisible = false;
|
||||||
dataGridViewPermittedProcesses.MultiSelect = false;
|
dataGridViewPermittedProcesses.MultiSelect = false;
|
||||||
dataGridViewPermittedProcesses.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
dataGridViewPermittedProcesses.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||||
|
|
||||||
dataGridViewPermittedProcessArguments.Enabled = false;
|
dataGridViewPermittedProcessArguments.Enabled = false;
|
||||||
dataGridViewPermittedProcessArguments.ReadOnly = false;
|
dataGridViewPermittedProcessArguments.ReadOnly = false;
|
||||||
dataGridViewPermittedProcessArguments.AllowUserToAddRows = false;
|
dataGridViewPermittedProcessArguments.AllowUserToAddRows = false;
|
||||||
dataGridViewPermittedProcessArguments.RowHeadersVisible = false;
|
dataGridViewPermittedProcessArguments.RowHeadersVisible = false;
|
||||||
dataGridViewPermittedProcessArguments.MultiSelect = false;
|
dataGridViewPermittedProcessArguments.MultiSelect = false;
|
||||||
dataGridViewPermittedProcessArguments.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
dataGridViewPermittedProcessArguments.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||||
|
|
||||||
dataGridViewProhibitedProcesses.Enabled = false;
|
dataGridViewProhibitedProcesses.Enabled = false;
|
||||||
dataGridViewProhibitedProcesses.ReadOnly = false;
|
dataGridViewProhibitedProcesses.ReadOnly = false;
|
||||||
dataGridViewProhibitedProcesses.AllowUserToAddRows = false;
|
dataGridViewProhibitedProcesses.AllowUserToAddRows = false;
|
||||||
dataGridViewProhibitedProcesses.RowHeadersVisible = false;
|
dataGridViewProhibitedProcesses.RowHeadersVisible = false;
|
||||||
dataGridViewProhibitedProcesses.MultiSelect = false;
|
dataGridViewProhibitedProcesses.MultiSelect = false;
|
||||||
dataGridViewProhibitedProcesses.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
dataGridViewProhibitedProcesses.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||||
|
|
||||||
dataGridViewEmbeddedCertificates.Enabled = false;
|
dataGridViewEmbeddedCertificates.Enabled = false;
|
||||||
dataGridViewEmbeddedCertificates.ReadOnly = false;
|
dataGridViewEmbeddedCertificates.ReadOnly = false;
|
||||||
dataGridViewEmbeddedCertificates.AllowUserToAddRows = false;
|
dataGridViewEmbeddedCertificates.AllowUserToAddRows = false;
|
||||||
dataGridViewEmbeddedCertificates.RowHeadersVisible = false;
|
dataGridViewEmbeddedCertificates.RowHeadersVisible = false;
|
||||||
dataGridViewEmbeddedCertificates.MultiSelect = false;
|
dataGridViewEmbeddedCertificates.MultiSelect = false;
|
||||||
dataGridViewEmbeddedCertificates.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
dataGridViewEmbeddedCertificates.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||||
|
|
||||||
dataGridViewProxyProtocols.Enabled = false;
|
dataGridViewProxyProtocols.Enabled = false;
|
||||||
dataGridViewProxyProtocols.ReadOnly = false;
|
dataGridViewProxyProtocols.ReadOnly = false;
|
||||||
dataGridViewProxyProtocols.AllowUserToAddRows = false;
|
dataGridViewProxyProtocols.AllowUserToAddRows = false;
|
||||||
dataGridViewProxyProtocols.RowHeadersVisible = false;
|
dataGridViewProxyProtocols.RowHeadersVisible = false;
|
||||||
dataGridViewProxyProtocols.MultiSelect = false;
|
dataGridViewProxyProtocols.MultiSelect = false;
|
||||||
dataGridViewProxyProtocols.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
dataGridViewProxyProtocols.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||||
|
|
||||||
|
|
||||||
dataGridViewPermittedProcesses.Columns[IntColumnProcessActive ].ValueType = typeof(Boolean);
|
dataGridViewPermittedProcesses.Columns[IntColumnProcessActive].ValueType = typeof(Boolean);
|
||||||
dataGridViewPermittedProcesses.Columns[IntColumnProcessOS ].ValueType = typeof(String);
|
dataGridViewPermittedProcesses.Columns[IntColumnProcessOS].ValueType = typeof(String);
|
||||||
dataGridViewPermittedProcesses.Columns[IntColumnProcessExecutable].ValueType = typeof(String);
|
dataGridViewPermittedProcesses.Columns[IntColumnProcessExecutable].ValueType = typeof(String);
|
||||||
dataGridViewPermittedProcesses.Columns[IntColumnProcessTitle ].ValueType = typeof(String);
|
dataGridViewPermittedProcesses.Columns[IntColumnProcessTitle].ValueType = typeof(String);
|
||||||
|
|
||||||
dataGridViewPermittedProcessArguments.Columns[IntColumnProcessActive ].ValueType = typeof(Boolean);
|
dataGridViewPermittedProcessArguments.Columns[IntColumnProcessActive].ValueType = typeof(Boolean);
|
||||||
dataGridViewPermittedProcessArguments.Columns[IntColumnProcessArgument].ValueType = typeof(String);
|
dataGridViewPermittedProcessArguments.Columns[IntColumnProcessArgument].ValueType = typeof(String);
|
||||||
|
|
||||||
dataGridViewProhibitedProcesses.Columns[IntColumnProcessActive ].ValueType = typeof(Boolean);
|
dataGridViewProhibitedProcesses.Columns[IntColumnProcessActive].ValueType = typeof(Boolean);
|
||||||
dataGridViewProhibitedProcesses.Columns[IntColumnProcessOS ].ValueType = typeof(String);
|
dataGridViewProhibitedProcesses.Columns[IntColumnProcessOS].ValueType = typeof(String);
|
||||||
dataGridViewProhibitedProcesses.Columns[IntColumnProcessExecutable ].ValueType = typeof(String);
|
dataGridViewProhibitedProcesses.Columns[IntColumnProcessExecutable].ValueType = typeof(String);
|
||||||
dataGridViewProhibitedProcesses.Columns[IntColumnProcessDescription].ValueType = typeof(String);
|
dataGridViewProhibitedProcesses.Columns[IntColumnProcessDescription].ValueType = typeof(String);
|
||||||
|
|
||||||
dataGridViewEmbeddedCertificates.Columns[IntColumnCertificateType].ValueType = typeof(String);
|
dataGridViewEmbeddedCertificates.Columns[IntColumnCertificateType].ValueType = typeof(String);
|
||||||
dataGridViewEmbeddedCertificates.Columns[IntColumnCertificateName].ValueType = typeof(String);
|
dataGridViewEmbeddedCertificates.Columns[IntColumnCertificateName].ValueType = typeof(String);
|
||||||
|
|
||||||
dataGridViewProxyProtocols.Columns[IntColumnProxyProtocolEnable].ValueType = typeof(Boolean);
|
dataGridViewProxyProtocols.Columns[IntColumnProxyProtocolEnable].ValueType = typeof(Boolean);
|
||||||
dataGridViewProxyProtocols.Columns[IntColumnProxyProtocolType ].ValueType = typeof(String);
|
dataGridViewProxyProtocols.Columns[IntColumnProxyProtocolType].ValueType = typeof(String);
|
||||||
|
|
||||||
dataGridViewProxyProtocols.Columns[IntColumnProxyProtocolEnable].ReadOnly = false;
|
dataGridViewProxyProtocols.Columns[IntColumnProxyProtocolEnable].ReadOnly = false;
|
||||||
dataGridViewProxyProtocols.Columns[IntColumnProxyProtocolType ].ReadOnly = true;
|
dataGridViewProxyProtocols.Columns[IntColumnProxyProtocolType].ReadOnly = true;
|
||||||
|
|
||||||
// Assign the column names to the DataGridViews
|
// Assign the column names to the DataGridViews
|
||||||
/*
|
/*
|
||||||
dataGridViewPermittedProcesses.Columns.Add(StringColumnActive , StringColumnActive);
|
dataGridViewPermittedProcesses.Columns.Add(StringColumnActive , StringColumnActive);
|
||||||
dataGridViewPermittedProcesses.Columns.Add(StringColumnOS , StringColumnOS);
|
dataGridViewPermittedProcesses.Columns.Add(StringColumnOS , StringColumnOS);
|
||||||
dataGridViewPermittedProcesses.Columns.Add(StringColumnExecutable, StringColumnExecutable);
|
dataGridViewPermittedProcesses.Columns.Add(StringColumnExecutable, StringColumnExecutable);
|
||||||
dataGridViewPermittedProcesses.Columns.Add(StringColumnTitle , StringColumnTitle);
|
dataGridViewPermittedProcesses.Columns.Add(StringColumnTitle , StringColumnTitle);
|
||||||
|
|
||||||
dataGridViewPermittedProcessArguments.Columns.Add(StringColumnActive , StringColumnActive);
|
dataGridViewPermittedProcessArguments.Columns.Add(StringColumnActive , StringColumnActive);
|
||||||
dataGridViewPermittedProcessArguments.Columns.Add(StringColumnArgument, StringColumnArgument);
|
dataGridViewPermittedProcessArguments.Columns.Add(StringColumnArgument, StringColumnArgument);
|
||||||
|
|
||||||
dataGridViewProhibitedProcesses.Columns.Add(StringColumnActive , StringColumnActive);
|
dataGridViewProhibitedProcesses.Columns.Add(StringColumnActive , StringColumnActive);
|
||||||
dataGridViewProhibitedProcesses.Columns.Add(StringColumnOS , StringColumnOS);
|
dataGridViewProhibitedProcesses.Columns.Add(StringColumnOS , StringColumnOS);
|
||||||
dataGridViewProhibitedProcesses.Columns.Add(StringColumnExecutable , StringColumnExecutable);
|
dataGridViewProhibitedProcesses.Columns.Add(StringColumnExecutable , StringColumnExecutable);
|
||||||
dataGridViewProhibitedProcesses.Columns.Add(StringColumnDescription, StringColumnDescription);
|
dataGridViewProhibitedProcesses.Columns.Add(StringColumnDescription, StringColumnDescription);
|
||||||
|
|
||||||
dataGridViewURLFilterRules.Columns.Add(StringColumnURLFilterRuleShow , StringColumnURLFilterRuleShow);
|
dataGridViewURLFilterRules.Columns.Add(StringColumnURLFilterRuleShow , StringColumnURLFilterRuleShow);
|
||||||
dataGridViewURLFilterRules.Columns.Add(StringColumnURLFilterRuleActive , StringColumnURLFilterRuleActive);
|
dataGridViewURLFilterRules.Columns.Add(StringColumnURLFilterRuleActive , StringColumnURLFilterRuleActive);
|
||||||
dataGridViewURLFilterRules.Columns.Add(StringColumnURLFilterRuleRegex , StringColumnURLFilterRuleRegex);
|
dataGridViewURLFilterRules.Columns.Add(StringColumnURLFilterRuleRegex , StringColumnURLFilterRuleRegex);
|
||||||
dataGridViewURLFilterRules.Columns.Add(StringColumnURLFilterRuleExpression, StringColumnURLFilterRuleExpression);
|
dataGridViewURLFilterRules.Columns.Add(StringColumnURLFilterRuleExpression, StringColumnURLFilterRuleExpression);
|
||||||
dataGridViewURLFilterRules.Columns.Add(StringColumnURLFilterRuleAction , StringColumnURLFilterRuleAction);
|
dataGridViewURLFilterRules.Columns.Add(StringColumnURLFilterRuleAction , StringColumnURLFilterRuleAction);
|
||||||
|
|
||||||
dataGridViewEmbeddedCertificates.Columns.Add(StringColumnCertificateType, StringColumnCertificateType);
|
dataGridViewEmbeddedCertificates.Columns.Add(StringColumnCertificateType, StringColumnCertificateType);
|
||||||
dataGridViewEmbeddedCertificates.Columns.Add(StringColumnCertificateName, StringColumnCertificateName);
|
dataGridViewEmbeddedCertificates.Columns.Add(StringColumnCertificateName, StringColumnCertificateName);
|
||||||
|
|
||||||
dataGridViewProxyProtocols.Columns.Add(StringColumnProxyProtocolEnable, StringColumnProxyProtocolEnable);
|
dataGridViewProxyProtocols.Columns.Add(StringColumnProxyProtocolEnable, StringColumnProxyProtocolEnable);
|
||||||
dataGridViewProxyProtocols.Columns.Add(StringColumnProxyProtocolType , StringColumnProxyProtocolType);
|
dataGridViewProxyProtocols.Columns.Add(StringColumnProxyProtocolType , StringColumnProxyProtocolType);
|
||||||
|
|
||||||
dataGridViewBypassedProxies.Columns.Add(StringColumnDomainHostPort, StringColumnDomainHostPort);
|
dataGridViewBypassedProxies.Columns.Add(StringColumnDomainHostPort, StringColumnDomainHostPort);
|
||||||
*/
|
*/
|
||||||
groupBoxPermittedProcess .Enabled = false;
|
groupBoxPermittedProcess.Enabled = false;
|
||||||
groupBoxProhibitedProcess.Enabled = false;
|
groupBoxProhibitedProcess.Enabled = false;
|
||||||
|
|
||||||
listBoxPermittedProcessOS .Items.AddRange(StringOS);
|
listBoxPermittedProcessOS.Items.AddRange(StringOS);
|
||||||
listBoxProhibitedProcessOS.Items.AddRange(StringOS);
|
listBoxProhibitedProcessOS.Items.AddRange(StringOS);
|
||||||
|
|
||||||
// Auto-resize the columns and cells
|
// Auto-resize the columns and cells
|
||||||
//dataGridViewPermittedProcesses .AutoResizeColumns();
|
//dataGridViewPermittedProcesses .AutoResizeColumns();
|
||||||
//dataGridViewProhibitedProcesses .AutoResizeColumns();
|
//dataGridViewProhibitedProcesses .AutoResizeColumns();
|
||||||
//dataGridViewURLFilterRules .AutoResizeColumns();
|
//dataGridViewURLFilterRules .AutoResizeColumns();
|
||||||
//dataGridViewEmbeddedCertificates.AutoResizeColumns();
|
//dataGridViewEmbeddedCertificates.AutoResizeColumns();
|
||||||
//dataGridViewProxyProtocols .AutoResizeColumns();
|
//dataGridViewProxyProtocols .AutoResizeColumns();
|
||||||
//dataGridViewBypassedProxies .AutoResizeColumns();
|
//dataGridViewBypassedProxies .AutoResizeColumns();
|
||||||
|
|
||||||
//dataGridViewPermittedProcesses .AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
|
//dataGridViewPermittedProcesses .AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
|
||||||
//dataGridViewProhibitedProcesses .AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
|
//dataGridViewProhibitedProcesses .AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
|
||||||
//dataGridViewURLFilterRules .AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
|
//dataGridViewURLFilterRules .AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
|
||||||
//dataGridViewEmbeddedCertificates.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
|
//dataGridViewEmbeddedCertificates.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
|
||||||
//dataGridViewProxyProtocols .AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
|
//dataGridViewProxyProtocols .AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
|
||||||
//dataGridViewBypassedProxies .AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
|
//dataGridViewBypassedProxies .AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end of class SebWindowsConfigForm
|
} // end of class SebWindowsConfigForm
|
||||||
|
|
|
@ -6,6 +6,7 @@ using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using System.Security.Cryptography.X509Certificates;
|
using System.Security.Cryptography.X509Certificates;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
@ -51,6 +52,13 @@ namespace SebWindowsConfig.Utilities
|
||||||
{
|
{
|
||||||
public class SEBProtectionController
|
public class SEBProtectionController
|
||||||
{
|
{
|
||||||
|
const string DLL_NAME =
|
||||||
|
#if X86
|
||||||
|
"seb_x86.dll";
|
||||||
|
#else
|
||||||
|
"seb_x64.dll";
|
||||||
|
#endif
|
||||||
|
|
||||||
// Prefix
|
// Prefix
|
||||||
private const int PREFIX_LENGTH = 4;
|
private const int PREFIX_LENGTH = 4;
|
||||||
private const string PUBLIC_KEY_HASH_MODE = "pkhs";
|
private const string PUBLIC_KEY_HASH_MODE = "pkhs";
|
||||||
|
@ -64,7 +72,7 @@ namespace SebWindowsConfig.Utilities
|
||||||
// RNCryptor non-secret payload (header)
|
// RNCryptor non-secret payload (header)
|
||||||
// First byte: Data format version. Currently 2.
|
// First byte: Data format version. Currently 2.
|
||||||
// Second byte: Options, bit 0 - uses password (so currently 1).
|
// Second byte: Options, bit 0 - uses password (so currently 1).
|
||||||
private static byte[] RNCRYPTOR_HEADER = new byte[] { 0x02, 0x01 };
|
private static readonly byte[] RNCRYPTOR_HEADER = new byte[] { 0x02, 0x01 };
|
||||||
|
|
||||||
enum EncryptionT
|
enum EncryptionT
|
||||||
{
|
{
|
||||||
|
@ -572,22 +580,72 @@ namespace SebWindowsConfig.Utilities
|
||||||
/// ----------------------------------------------------------------------------------------
|
/// ----------------------------------------------------------------------------------------
|
||||||
public static string ComputeBrowserExamKey()
|
public static string ComputeBrowserExamKey()
|
||||||
{
|
{
|
||||||
|
var browserExamKey = default(string);
|
||||||
|
var configurationKey = ComputeConfigurationKey();
|
||||||
var executable = Assembly.GetExecutingAssembly();
|
var executable = Assembly.GetExecutingAssembly();
|
||||||
var certificate = executable.Modules.First().GetSignerCertificate();
|
var certificate = executable.Modules.First().GetSignerCertificate();
|
||||||
var salt = (byte[]) SEBSettings.settingsCurrent[SEBSettings.KeyExamKeySalt];
|
var salt = (byte[]) SEBSettings.settingsCurrent[SEBSettings.KeyExamKeySalt];
|
||||||
var signature = certificate?.GetCertHashString();
|
var signature = certificate?.GetCertHashString();
|
||||||
var version = FileVersionInfo.GetVersionInfo(executable.Location).FileVersion;
|
var version = FileVersionInfo.GetVersionInfo(executable.Location).FileVersion;
|
||||||
var configurationKey = ComputeConfigurationKey();
|
|
||||||
|
|
||||||
using (var algorithm = new HMACSHA256(salt))
|
Logger.AddInformation("Initializing browser exam key...");
|
||||||
|
|
||||||
|
if (configurationKey == default)
|
||||||
{
|
{
|
||||||
var hash = algorithm.ComputeHash(Encoding.UTF8.GetBytes(signature + version + configurationKey));
|
configurationKey = "";
|
||||||
var key = BitConverter.ToString(hash).ToLower().Replace("-", string.Empty);
|
Logger.AddWarning("The current configuration does not contain a value for the configuration key!");
|
||||||
|
|
||||||
return key;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (salt == default || salt.Length == 0)
|
||||||
|
{
|
||||||
|
salt = new byte[0];
|
||||||
|
Logger.AddWarning("The current configuration does not contain a salt value for the browser exam key!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TryCalculateBrowserExamKey(configurationKey, BitConverter.ToString(salt).ToLower().Replace("-", string.Empty), out browserExamKey))
|
||||||
|
{
|
||||||
|
Logger.AddInformation("Successfully calculated BEK using integrity module.");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Logger.AddWarning("Failed to calculate BEK using integrity module! Falling back to simplified calculation...");
|
||||||
|
|
||||||
|
using (var algorithm = new HMACSHA256(salt))
|
||||||
|
{
|
||||||
|
var hash = algorithm.ComputeHash(Encoding.UTF8.GetBytes(signature + version + configurationKey));
|
||||||
|
var key = BitConverter.ToString(hash).ToLower().Replace("-", string.Empty);
|
||||||
|
|
||||||
|
browserExamKey = key;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return browserExamKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static bool TryCalculateBrowserExamKey(string configurationKey, string salt, out string browserExamKey)
|
||||||
|
{
|
||||||
|
browserExamKey = default;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
browserExamKey = CalculateBrowserExamKey(configurationKey, salt);
|
||||||
|
}
|
||||||
|
catch (DllNotFoundException)
|
||||||
|
{
|
||||||
|
Logger.AddWarning("Integrity module is not available!");
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Logger.AddError("Unexpected error while attempting to calculate browser exam key!", default, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return browserExamKey != default;
|
||||||
|
}
|
||||||
|
|
||||||
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
[return: MarshalAs(UnmanagedType.BStr)]
|
||||||
|
private static extern string CalculateBrowserExamKey(string configurationKey, string salt);
|
||||||
|
|
||||||
/// ----------------------------------------------------------------------------------------
|
/// ----------------------------------------------------------------------------------------
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Compute a Configuration Key SHA256 hash base16 string.
|
/// Compute a Configuration Key SHA256 hash base16 string.
|
||||||
|
|
Loading…
Add table
Reference in a new issue