aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--default.nix6
-rw-r--r--hmacaroons.cabal6
-rw-r--r--src/Crypto/Macaroon.hs18
-rw-r--r--src/Crypto/Macaroon/Internal.hs1
4 files changed, 15 insertions, 16 deletions
diff --git a/default.nix b/default.nix
index b9cfdb7..d968974 100644
--- a/default.nix
+++ b/default.nix
@@ -1,6 +1,6 @@
1{ mkDerivation, attoparsec, base, base64-bytestring, byteable 1{ mkDerivation, attoparsec, base, base64-bytestring, byteable
2, bytestring, cereal, cipher-aes, cryptohash, deepseq, hex 2, bytestring, cereal, cryptohash, deepseq, hex, QuickCheck, stdenv
3, QuickCheck, stdenv, tasty, tasty-hunit, tasty-quickcheck 3, tasty, tasty-hunit, tasty-quickcheck
4}: 4}:
5mkDerivation { 5mkDerivation {
6 pname = "hmacaroons"; 6 pname = "hmacaroons";
@@ -8,7 +8,7 @@ mkDerivation {
8 src = ./.; 8 src = ./.;
9 buildDepends = [ 9 buildDepends = [
10 attoparsec base base64-bytestring byteable bytestring cereal 10 attoparsec base base64-bytestring byteable bytestring cereal
11 cipher-aes cryptohash deepseq hex 11 cryptohash deepseq hex
12 ]; 12 ];
13 testDepends = [ 13 testDepends = [
14 attoparsec base base64-bytestring byteable bytestring cereal 14 attoparsec base base64-bytestring byteable bytestring cereal
diff --git a/hmacaroons.cabal b/hmacaroons.cabal
index c26ea19..e80cfa4 100644
--- a/hmacaroons.cabal
+++ b/hmacaroons.cabal
@@ -64,12 +64,12 @@ library
64 byteable >= 0.1 && <0.2, 64 byteable >= 0.1 && <0.2,
65 cereal >= 0.4, 65 cereal >= 0.4,
66 cryptohash >=0.11 && <0.12, 66 cryptohash >=0.11 && <0.12,
67 cipher-aes >=0.2 && <0.3, 67 -- cipher-aes >=0.2 && <0.3,
68 deepseq >= 1.1, 68 deepseq >= 1.1,
69 hex >= 0.1 69 hex >= 0.1
70 hs-source-dirs: src 70 hs-source-dirs: src
71 default-language: Haskell2010 71 default-language: Haskell2010
72 72
73benchmark bench 73benchmark bench
74 default-language: Haskell2010 74 default-language: Haskell2010
75 type: exitcode-stdio-1.0 75 type: exitcode-stdio-1.0
@@ -83,7 +83,7 @@ benchmark bench
83 byteable >= 0.1 && <0.2, 83 byteable >= 0.1 && <0.2,
84 cereal >= 0.4, 84 cereal >= 0.4,
85 cryptohash >=0.11 && <0.12, 85 cryptohash >=0.11 && <0.12,
86 cipher-aes >=0.2 && <0.3, 86 -- cipher-aes >=0.2 && <0.3,
87 hex >= 0.1, 87 hex >= 0.1,
88 deepseq >= 1.1, 88 deepseq >= 1.1,
89 criterion >= 1.1 89 criterion >= 1.1
diff --git a/src/Crypto/Macaroon.hs b/src/Crypto/Macaroon.hs
index f955ab8..bfcf8df 100644
--- a/src/Crypto/Macaroon.hs
+++ b/src/Crypto/Macaroon.hs
@@ -44,7 +44,7 @@ module Crypto.Macaroon (
44 -- , addThirdPartyCaveat 44 -- , addThirdPartyCaveat
45 ) where 45 ) where
46 46
47import Crypto.Cipher.AES 47-- import Crypto.Cipher.AES
48import Crypto.Hash 48import Crypto.Hash
49import Data.Byteable 49import Data.Byteable
50import qualified Data.ByteString as BS 50import qualified Data.ByteString as BS
@@ -81,13 +81,13 @@ addFirstPartyCaveat ident m = addCaveat (location m) ident BS.empty m
81 81
82-- |Add a third party Caveat to a Macaroon, using its location, identifier and 82-- |Add a third party Caveat to a Macaroon, using its location, identifier and
83-- verification key 83-- verification key
84addThirdPartyCaveat :: Key 84-- addThirdPartyCaveat :: Key
85 -> Key 85-- -> Key
86 -> Location 86-- -> Location
87 -> Macaroon 87-- -> Macaroon
88 -> Macaroon 88-- -> Macaroon
89addThirdPartyCaveat key cid loc m = addCaveat loc cid vid m 89-- addThirdPartyCaveat key cid loc m = addCaveat loc cid vid m
90 where 90-- where
91 vid = encryptECB (initAES (signature m)) key 91-- vid = encryptECB (initAES (signature m)) key
92 92
93 93
diff --git a/src/Crypto/Macaroon/Internal.hs b/src/Crypto/Macaroon/Internal.hs
index 02b7963..116f5ed 100644
--- a/src/Crypto/Macaroon/Internal.hs
+++ b/src/Crypto/Macaroon/Internal.hs
@@ -15,7 +15,6 @@ module Crypto.Macaroon.Internal where
15 15
16 16
17import Control.DeepSeq 17import Control.DeepSeq
18import Crypto.Cipher.AES
19import Crypto.Hash 18import Crypto.Hash
20import Data.Byteable 19import Data.Byteable
21import qualified Data.ByteString as BS 20import qualified Data.ByteString as BS