aboutsummaryrefslogtreecommitdiff
path: root/Utility/WebApp.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-08-06 15:02:25 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-08-06 15:02:25 -0400
commit7310bf39e0b6729bafc138631304b8e1edde839f (patch)
tree89027a1af6abaf330996c142a96bbe8df0ced3ee /Utility/WebApp.hs
parent9cd989ff0da857fad0d04f2961a0e1baa62d26b0 (diff)
Added support for SHA3 hashed keys (in 8 varieties), when git-annex is built using the cryptonite library.
While cryptohash has SHA3 support, it has not been updated for the final version of the spec. Note that cryptonite has not been ported to all arches that cryptohash builds on yet.
Diffstat (limited to 'Utility/WebApp.hs')
-rw-r--r--Utility/WebApp.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Utility/WebApp.hs b/Utility/WebApp.hs
index ce6a61c42..1a068a9b2 100644
--- a/Utility/WebApp.hs
+++ b/Utility/WebApp.hs
@@ -185,7 +185,7 @@ fromAuthToken = TE.decodeLatin1 . toBytes
fromAuthToken = id
#endif
-{- Generates a random sha512 string, encapsulated in a SecureMem,
+{- Generates a random sha2_512 string, encapsulated in a SecureMem,
- suitable to be used for an authentication secret. -}
genAuthToken :: IO AuthToken
genAuthToken = do
@@ -193,7 +193,7 @@ genAuthToken = do
return $
case genBytes 512 g of
Left e -> error $ "failed to generate auth token: " ++ show e
- Right (s, _) -> toAuthToken $ T.pack $ show $ sha512 $ L.fromChunks [s]
+ Right (s, _) -> toAuthToken $ T.pack $ show $ sha2_512 $ L.fromChunks [s]
{- A Yesod isAuthorized method, which checks the auth cgi parameter
- against a token extracted from the Yesod application.