mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
Resolved bug when unable to decrypt the confCons file. The app will now exit without attempting to save the cons file (avoiding data corruption issues)
This commit is contained in:
@@ -436,8 +436,7 @@ namespace mRemoteNG.App
|
||||
|
||||
public static void SaveConnections(bool update = false)
|
||||
{
|
||||
//if (!IsConnectionsFileLoaded)
|
||||
// return;
|
||||
if (ConnectionTreeModel == null) return;
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -235,10 +235,9 @@ namespace mRemoteNG.Security.SymmetricEncryption
|
||||
var len = _aeadBlockCipher.ProcessBytes(cipherText, 0, cipherText.Length, plainText, 0);
|
||||
_aeadBlockCipher.DoFinal(plainText, len);
|
||||
}
|
||||
catch (InvalidCipherTextException)
|
||||
catch (InvalidCipherTextException e)
|
||||
{
|
||||
//Return null if it doesn't authenticate
|
||||
return null;
|
||||
throw new Exception("Unable to decrypt text", e);
|
||||
}
|
||||
|
||||
return plainText;
|
||||
|
||||
Reference in New Issue
Block a user