From 55fe30b02cb77cd2e5a4ffb5d34a5cbb391cf6aa Mon Sep 17 00:00:00 2001 From: David Sparer Date: Wed, 12 Oct 2016 09:00:28 -0600 Subject: [PATCH] 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) --- mRemoteV1/App/Runtime.cs | 3 +-- .../Security/SymmetricEncryption/AeadCryptographyProvider.cs | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/mRemoteV1/App/Runtime.cs b/mRemoteV1/App/Runtime.cs index 3380f3d30..3c2b67f42 100644 --- a/mRemoteV1/App/Runtime.cs +++ b/mRemoteV1/App/Runtime.cs @@ -436,8 +436,7 @@ namespace mRemoteNG.App public static void SaveConnections(bool update = false) { - //if (!IsConnectionsFileLoaded) - // return; + if (ConnectionTreeModel == null) return; try { diff --git a/mRemoteV1/Security/SymmetricEncryption/AeadCryptographyProvider.cs b/mRemoteV1/Security/SymmetricEncryption/AeadCryptographyProvider.cs index 4ff0cf8c8..dbcf61123 100644 --- a/mRemoteV1/Security/SymmetricEncryption/AeadCryptographyProvider.cs +++ b/mRemoteV1/Security/SymmetricEncryption/AeadCryptographyProvider.cs @@ -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;