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:
David Sparer
2016-10-12 09:00:28 -06:00
parent e2929f43a3
commit 55fe30b02c
2 changed files with 3 additions and 5 deletions

View File

@@ -436,8 +436,7 @@ namespace mRemoteNG.App
public static void SaveConnections(bool update = false)
{
//if (!IsConnectionsFileLoaded)
// return;
if (ConnectionTreeModel == null) return;
try
{

View File

@@ -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;