From 9e17c2e50c655d60a0d09d26806c70111e903124 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 2 Jan 2017 21:52:48 -0500 Subject: [PATCH] Allow mac for EncryptedString --- src/Api/Utilities/EncryptedValueAttribute.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Api/Utilities/EncryptedValueAttribute.cs b/src/Api/Utilities/EncryptedValueAttribute.cs index 74d3b5c39d..65408c1662 100644 --- a/src/Api/Utilities/EncryptedValueAttribute.cs +++ b/src/Api/Utilities/EncryptedValueAttribute.cs @@ -28,7 +28,7 @@ namespace Bit.Api.Utilities } var encStringPieces = encString.Split('|'); - if(encStringPieces.Length != 2) + if(encStringPieces.Length != 2 && encStringPieces.Length != 3) { return false; } @@ -40,6 +40,15 @@ namespace Bit.Api.Utilities { return false; } + + if(encStringPieces.Length == 3) + { + var mac = Convert.FromBase64String(encStringPieces[2]); + if(mac.Length < 1) + { + return false; + } + } } catch {