summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-04-17 11:09:33 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-04-17 11:09:33 -0400
commiteafb51959225d871b94136b7b02c5cf7752d49be (patch)
tree4a1a73b574b9719c1b8b0ca4e2763afbadc9b1c3
parent3d2a0f68b53dd6045558c232f5e5d860dde3ff91 (diff)
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.
-rw-r--r--Crypto.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Crypto.hs b/Crypto.hs
index e42a21e28..12c70ef04 100644
--- a/Crypto.hs
+++ b/Crypto.hs
@@ -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