mirror of
https://github.com/bitwarden/mobile
synced 2026-01-06 02:23:57 +00:00
use random key for double hmac comparisons
This commit is contained in:
@@ -386,7 +386,7 @@ namespace Bit.App.Services
|
||||
if(EncKey?.MacKey != null && !string.IsNullOrWhiteSpace(encyptedValue.Mac))
|
||||
{
|
||||
var computedMacBytes = Crypto.ComputeMac(encyptedValue.CipherTextBytes, EncKey.MacKey);
|
||||
if(!Crypto.MacsEqual(EncKey.MacKey, computedMacBytes, encyptedValue.MacBytes))
|
||||
if(!Crypto.MacsEqual(computedMacBytes, encyptedValue.MacBytes))
|
||||
{
|
||||
throw new InvalidOperationException("MAC failed.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user