summaryrefslogtreecommitdiff
path: root/Utility
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-09-08 02:02:39 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-09-08 02:02:39 -0400
commit0c01348b65bb3d0364f90ce9785236fa05985f75 (patch)
treec96bb6612882c6db04a8a4b48f34dead0f6ec3c6 /Utility
parent3bee6b3c74cede7c9099e6bf298ffa585ebf3b80 (diff)
pairing passphrase entry form, validation, etc
Actually 3 forms in one, this handles the initial passphrase entry, and the confirmation, and also varys wording if the same user or a different user is confirming.
Diffstat (limited to 'Utility')
-rw-r--r--Utility/Verifiable.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Utility/Verifiable.hs b/Utility/Verifiable.hs
index 58218db2a..b177787c4 100644
--- a/Utility/Verifiable.hs
+++ b/Utility/Verifiable.hs
@@ -16,8 +16,8 @@ type HMACDigest = String
{- A value, verifiable using a HMAC digest and a secret. -}
data Verifiable a = Verifiable
- { val :: a
- , digest :: HMACDigest
+ { verifiableVal :: a
+ , verifiableDigest :: HMACDigest
}
deriving (Eq, Read, Show)
@@ -25,7 +25,7 @@ mkVerifiable :: Show a => a -> Secret -> Verifiable a
mkVerifiable a secret = Verifiable a (calcDigest (show a) secret)
verified :: (Eq a, Show a) => Verifiable a -> Secret -> Bool
-verified v secret = v == mkVerifiable (val v) secret
+verified v secret = v == mkVerifiable (verifiableVal v) secret
calcDigest :: String -> Secret -> HMACDigest
calcDigest v secret = showDigest $ hmacSha1 secret $ fromString v