Skip to content

Commit

Permalink
Made the use of CredSSP for RDP connections optional.
Browse files Browse the repository at this point in the history
  • Loading branch information
rmcardle committed Feb 28, 2012
1 parent 7a7c6ae commit 9a283e5
Show file tree
Hide file tree
Showing 14 changed files with 165 additions and 12 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.TXT
Expand Up @@ -17,7 +17,8 @@
Improved error handling when loading connection files.
Fixed bugs with creating a new connection file.
A backup of the connection file is saved when it is loaded. The most recent ten backup copies are kept.
Added the option to use a smart card for RD Gateway credentials
Added the option to use a smart card for RD Gateway credentials.
Made the use of CredSSP for RDP connections optional.

1.69 (2011-12-09):
Fixed issue #66 - Fresh Install Fails to Create Config
Expand Down
2 changes: 1 addition & 1 deletion mRemoteV1/App/App.Info.vb
Expand Up @@ -36,7 +36,7 @@ Namespace App
Public Shared ReadOnly DefaultConnectionsPath As String = App.Info.Settings.SettingsPath
Public Shared ReadOnly DefaultConnectionsFile As String = "confCons.xml"
Public Shared ReadOnly DefaultConnectionsFileNew As String = "confConsNew.xml"
Public Shared ReadOnly ConnectionFileVersion As Double = 2.3
Public Shared ReadOnly ConnectionFileVersion As Double = 2.4
End Class

Public Class Credentials
Expand Down
4 changes: 3 additions & 1 deletion mRemoteV1/App/App.Runtime.vb
Expand Up @@ -663,6 +663,7 @@ Namespace App
My.Settings.ConDefaultICAEncryptionStrength = .ICAEncryption.ToString
My.Settings.ConDefaultRDPAuthenticationLevel = .RDPAuthenticationLevel.ToString
My.Settings.ConDefaultUseConsoleSession = .UseConsoleSession
My.Settings.ConDefaultUseCredSsp = .UseCredSsp
My.Settings.ConDefaultRenderingEngine = .RenderingEngine.ToString
My.Settings.ConDefaultResolution = .Resolution.ToString
My.Settings.ConDefaultColors = .Colors.ToString
Expand Down Expand Up @@ -723,6 +724,7 @@ Namespace App
My.Settings.InhDefaultPort = .Port
My.Settings.InhDefaultPuttySession = .PuttySession
My.Settings.InhDefaultUseConsoleSession = .UseConsoleSession
My.Settings.InhDefaultUseCredSsp = .UseCredSsp
My.Settings.InhDefaultRenderingEngine = .RenderingEngine
My.Settings.InhDefaultICAEncryptionStrength = .ICAEncryption
My.Settings.InhDefaultRDPAuthenticationLevel = .RDPAuthenticationLevel
Expand Down Expand Up @@ -894,7 +896,7 @@ Namespace App
xW.WriteAttributeString("Name", My.Language.strConnections)
xW.WriteAttributeString("Export", "", "False")
xW.WriteAttributeString("Protected", "", "GiUis20DIbnYzWPcdaQKfjE2H5jh//L5v4RGrJMGNXuIq2CttB/d/BxaBP2LwRhY")
xW.WriteAttributeString("ConfVersion", "", "2.3")
xW.WriteAttributeString("ConfVersion", "", "2.4")

xW.WriteEndElement()
xW.WriteEndDocument()
Expand Down
10 changes: 10 additions & 0 deletions mRemoteV1/Config/Config.Connections.Load.vb
Expand Up @@ -559,6 +559,11 @@ Namespace Config
conI.Inherit.EnableDesktopComposition = .Item("InheritEnableDesktopComposition")
End If

If confVersion >= 2.4 Then
conI.UseCredSsp = .Item("UseCredSsp")
conI.Inherit.UseCredSsp = .Item("InheritUseCredSsp")
End If

If SQLUpdate = True Then
conI.PleaseConnect = .Item("Connected")
End If
Expand Down Expand Up @@ -1027,6 +1032,11 @@ Namespace Config
conI.Inherit.EnableFontSmoothing = .Attributes("InheritEnableFontSmoothing").Value
conI.Inherit.EnableDesktopComposition = .Attributes("InheritEnableDesktopComposition").Value
End If

