From e863906eaa191af5e1f5890d6414067ca5adc82d Mon Sep 17 00:00:00 2001 From: David Sparer Date: Fri, 14 Dec 2018 07:31:50 -0600 Subject: [PATCH] added test validating that an empty password cannot be passed to an encryptor --- .../Security/AeadCryptographyProviderTests.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/mRemoteNGTests/Security/AeadCryptographyProviderTests.cs b/mRemoteNGTests/Security/AeadCryptographyProviderTests.cs index 065f48d17..b74a09405 100644 --- a/mRemoteNGTests/Security/AeadCryptographyProviderTests.cs +++ b/mRemoteNGTests/Security/AeadCryptographyProviderTests.cs @@ -1,11 +1,11 @@ -using System; -using System.Collections; -using System.Security; -using mRemoteNG.Security; +using mRemoteNG.Security; using mRemoteNG.Security.Factories; using mRemoteNG.Security.SymmetricEncryption; using NUnit.Framework; using NUnit.Framework.Constraints; +using System; +using System.Collections; +using System.Security; namespace mRemoteNGTests.Security @@ -97,6 +97,12 @@ namespace mRemoteNGTests.Security Assert.That(cryptoProvider.CipherMode, Is.EqualTo(mode)); } + [Test] + public void ProvidingEmptyEncryptionKeyThrowsException() + { + Assert.Throws(() => _cryptographyProvider.Encrypt(_plainText, new SecureString())); + } + private class TestCaseSources {