From 01878ef00c621d8da4c27c61afa7093568c39290 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 18 Jan 2018 08:39:34 -0500 Subject: [PATCH] check that mac always exists if key has MacKey --- src/App/Utilities/Crypto.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/App/Utilities/Crypto.cs b/src/App/Utilities/Crypto.cs index 46c6fdef8..36eb9f8b8 100644 --- a/src/App/Utilities/Crypto.cs +++ b/src/App/Utilities/Crypto.cs @@ -82,6 +82,11 @@ namespace Bit.App.Utilities throw new ArgumentNullException(nameof(iv)); } + if(key.MacKey != null && mac == null) + { + throw new ArgumentNullException(nameof(mac)); + } + if(key.EncryptionType != type) { throw new InvalidOperationException(nameof(type));