If confVersion >= 2.4 Then
conI.UseCredSsp = .Attributes("UseCredSsp").Value
conI.Inherit.UseCredSsp = .Attributes("InheritUseCredSsp").Value
End If
End With
Catch ex As Exception
MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, String.Format(My.Language.strGetConnectionInfoFromXmlFailed, conI.Name, Me.ConnectionFileName, ex.Message), False)
Expand Down
27 changes: 23 additions & 4 deletions mRemoteV1/Config/Config.Connections.Save.vb
Expand Up @@ -92,6 +92,13 @@ Namespace Config
End If

If databaseVersion.CompareTo(New System.Version(2, 3)) = 0 Then ' 2.3
MessageCollector.AddMessage(Messages.MessageClass.InformationMsg, String.Format("Upgrading database from version {0} to version {1}.", databaseVersion.ToString, "2.4"))
sqlCommand = New SqlCommand("ALTER TABLE tblCons ADD UseCredSsp bit NOT NULL DEFAULT 1, InheritUseCredSsp bit NOT NULL DEFAULT 0;", sqlConnection)
sqlCommand.ExecuteNonQuery()
databaseVersion = New Version(2, 4)
End If

If databaseVersion.CompareTo(New System.Version(2, 4)) = 0 Then ' 2.4
isVerified = True
End If

Expand Down Expand Up @@ -173,6 +180,7 @@ Namespace Config
"VNCProxyType, VNCProxyIP, VNCProxyPort, VNCProxyUsername, VNCProxyPassword, " & _
"VNCColors, VNCSmartSizeMode, VNCViewOnly, " & _
"RDGatewayUsageMethod, RDGatewayHostname, RDGatewayUseConnectionCredentials, RDGatewayUsername, RDGatewayPassword, RDGatewayDomain, " & _
"UseCredSsp, " & _
"InheritCacheBitmaps, InheritColors, " & _
"InheritDescription, InheritDisplayThemes, InheritDisplayWallpaper, InheritEnableFontSmoothing, InheritEnableDesktopComposition, InheritDomain, " & _
"InheritIcon, InheritPanel, InheritPassword, InheritPort, " & _
Expand All @@ -185,6 +193,7 @@ Namespace Config
"InheritVNCProxyUsername, InheritVNCProxyPassword, InheritVNCColors, " & _
"InheritVNCSmartSizeMode, InheritVNCViewOnly, " & _
"InheritRDGatewayUsageMethod, InheritRDGatewayHostname, InheritRDGatewayUseConnectionCredentials, InheritRDGatewayUsername, InheritRDGatewayPassword, InheritRDGatewayDomain, " & _
"InheritUseCredSsp, " & _
"PositionID, _parentConstantId, ConstantID, LastChange)" & _
"VALUES (", _sqlConnection)

Expand Down Expand Up @@ -311,6 +320,8 @@ Namespace Config
_sqlQuery.CommandText &= "'" & "" & "',"
End If

_sqlQuery.CommandText &= "'" & .UseCredSsp & "',"

With .Inherit
If Me._SaveSecurity.Inheritance = True Then
_sqlQuery.CommandText &= "'" & .CacheBitmaps & "',"
Expand Down Expand Up @@ -363,6 +374,8 @@ Namespace Config
_sqlQuery.CommandText &= "'" & .RDGatewayUsername & "',"
_sqlQuery.CommandText &= "'" & .RDGatewayPassword & "',"
_sqlQuery.CommandText &= "'" & .RDGatewayDomain & "',"

_sqlQuery.CommandText &= "'" & .UseCredSsp & "',"
Else
_sqlQuery.CommandText &= "'" & False & "',"
_sqlQuery.CommandText &= "'" & False & "',"
Expand Down Expand Up @@ -412,6 +425,8 @@ Namespace Config
_sqlQuery.CommandText &= "'" & False & "'," ' .RDGatewayUsername
_sqlQuery.CommandText &= "'" & False & "'," ' .RDGatewayPassword
_sqlQuery.CommandText &= "'" & False & "'," ' .RDGatewayDomain

_sqlQuery.CommandText &= "'" & False & "'," ' .UseCredSsp
End If
End With

Expand Down Expand Up @@ -574,6 +589,8 @@ Namespace Config

_xmlTextWriter.WriteAttributeString("ConnectToConsole", "", curConI.UseConsoleSession)

_xmlTextWriter.WriteAttributeString("UseCredSsp", "", curConI.UseCredSsp)

_xmlTextWriter.WriteAttributeString("RenderingEngine", "", curConI.RenderingEngine.ToString)

