Hello community, here is the log from the commit of package ghc-cryptonite-openssl for openSUSE:Factory checked in at 2017-08-31 20:50:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-cryptonite-openssl (Old) and /work/SRC/openSUSE:Factory/.ghc-cryptonite-openssl.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-cryptonite-openssl" Thu Aug 31 20:50:23 2017 rev:2 rq:513226 version:0.6 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-cryptonite-openssl/ghc-cryptonite-openssl.changes 2017-04-11 09:47:14.143514609 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-cryptonite-openssl.new/ghc-cryptonite-openssl.changes 2017-08-31 20:50:27.793983601 +0200 @@ -1,0 +2,5 @@ +Thu Jul 27 14:08:11 UTC 2017 - psim...@suse.com + +- Update to version 0.6. + +------------------------------------------------------------------- Old: ---- cryptonite-openssl-0.5.tar.gz New: ---- cryptonite-openssl-0.6.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-cryptonite-openssl.spec ++++++ --- /var/tmp/diff_new_pack.S4HIVF/_old 2017-08-31 20:50:28.833837637 +0200 +++ /var/tmp/diff_new_pack.S4HIVF/_new 2017-08-31 20:50:28.837837076 +0200 @@ -19,7 +19,7 @@ %global pkg_name cryptonite-openssl %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.5 +Version: 0.6 Release: 0 Summary: Crypto stuff using OpenSSL cryptographic library License: BSD-3-Clause ++++++ cryptonite-openssl-0.5.tar.gz -> cryptonite-openssl-0.6.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cryptonite-openssl-0.5/Crypto/OpenSSL/AES/Foreign.hsc new/cryptonite-openssl-0.6/Crypto/OpenSSL/AES/Foreign.hsc --- old/cryptonite-openssl-0.5/Crypto/OpenSSL/AES/Foreign.hsc 2016-11-21 13:06:04.000000000 +0100 +++ new/cryptonite-openssl-0.6/Crypto/OpenSSL/AES/Foreign.hsc 2017-05-13 12:37:47.000000000 +0200 @@ -5,20 +5,31 @@ #include <openssl/opensslv.h> #include <openssl/evp.h> -#if OPENSSL_VERSION_NUMBER > 0x10001000 +#if OPENSSL_VERSION_NUMBER >= 0x10100000 +#define OPENSSL_HAS_OPAQUE_EVP_CIPHER_CTX +#endif + +#if OPENSSL_VERSION_NUMBER >= 0x10001000 #define OPENSSL_HAS_PBKDF2 #define OPENSSL_HAS_GCM #endif +import Foreign.Marshal.Alloc import Foreign.Ptr +import Foreign.ForeignPtr import Foreign.C.Types import Data.Word +#ifndef OPENSSL_HAS_OPAQUE_EVP_CIPHER_CTX +import qualified Data.Memory.PtrMethods as B (memSet) +#endif gcmTagLength :: Int gcmTagLength = 16 +#ifndef OPENSSL_HAS_OPAQUE_EVP_CIPHER_CTX sizeofEVP :: Int sizeofEVP = (#const sizeof(EVP_CIPHER_CTX)) +#endif data ENGINE @@ -32,14 +43,33 @@ type OutputOffset = Ptr CInt type InputLength = CInt +compatNewEvpCipherCtx :: IO (ForeignPtr EVP_CIPHER_CTX) +compatNewEvpCipherCtx = do +#ifdef OPENSSL_HAS_OPAQUE_EVP_CIPHER_CTX + ptr <- ssl_c_cipher_ctx_new + newForeignPtr ssl_c_cipher_ctx_free ptr +#else + ptr <- mallocBytes sizeofEVP + B.memSet (castPtr ptr) 0 (fromIntegral sizeofEVP) + ssl_c_cipher_ctx_init ptr + newForeignPtr ssl_c_cipher_ctx_cleanup ptr +#endif + +#ifdef OPENSSL_HAS_OPAQUE_EVP_CIPHER_CTX +foreign import ccall unsafe "EVP_CIPHER_CTX_new" + ssl_c_cipher_ctx_new :: IO (Ptr EVP_CIPHER_CTX) +#endif + foreign import ccall unsafe "EVP_CIPHER_CTX_init" ssl_c_cipher_ctx_init :: Ptr EVP_CIPHER_CTX -> IO () foreign import ccall unsafe "&EVP_CIPHER_CTX_free" ssl_c_cipher_ctx_free :: FunPtr (Ptr EVP_CIPHER_CTX -> IO ()) +#ifndef OPENSSL_HAS_OPAQUE_EVP_CIPHER_CTX foreign import ccall unsafe "&EVP_CIPHER_CTX_cleanup" ssl_c_cipher_ctx_cleanup :: FunPtr (Ptr EVP_CIPHER_CTX -> IO ()) +#endif foreign import ccall unsafe "EVP_CIPHER_CTX_ctrl" ssl_c_cipher_ctx_ctrl :: Ptr EVP_CIPHER_CTX -> CInt -> CInt -> Ptr a -> IO CInt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cryptonite-openssl-0.5/Crypto/OpenSSL/AES.hs new/cryptonite-openssl-0.6/Crypto/OpenSSL/AES.hs --- old/cryptonite-openssl-0.5/Crypto/OpenSSL/AES.hs 2016-11-21 13:06:04.000000000 +0100 +++ new/cryptonite-openssl-0.6/Crypto/OpenSSL/AES.hs 2017-05-13 12:37:47.000000000 +0200 @@ -27,7 +27,6 @@ import Foreign.Storable import Data.ByteString (ByteString) import qualified Data.ByteArray as B -import qualified Data.Memory.PtrMethods as B (memSet) type GCMCtx = ForeignPtr EVP_CIPHER_CTX @@ -116,10 +115,9 @@ contextNew :: (Ptr EVP_CIPHER_CTX -> IO ()) -> IO GCMCtx contextNew f = do - ptr <- mallocBytes sizeofEVP - B.memSet (castPtr ptr) 0 (fromIntegral sizeofEVP) - f ptr - newForeignPtr ssl_c_cipher_ctx_cleanup ptr + fptr <- compatNewEvpCipherCtx + withForeignPtr fptr f + return fptr nullEngine :: Ptr ENGINE nullEngine = nullPtr diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cryptonite-openssl-0.5/cryptonite-openssl.cabal new/cryptonite-openssl-0.6/cryptonite-openssl.cabal --- old/cryptonite-openssl-0.5/cryptonite-openssl.cabal 2017-01-02 22:31:40.000000000 +0100 +++ new/cryptonite-openssl-0.6/cryptonite-openssl.cabal 2017-05-13 12:45:11.000000000 +0200 @@ -1,5 +1,5 @@ Name: cryptonite-openssl -Version: 0.5 +Version: 0.6 Synopsis: Crypto stuff using OpenSSL cryptographic library Description: cryptography License: BSD3