From cd2e8810206aa106b9dc16cb8993ec03958caeff Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 19 Apr 2017 16:47:44 -0400 Subject: [PATCH] handle legacy encrypt-then-mac cipher string --- src/Core/Utilities/EncryptedValueAttribute.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Core/Utilities/EncryptedValueAttribute.cs b/src/Core/Utilities/EncryptedValueAttribute.cs index 016e2c7d76..c533e8303b 100644 --- a/src/Core/Utilities/EncryptedValueAttribute.cs +++ b/src/Core/Utilities/EncryptedValueAttribute.cs @@ -34,7 +34,14 @@ namespace Bit.Core.Utilities if(headerPieces.Length == 1) { encStringPieces = headerPieces[0].Split('|'); - // encType stays AesCbc256_B64 + if(encStringPieces.Length == 3) + { + encType = Enums.EncryptionType.AesCbc128_HmacSha256_B64; + } + else + { + encType = Enums.EncryptionType.AesCbc256_B64; + } } else if(headerPieces.Length == 2) {