_xmlTextWriter.WriteAttributeString("ICAEncryptionStrength", "", curConI.ICAEncryption.ToString)
Expand Down Expand Up @@ -676,6 +693,7 @@ Namespace Config
_xmlTextWriter.WriteAttributeString("InheritRedirectSound", "", curConI.Inherit.RedirectSound)
_xmlTextWriter.WriteAttributeString("InheritResolution", "", curConI.Inherit.Resolution)
_xmlTextWriter.WriteAttributeString("InheritUseConsoleSession", "", curConI.Inherit.UseConsoleSession)
_xmlTextWriter.WriteAttributeString("InheritUseCredSsp", "", curConI.Inherit.UseCredSsp)
_xmlTextWriter.WriteAttributeString("InheritRenderingEngine", "", curConI.Inherit.RenderingEngine)
_xmlTextWriter.WriteAttributeString("InheritUsername", "", curConI.Inherit.Username)
_xmlTextWriter.WriteAttributeString("InheritICAEncryptionStrength", "", curConI.Inherit.ICAEncryption)
Expand Down Expand Up @@ -725,6 +743,7 @@ Namespace Config
_xmlTextWriter.WriteAttributeString("InheritRedirectSound", "", False)
_xmlTextWriter.WriteAttributeString("InheritResolution", "", False)
_xmlTextWriter.WriteAttributeString("InheritUseConsoleSession", "", False)
_xmlTextWriter.WriteAttributeString("InheritUseCredSsp", "", False)
_xmlTextWriter.WriteAttributeString("InheritRenderingEngine", "", False)
_xmlTextWriter.WriteAttributeString("InheritUsername", "", False)
_xmlTextWriter.WriteAttributeString("InheritICAEncryptionStrength", "", False)
Expand Down Expand Up @@ -790,10 +809,10 @@ Namespace Config
csvLn += "Domain;"
End If

csvLn += "Hostname;Protocol;PuttySession;Port;ConnectToConsole;RenderingEngine;ICAEncryptionStrength;RDPAuthenticationLevel;Colors;Resolution;DisplayWallpaper;DisplayThemes;EnableFontSmoothing;EnableDesktopComposition;CacheBitmaps;RedirectDiskDrives;RedirectPorts;RedirectPrinters;RedirectSmartCards;RedirectSound;RedirectKeys;PreExtApp;PostExtApp;MacAddress;UserField;ExtApp;VNCCompression;VNCEncoding;VNCAuthMode;VNCProxyType;VNCProxyIP;VNCProxyPort;VNCProxyUsername;VNCProxyPassword;VNCColors;VNCSmartSizeMode;VNCViewOnly;RDGatewayUsageMethod;RDGatewayHostname;RDGatewayUseConnectionCredentials;RDGatewayUsername;RDGatewayPassword;RDGatewayDomain;"
csvLn += "Hostname;Protocol;PuttySession;Port;ConnectToConsole;UseCredSsp;RenderingEngine;ICAEncryptionStrength;RDPAuthenticationLevel;Colors;Resolution;DisplayWallpaper;DisplayThemes;EnableFontSmoothing;EnableDesktopComposition;CacheBitmaps;RedirectDiskDrives;RedirectPorts;RedirectPrinters;RedirectSmartCards;RedirectSound;RedirectKeys;PreExtApp;PostExtApp;MacAddress;UserField;ExtApp;VNCCompression;VNCEncoding;VNCAuthMode;VNCProxyType;VNCProxyIP;VNCProxyPort;VNCProxyUsername;VNCProxyPassword;VNCColors;VNCSmartSizeMode;VNCViewOnly;RDGatewayUsageMethod;RDGatewayHostname;RDGatewayUseConnectionCredentials;RDGatewayUsername;RDGatewayPassword;RDGatewayDomain;"

