haskellPackages.authenticateOauth: Update to 1.5

This commit is contained in:
Oliver Charles 2014-06-20 09:58:35 +01:00
parent ca545ac8ec
commit 869cd7d44a
2 changed files with 6 additions and 66 deletions

View file

@ -1,57 +0,0 @@
From c401c2c585b5345243211e981c123a92b995b448 Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyfox@gentoo.org>
Date: Sat, 25 Jan 2014 13:35:52 +0300
Subject: [PATCH] authenticate-oauth.cabal: allow RSA-2
The only cosmetic change is rename of 'ha_SHA1' to 'hashSHA1'
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
---
authenticate-oauth/Web/Authenticate/OAuth.hs | 10 ++++++++--
authenticate-oauth/authenticate-oauth.cabal | 2 +-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/authenticate-oauth/Web/Authenticate/OAuth.hs b/authenticate-oauth/Web/Authenticate/OAuth.hs
index 3f38c8c..eccd0f1 100644
--- a/authenticate-oauth/Web/Authenticate/OAuth.hs
+++ b/authenticate-oauth/Web/Authenticate/OAuth.hs
@@ -21,7 +21,7 @@ module Web.Authenticate.OAuth
paramEncode, addScope, addMaybeProxy
) where
import Blaze.ByteString.Builder (toByteString, Builder)
-import Codec.Crypto.RSA (ha_SHA1, rsassa_pkcs1_v1_5_sign)
+import qualified Codec.Crypto.RSA as RSA
import Control.Exception
import Control.Monad
import Control.Monad.IO.Class (MonadIO, liftIO)
@@ -346,7 +346,13 @@ genSign oa tok req =
PLAINTEXT ->
return $ BS.intercalate "&" $ map paramEncode [oauthConsumerSecret oa, tokenSecret tok]
RSASHA1 pr ->
- liftM (encode . toStrict . rsassa_pkcs1_v1_5_sign ha_SHA1 pr) (getBaseString tok req)
+ liftM (encode . toStrict . RSA.rsassa_pkcs1_v1_5_sign
+#if MIN_VERSION_RSA(2, 0, 0)
+ RSA.hashSHA1
+#else
+ RSA.ha_SHA1
+#endif
+ pr) (getBaseString tok req)
#if MIN_VERSION_http_conduit(2, 0, 0)
addAuthHeader :: BS.ByteString -> Credential -> Request -> Request
diff --git a/authenticate-oauth/authenticate-oauth.cabal b/authenticate-oauth/authenticate-oauth.cabal
index 00507da..e11c3bd 100644
--- a/authenticate-oauth/authenticate-oauth.cabal
+++ b/authenticate-oauth/authenticate-oauth.cabal
@@ -19,7 +19,7 @@ library
, transformers >= 0.1 && < 0.4
, bytestring >= 0.9
, crypto-pubkey-types >= 0.1 && < 0.5
- , RSA >= 1.2 && < 1.3
+ , RSA >= 1.2 && < 2.1
, time
, data-default
, base64-bytestring >= 0.1 && < 1.1
--
1.9.1

View file

@ -1,18 +1,15 @@
{ cabal, base64Bytestring, blazeBuilder, blazeBuilderConduit
, conduit, cryptoPubkeyTypes, dataDefault, httpConduit, httpTypes
, monadControl, random, resourcet, RSA, SHA, time, transformers
, cryptoPubkeyTypes, dataDefault, httpClient, httpTypes, random
, RSA, SHA, time, transformers
}:
cabal.mkDerivation (self: {
pname = "authenticate-oauth";
version = "1.4.0.8";
sha256 = "1mc36d6lkmqywzsxhzwv4445mmwdz0rr5ibd2a1nbgw5c5jw76fy";
patches = [ ./RSA2.patch ];
patchFlags = "-p2";
version = "1.5";
sha256 = "07y9zh4v9by588k86wlyj3czivj5jlb9jk6g4j9p8j1qgbv4hpk9";
buildDepends = [
base64Bytestring blazeBuilder blazeBuilderConduit conduit
cryptoPubkeyTypes dataDefault httpConduit httpTypes monadControl
random resourcet RSA SHA time transformers
base64Bytestring blazeBuilder blazeBuilderConduit cryptoPubkeyTypes
dataDefault httpClient httpTypes random RSA SHA time transformers
];
meta = {
homepage = "http://github.com/yesodweb/authenticate";