From 4571399c6fb589a657d07ce6e439f20df8681242 Mon Sep 17 00:00:00 2001 From: Andrew Buss Date: Sat, 5 Dec 2015 20:09:28 -0800 Subject: [PATCH] Include Usages field when computing HMAC --- cryptor/cryptor.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cryptor/cryptor.go b/cryptor/cryptor.go index 7223801..620e7d1 100644 --- a/cryptor/cryptor.go +++ b/cryptor/cryptor.go @@ -223,6 +223,10 @@ func (encrypted *EncryptedData) computeHmac(key []byte) []byte { mac.Write([]byte(usage)) } + for index := range encrypted.Usages { + mac.Write([]byte(encrypted.Usages[index])) + } + return mac.Sum(nil) }