Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Suggestion by Grant Monroe:

Ignore-this: 5faa29886416193f711c9d7208904acd

- Changed the signature of OpenSSL.EVP.Sign.signBS from
    signBS :: KeyPair key => Digest -> key -> Strict.ByteString -> IO String
  to
    signBS :: KeyPair key => Digest -> key -> Strict.ByteString -> IO Strict.ByteString

- Changed the signature of OpenSSL.EVP.Sign.signLBS from
    signLBS :: KeyPair key => Digest -> key -> Lazy.ByteString -> IO String
  to
    signLBS :: KeyPair key => Digest -> key -> Lazy.ByteString -> IO Lazy.ByteString

darcs-hash:20090713134754-62b54-bdc265c51f6e8403d561264ffd29a6ece64601ce.gz
  • Loading branch information...
commit 1388e86302eeec3808d2b061fae6b72afdd0fc5f 1 parent d4eaa84
@phonohawk authored
Showing with 23 additions and 6 deletions.
  1. +1 −1  HsOpenSSL.cabal
  2. +15 −0 NEWS
  3. +7 −5 OpenSSL/EVP/Sign.hsc
View
2  HsOpenSSL.cabal
@@ -5,7 +5,7 @@ Description:
can generate RSA and DSA keys, read and write PEM files,
generate message digests, sign and verify messages, encrypt
and decrypt messages.
-Version: 0.6.2
+Version: 0.6.3
License: PublicDomain
License-File: COPYING
Author: Adam Langley <agl at imperialviolet.org>, PHO <pho at cielonegro.org>
View
15 NEWS
@@ -1,5 +1,20 @@
-*- Coding: utf-8 -*-
+Changes from 0.6.2 to 0.6.3
+---------------------------
+* Suggestion by Grant Monroe:
+
+ - Changed the signature of OpenSSL.EVP.Sign.signBS from
+ signBS :: KeyPair key => Digest -> key -> Strict.ByteString -> IO String
+ to
+ signBS :: KeyPair key => Digest -> key -> Strict.ByteString -> IO Strict.ByteString
+
+ - Changed the signature of OpenSSL.EVP.Sign.signLBS from
+ signLBS :: KeyPair key => Digest -> key -> Lazy.ByteString -> IO String
+ to
+ signLBS :: KeyPair key => Digest -> key -> Lazy.ByteString -> IO Lazy.ByteString
+
+
Chanegs from 0.6.1 to 0.6.2
---------------------------
* Applied a patch by John Van Enk and his friend:
View
12 OpenSSL/EVP/Sign.hsc
@@ -46,24 +46,26 @@ sign :: KeyPair key =>
-> String -- ^ input string
-> IO String -- ^ the result signature
sign md pkey input
- = signLBS md pkey $ L8.pack input
+ = liftM L8.unpack $ signLBS md pkey $ L8.pack input
-- |@'signBS'@ generates a signature from a chunk of data.
signBS :: KeyPair key =>
Digest -- ^ message digest algorithm to use
-> key -- ^ private key to sign the message digest
-> B8.ByteString -- ^ input string
- -> IO String -- ^ the result signature
+ -> IO B8.ByteString -- ^ the result signature
signBS md pkey input
= do ctx <- digestStrictly md input
- signFinal ctx pkey
+ sig <- signFinal ctx pkey
+ return $ B8.pack sig
-- |@'signLBS'@ generates a signature from a stream of data.
signLBS :: KeyPair key =>
Digest -- ^ message digest algorithm to use
-> key -- ^ private key to sign the message digest
-> L8.ByteString -- ^ input string
- -> IO String -- ^ the result signature
+ -> IO L8.ByteString -- ^ the result signature
signLBS md pkey input
= do ctx <- digestLazily md input
- signFinal ctx pkey
+ sig <- signFinal ctx pkey
+ return $ L8.pack sig
Please sign in to comment.
Something went wrong with that request. Please try again.