If SaveSecurity.Inheritance Then
csvLn += "InheritCacheBitmaps;InheritColors;InheritDescription;InheritDisplayThemes;InheritDisplayWallpaper;InheritEnableFontSmoothing;InheritEnableDesktopComposition;InheritDomain;InheritIcon;InheritPanel;InheritPassword;InheritPort;InheritProtocol;InheritPuttySession;InheritRedirectDiskDrives;InheritRedirectKeys;InheritRedirectPorts;InheritRedirectPrinters;InheritRedirectSmartCards;InheritRedirectSound;InheritResolution;InheritUseConsoleSession;InheritRenderingEngine;InheritUsername;InheritICAEncryptionStrength;InheritRDPAuthenticationLevel;InheritPreExtApp;InheritPostExtApp;InheritMacAddress;InheritUserField;InheritExtApp;InheritVNCCompression;InheritVNCEncoding;InheritVNCAuthMode;InheritVNCProxyType;InheritVNCProxyIP;InheritVNCProxyPort;InheritVNCProxyUsername;InheritVNCProxyPassword;InheritVNCColors;InheritVNCSmartSizeMode;InheritVNCViewOnly;InheritRDGatewayUsageMethod;InheritRDGatewayHostname;InheritRDGatewayUseConnectionCredentials;InheritRDGatewayUsername;InheritRDGatewayPassword;InheritRDGatewayDomain"
csvLn += "InheritCacheBitmaps;InheritColors;InheritDescription;InheritDisplayThemes;InheritDisplayWallpaper;InheritEnableFontSmoothing;InheritEnableDesktopComposition;InheritDomain;InheritIcon;InheritPanel;InheritPassword;InheritPort;InheritProtocol;InheritPuttySession;InheritRedirectDiskDrives;InheritRedirectKeys;InheritRedirectPorts;InheritRedirectPrinters;InheritRedirectSmartCards;InheritRedirectSound;InheritResolution;InheritUseConsoleSession;InheritUseCredSsp;InheritRenderingEngine;InheritUsername;InheritICAEncryptionStrength;InheritRDPAuthenticationLevel;InheritPreExtApp;InheritPostExtApp;InheritMacAddress;InheritUserField;InheritExtApp;InheritVNCCompression;InheritVNCEncoding;InheritVNCAuthMode;InheritVNCProxyType;InheritVNCProxyIP;InheritVNCProxyPort;InheritVNCProxyUsername;InheritVNCProxyPassword;InheritVNCColors;InheritVNCSmartSizeMode;InheritVNCViewOnly;InheritRDGatewayUsageMethod;InheritRDGatewayHostname;InheritRDGatewayUseConnectionCredentials;InheritRDGatewayUsername;InheritRDGatewayPassword;InheritRDGatewayDomain"
End If

csvWr.WriteLine(csvLn)
Expand Down Expand Up @@ -844,10 +863,10 @@ Namespace Config
csvLn += con.Domain & ";"
End If

csvLn += con.Hostname & ";" & con.Protocol.ToString & ";" & con.PuttySession & ";" & con.Port & ";" & con.UseConsoleSession & ";" & con.RenderingEngine.ToString & ";" & con.ICAEncryption.ToString & ";" & con.RDPAuthenticationLevel.ToString & ";" & con.Colors.ToString & ";" & con.Resolution.ToString & ";" & con.DisplayWallpaper & ";" & con.DisplayThemes & ";" & con.EnableFontSmoothing & ";" & con.EnableDesktopComposition & ";" & con.CacheBitmaps & ";" & con.RedirectDiskDrives & ";" & con.RedirectPorts & ";" & con.RedirectPrinters & ";" & con.RedirectSmartCards & ";" & con.RedirectSound.ToString & ";" & con.RedirectKeys & ";" & con.PreExtApp & ";" & con.PostExtApp & ";" & con.MacAddress & ";" & con.UserField & ";" & con.ExtApp & ";" & con.VNCCompression.ToString & ";" & con.VNCEncoding.ToString & ";" & con.VNCAuthMode.ToString & ";" & con.VNCProxyType.ToString & ";" & con.VNCProxyIP & ";" & con.VNCProxyPort & ";" & con.VNCProxyUsername & ";" & con.VNCProxyPassword & ";" & con.VNCColors.ToString & ";" & con.VNCSmartSizeMode.ToString & ";" & con.VNCViewOnly & ";"
csvLn += con.Hostname & ";" & con.Protocol.ToString & ";" & con.PuttySession & ";" & con.Port & ";" & con.UseConsoleSession & ";" & con.UseCredSsp & ";" & con.RenderingEngine.ToString & ";" & con.ICAEncryption.ToString & ";" & con.RDPAuthenticationLevel.ToString & ";" & con.Colors.ToString & ";" & con.Resolution.ToString & ";" & con.DisplayWallpaper & ";" & con.DisplayThemes & ";" & con.EnableFontSmoothing & ";" & con.EnableDesktopComposition & ";" & con.CacheBitmaps & ";" & con.RedirectDiskDrives & ";" & con.RedirectPorts & ";" & con.RedirectPrinters & ";" & con.RedirectSmartCards & ";" & con.RedirectSound.ToString & ";" & con.RedirectKeys & ";" & con.PreExtApp & ";" & con.PostExtApp & ";" & con.MacAddress & ";" & con.UserField & ";" & con.ExtApp & ";" & con.VNCCompression.ToString & ";" & con.VNCEncoding.ToString & ";" & con.VNCAuthMode.ToString & ";" & con.VNCProxyType.ToString & ";" & con.VNCProxyIP & ";" & con.VNCProxyPort & ";" & con.VNCProxyUsername & ";" & con.VNCProxyPassword & ";" & con.VNCColors.ToString & ";" & con.VNCSmartSizeMode.ToString & ";" & con.VNCViewOnly & ";"

