diff options
-rw-r--r-- | Compat.hs | 4 | ||||
-rw-r--r-- | clean-dep.sh | 9 | ||||
-rw-r--r-- | kiki.cabal | 17 | ||||
-rw-r--r-- | kiki.hs | 2 |
4 files changed, 26 insertions, 6 deletions
@@ -1,3 +1,4 @@ | |||
1 | {-# LANGUAGE CPP #-} | ||
1 | module Compat where | 2 | module Compat where |
2 | 3 | ||
3 | import Data.Bits | 4 | import Data.Bits |
@@ -7,6 +8,8 @@ import Data.ASN1.Encoding | |||
7 | import Data.ASN1.BinaryEncoding | 8 | import Data.ASN1.BinaryEncoding |
8 | import Crypto.PubKey.RSA as RSA | 9 | import Crypto.PubKey.RSA as RSA |
9 | 10 | ||
11 | #if defined(VERSION_cryptonite) | ||
12 | |||
10 | instance ASN1Object PublicKey where | 13 | instance ASN1Object PublicKey where |
11 | toASN1 pubKey = \xs -> Start Sequence | 14 | toASN1 pubKey = \xs -> Start Sequence |
12 | : IntVal (public_n pubKey) | 15 | : IntVal (public_n pubKey) |
@@ -38,6 +41,7 @@ instance ASN1Object PublicKey where | |||
38 | fromASN1 _ = | 41 | fromASN1 _ = |
39 | Left "fromASN1: RSA.PublicKey: unexpected format" | 42 | Left "fromASN1: RSA.PublicKey: unexpected format" |
40 | 43 | ||
44 | #endif | ||
41 | 45 | ||
42 | toPositive :: Integer -> Integer | 46 | toPositive :: Integer -> Integer |
43 | toPositive int | 47 | toPositive int |
diff --git a/clean-dep.sh b/clean-dep.sh new file mode 100644 index 0000000..2a1bfe2 --- /dev/null +++ b/clean-dep.sh | |||
@@ -0,0 +1,9 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # Clean up generated debian/control file for jessie build. | ||
4 | |||
5 | mv debian/control debian/control.bad | ||
6 | |||
7 | grep -v -- '-cryptonite-\|-hourglass-\|-memory-' debian/control.bad | sed '/-x509-/{ s/1.6/1.4/; }' > debian/control | ||
8 | |||
9 | # dpkg-checkbuilddeps: Unmet build dependencies: libghc-cryptonite-dev libghc-cryptonite-prof libghc-hourglass-dev libghc-hourglass-prof libghc-memory-dev libghc-memory-prof libghc-x509-dev (>= 1.6) libghc-x509-prof (>= 1.6) libghc-cryptonite-doc libghc-hourglass-doc libghc-memory-doc libghc-x509-doc (>= 1.6) | ||
@@ -15,6 +15,10 @@ Flag cryptonite | |||
15 | Description: Use newer cryptonite-based x509 version 1.6 and higher | 15 | Description: Use newer cryptonite-based x509 version 1.6 and higher |
16 | Default: True | 16 | Default: True |
17 | 17 | ||
18 | Flag hourglass | ||
19 | Description: Use newer hourglass-based x509 version 1.5 and higher | ||
20 | Default: True | ||
21 | |||
18 | Executable kiki | 22 | Executable kiki |
19 | Main-is: kiki.hs | 23 | Main-is: kiki.hs |
20 | -- base >=4.6 due to use of readEither in KikiD.Message | 24 | -- base >=4.6 due to use of readEither in KikiD.Message |
@@ -24,15 +28,18 @@ Executable kiki | |||
24 | asn1-types -any, asn1-encoding -any, | 28 | asn1-types -any, asn1-encoding -any, |
25 | dataenc -any, text -any, pretty -any, pretty-show -any, | 29 | dataenc -any, text -any, pretty -any, pretty-show -any, |
26 | bytestring -any, binary -any, | 30 | bytestring -any, binary -any, |
27 | unix, time, | 31 | unix, time, |
28 | containers -any, process -any, filepath -any, | 32 | containers -any, process -any, filepath -any, |
29 | network -any, old-locale -any, zlib -any, | 33 | network -any, old-locale -any, zlib -any |
30 | hourglass -any | ||
31 | if !flag(cryptonite) | 34 | if !flag(cryptonite) |
32 | Build-Depends: crypto-pubkey >=0.2.3, cryptohash -any, | 35 | Build-Depends: crypto-pubkey >=0.2.3, cryptohash -any, |
33 | crypto-pubkey-types -any, x509 <1.6 | 36 | crypto-pubkey-types -any |
37 | if flag(hourglass) | ||
38 | Build-Depends: hourglass -any, x509 >=1.5 && <1.6 | ||
39 | else | ||
40 | Build-Depends: x509 <1.6 | ||
34 | else | 41 | else |
35 | Build-Depends: cryptonite, x509 >=1.6, memory | 42 | Build-Depends: cryptonite, x509 >=1.6, memory, hourglass |
36 | ghc-options: -O2 -fwarn-unused-binds -fwarn-unused-imports | 43 | ghc-options: -O2 -fwarn-unused-binds -fwarn-unused-imports |
37 | c-sources: dotlock.c | 44 | c-sources: dotlock.c |
38 | 45 | ||
@@ -30,7 +30,7 @@ import System.Exit | |||
30 | import System.IO (hPutStrLn,stderr) | 30 | import System.IO (hPutStrLn,stderr) |
31 | import qualified Codec.Binary.Base64 as Base64 | 31 | import qualified Codec.Binary.Base64 as Base64 |
32 | #if !defined(VERSION_cryptonite) | 32 | #if !defined(VERSION_cryptonite) |
33 | -- import qualified Crypto.Hash.RIPEMD160 as RIPEMD160 | 33 | import qualified Crypto.Hash.RIPEMD160 as RIPEMD160 |
34 | import qualified Crypto.Hash.SHA256 as SHA256 | 34 | import qualified Crypto.Hash.SHA256 as SHA256 |
35 | #else | 35 | #else |
36 | import Crypto.Hash.Algorithms (RIPEMD160(..)) | 36 | import Crypto.Hash.Algorithms (RIPEMD160(..)) |