Fix Issue 4

Fix Issue 4
  *  Added in library for signing the generated RDP file
  *  Library requires the certificate to have a friendly name for it to show up in the drop down.  No friendly name, no certificate in dropdown
  *  Library detects the rdpsign.exe version to determine proper arguments (/sha1 or /sha256)
  *  Updated RemoteApp Tool to use new library and sign the RDP file after it is created
  *  Added in logic around the signing to prevent editing after creating the RDP file if signed
  *  Library allows for creating an unsigned backup along with the signed version, added ability to do the same in RemoteApp Tool
  *  Updated RemoteApp tool to use Visual Studio 2019, but allows for support back to some pervious versions
  *  Tested on Windows 10 and Windows Server 2008 R2 and was successful on both
This commit is contained in:
brianga
2019-10-31 15:24:29 -06:00
parent 93389f107e
commit 859ac87c17
16 changed files with 946 additions and 278 deletions

View File

@@ -8,6 +8,7 @@ Public Class RemoteAppCreateClientConnection
RemoteApp = SelectedRemoteApp
Dim rdpSign As New RDPSign.RDPSign
Dim RemoteAppShortName = RemoteApp.Name
Me.Text = "Create Client Connection for " & RemoteAppShortName
@@ -34,6 +35,8 @@ Public Class RemoteAppCreateClientConnection
If Not RemoteApp.FileTypeAssociations Is Nothing Then _
FTACountLabel.Text = "Count: " & RemoteApp.FileTypeAssociations.Count
CertificateComboBox.Items.AddRange(rdpSign.GetCertificateFriendlyName)
Me.RDPRadioButton.Focus()
HelpSystem.SetupTips(Me)
Me.ShowDialog()
@@ -285,6 +288,12 @@ Public Class RemoteAppCreateClientConnection
RDPfile.SaveRDPfile(RDPPath)
If Not CheckBoxSignRDPDisabled.Checked Then
Dim rdpSign As New RDPSign.RDPSign
Dim Thumbprint As String = rdpSign.GetThumbprint(CertificateComboBox.Text)
rdpSign.SignRDP(Thumbprint, RDPPath, CheckBoxCreateSignedAndUnsigned.Checked)
End If
End Sub
Private Function GetFlatFileTypesList(AppName As String, Optional Delim As String = ",") As String
@@ -354,4 +363,26 @@ Public Class RemoteAppCreateClientConnection
End If
End Sub
Private Sub CheckBoxSignRDPDisabled_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBoxSignRDPDisabled.CheckedChanged
CertificateComboBox.Enabled = Not CheckBoxSignRDPDisabled.Checked
CheckBoxCreateSignedAndUnsigned.Enabled = Not CheckBoxSignRDPDisabled.Checked
If (EditAfterSave.Checked And Not CheckBoxSignRDPDisabled.Checked) Then
If MessageBox.Show("Cannot edit after save and sign the RDP file. Do you want the RDP file to be signed?", "Sign RDP", MessageBoxButtons.YesNo) = DialogResult.Yes Then
EditAfterSave.Checked = False
Else
CheckBoxSignRDPDisabled.Checked = True
End If
End If
End Sub
Private Sub EditAfterSave_CheckedChanged(sender As Object, e As EventArgs) Handles EditAfterSave.CheckedChanged
If (EditAfterSave.Checked And Not CheckBoxSignRDPDisabled.Checked) Then
If MessageBox.Show("Cannot edit after save and sign the RDP file. Do you want to edit after saving?", "Edit After Save", MessageBoxButtons.YesNo) = DialogResult.Yes Then
CheckBoxSignRDPDisabled.Checked = True
Else
EditAfterSave.Checked = False
End If
End If
End Sub
End Class