If SaveSecurity.Inheritance Then
csvLn += con.Inherit.CacheBitmaps & ";" & con.Inherit.Colors & ";" & con.Inherit.Description & ";" & con.Inherit.DisplayThemes & ";" & con.Inherit.DisplayWallpaper & ";" & con.Inherit.EnableFontSmoothing & ";" & con.Inherit.EnableDesktopComposition & ";" & con.Inherit.Domain & ";" & con.Inherit.Icon & ";" & con.Inherit.Panel & ";" & con.Inherit.Password & ";" & con.Inherit.Port & ";" & con.Inherit.Protocol & ";" & con.Inherit.PuttySession & ";" & con.Inherit.RedirectDiskDrives & ";" & con.Inherit.RedirectKeys & ";" & con.Inherit.RedirectPorts & ";" & con.Inherit.RedirectPrinters & ";" & con.Inherit.RedirectSmartCards & ";" & con.Inherit.RedirectSound & ";" & con.Inherit.Resolution & ";" & con.Inherit.UseConsoleSession & ";" & con.Inherit.RenderingEngine & ";" & con.Inherit.Username & ";" & con.Inherit.ICAEncryption & ";" & con.Inherit.RDPAuthenticationLevel & ";" & con.Inherit.PreExtApp & ";" & con.Inherit.PostExtApp & ";" & con.Inherit.MacAddress & ";" & con.Inherit.UserField & ";" & con.Inherit.ExtApp & ";" & con.Inherit.VNCCompression & ";" & con.Inherit.VNCEncoding & ";" & con.Inherit.VNCAuthMode & ";" & con.Inherit.VNCProxyType & ";" & con.Inherit.VNCProxyIP & ";" & con.Inherit.VNCProxyPort & ";" & con.Inherit.VNCProxyUsername & ";" & con.Inherit.VNCProxyPassword & ";" & con.Inherit.VNCColors & ";" & con.Inherit.VNCSmartSizeMode & ";" & con.Inherit.VNCViewOnly
csvLn += con.Inherit.CacheBitmaps & ";" & con.Inherit.Colors & ";" & con.Inherit.Description & ";" & con.Inherit.DisplayThemes & ";" & con.Inherit.DisplayWallpaper & ";" & con.Inherit.EnableFontSmoothing & ";" & con.Inherit.EnableDesktopComposition & ";" & con.Inherit.Domain & ";" & con.Inherit.Icon & ";" & con.Inherit.Panel & ";" & con.Inherit.Password & ";" & con.Inherit.Port & ";" & con.Inherit.Protocol & ";" & con.Inherit.PuttySession & ";" & con.Inherit.RedirectDiskDrives & ";" & con.Inherit.RedirectKeys & ";" & con.Inherit.RedirectPorts & ";" & con.Inherit.RedirectPrinters & ";" & con.Inherit.RedirectSmartCards & ";" & con.Inherit.RedirectSound & ";" & con.Inherit.Resolution & ";" & con.Inherit.UseConsoleSession & ";" & con.Inherit.UseCredSsp & ";" & con.Inherit.RenderingEngine & ";" & con.Inherit.Username & ";" & con.Inherit.ICAEncryption & ";" & con.Inherit.RDPAuthenticationLevel & ";" & con.Inherit.PreExtApp & ";" & con.Inherit.PostExtApp & ";" & con.Inherit.MacAddress & ";" & con.Inherit.UserField & ";" & con.Inherit.ExtApp & ";" & con.Inherit.VNCCompression & ";" & con.Inherit.VNCEncoding & ";" & con.Inherit.VNCAuthMode & ";" & con.Inherit.VNCProxyType & ";" & con.Inherit.VNCProxyIP & ";" & con.Inherit.VNCProxyPort & ";" & con.Inherit.VNCProxyUsername & ";" & con.Inherit.VNCProxyPassword & ";" & con.Inherit.VNCColors & ";" & con.Inherit.VNCSmartSizeMode & ";" & con.Inherit.VNCViewOnly
End If

csvWr.WriteLine(csvLn)
Expand Down

0 comments on commit 9a283e5

Please sign in to comment.