hmacSha1 wants the secret key as first parameter

I was offline last night and going by function signatures, and unable to
tell which was which. Note sure it matters to HMAC which comes first;
better safe than sorry.
This commit is contained in:
Joey Hess 2011-04-17 11:09:33 -04:00
parent 3d2a0f68b5
commit eafb519592

View file

@ -131,8 +131,8 @@ encryptKey :: Cipher -> Key -> IO Key
encryptKey c k =
return Key {
keyName = showDigest $ hmacSha1
(fromString $ show k)
(fromString $ cipherHmac c),
(fromString $ cipherHmac c)
(fromString $ show k),
keyBackendName = "GPGHMACSHA1",
keySize = Nothing, -- size and mtime omitted
keyMtime = Nothing -- to avoid leaking data