1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-05 18:13:36 +00:00

hmac check on rsa decrypt

This commit is contained in:
Kyle Spearrin
2017-06-19 11:57:37 -04:00
parent 1e5883f028
commit 7823ec3fc8
4 changed files with 43 additions and 10 deletions

View File

@@ -63,6 +63,15 @@ namespace Bit.App.Models
}
CipherText = encPieces[0];
break;
case EncryptionType.Rsa2048_OaepSha1_HmacSha256_B64:
case EncryptionType.Rsa2048_OaepSha256_HmacSha256_B64:
if(encPieces.Length != 2)
{
throw new ArgumentException("Malformed encPieces.");
}
CipherText = encPieces[0];
Mac = encPieces[1];
break;
default:
throw new ArgumentException("Unknown encType.");
}