Revert "Use haskell Crypto library instead of haskell SHA library.a"

This reverts commit 892593c5ef.

Conflicts:

	Crypto.hs
	debian/control
This commit is contained in:
Joey Hess 2011-04-26 11:24:23 -04:00
parent ebd6ea1abb
commit 27774bdd56
4 changed files with 15 additions and 16 deletions

View file

@ -29,21 +29,20 @@ module Crypto (
import qualified Data.ByteString.Lazy.Char8 as L import qualified Data.ByteString.Lazy.Char8 as L
import qualified Data.Map as M import qualified Data.Map as M
import qualified Codec.Binary.Base64 as B64 import qualified Codec.Binary.Base64 as B64
import Data.ByteString.Lazy.UTF8 (fromString)
import Data.Digest.Pure.SHA
import System.Cmd.Utils
import Data.String.Utils import Data.String.Utils
import Data.List import Data.List
import Data.Bits.Utils import Data.Bits.Utils
import Data.HMAC
import Data.Array
import Codec.Utils
import System.Cmd.Utils
import System.IO import System.IO
import System.Posix.IO import System.Posix.IO
import System.Posix.Types import System.Posix.Types
import System.Posix.Process import System.Posix.Process
import System.Exit
import System.Environment
import Control.Concurrent import Control.Concurrent
import Control.Exception (finally) import Control.Exception (finally)
import System.Exit
import System.Environment
import Types import Types
import Key import Key
@ -253,17 +252,10 @@ fromB64 s =
case B64.decode s of case B64.decode s of
Nothing -> error "bad base64 encoded data" Nothing -> error "bad base64 encoded data"
Just ws -> w82s ws Just ws -> w82s ws
showOctets :: [Octet] -> String
showOctets = concat . map hexChars
where
hexChars c = [arr ! (c `div` 16), arr ! (c `mod` 16)]
arr = listArray (0, 15) "0123456789abcdef"
hmacWithCipher :: Cipher -> String -> String hmacWithCipher :: Cipher -> String -> String
hmacWithCipher c = hmacWithCipher' (cipherHmac c) hmacWithCipher c = hmacWithCipher' (cipherHmac c)
hmacWithCipher' :: String -> String -> String hmacWithCipher' :: String -> String -> String
hmacWithCipher' c s = showOctets $ hmac_sha1 (s2w8 c) (s2w8 s) hmacWithCipher' c s = showDigest $ hmacSha1 (fromString c) (fromString s)
{- Ensure that hmacWithCipher' returns the same thing forevermore. -} {- Ensure that hmacWithCipher' returns the same thing forevermore. -}
prop_hmacWithCipher_sane :: Bool prop_hmacWithCipher_sane :: Bool

7
debian/changelog vendored
View file

@ -1,3 +1,10 @@
git-annex (0.20110426) UNRELEASED; urgency=low
* Switch back to haskell SHA library, so git-annex remains buildable on
Debian stable.
-- Joey Hess <joeyh@debian.org> Tue, 26 Apr 2011 11:23:54 -0400
git-annex (0.20110425) unstable; urgency=low git-annex (0.20110425) unstable; urgency=low
* Use haskell Crypto library instead of haskell SHA library. * Use haskell Crypto library instead of haskell SHA library.

2
debian/control vendored
View file

@ -6,8 +6,8 @@ Build-Depends:
ghc, ghc,
libghc-missingh-dev, libghc-missingh-dev,
libghc-pcre-light-dev, libghc-pcre-light-dev,
libghc-sha-dev,
libghc-dataenc-dev, libghc-dataenc-dev,
libghc-crypto-dev,
libghc-utf8-string-dev, libghc-utf8-string-dev,
libghc-hs3-dev (>= 0.5.6), libghc-hs3-dev (>= 0.5.6),
libghc-testpack-dev [any-i386 any-amd64], libghc-testpack-dev [any-i386 any-amd64],

View file

@ -13,7 +13,7 @@ To build and use git-annex, you will need:
* MissingH: <http://github.com/jgoerzen/missingh/wiki> * MissingH: <http://github.com/jgoerzen/missingh/wiki>
* pcre-light: <http://hackage.haskell.org/package/pcre-light> * pcre-light: <http://hackage.haskell.org/package/pcre-light>
* utf8-string: <http://hackage.haskell.org/package/utf8-string> * utf8-string: <http://hackage.haskell.org/package/utf8-string>
* crypto: <http://hackage.haskell.org/package/Crypto> * SHA: <http://hackage.haskell.org/package/SHA>
* dataenc: <http://hackage.haskell.org/package/dataenc> * dataenc: <http://hackage.haskell.org/package/dataenc>
* TestPack <http://hackage.haskell.org/cgi-bin/hackage-scripts/package/testpack> * TestPack <http://hackage.haskell.org/cgi-bin/hackage-scripts/package/testpack>
* QuickCheck 2 <http://hackage.haskell.org/package/QuickCheck> * QuickCheck 2 <http://hackage.haskell.org/package/QuickCheck>