check that mac always exists if key has MacKey

This commit is contained in:
Kyle Spearrin 2018-01-18 08:39:34 -05:00
parent 6f119f25f4
commit 01878ef00c

View file

@ -82,6 +82,11 @@ namespace Bit.App.Utilities
throw new ArgumentNullException(nameof(iv)); throw new ArgumentNullException(nameof(iv));
} }
if(key.MacKey != null && mac == null)
{
throw new ArgumentNullException(nameof(mac));
}
if(key.EncryptionType != type) if(key.EncryptionType != type)
{ {
throw new InvalidOperationException(nameof(type)); throw new InvalidOperationException(nameof(type));