Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package ghc-entropy for openSUSE:Factory 
checked in at 2022-10-13 15:41:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-entropy (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-entropy.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-entropy"

Thu Oct 13 15:41:51 2022 rev:6 rq:1008458 version:0.4.1.10

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-entropy/ghc-entropy.changes  2021-11-11 
21:38:21.256973207 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-entropy.new.2275/ghc-entropy.changes        
2022-10-13 15:41:56.786714645 +0200
@@ -1,0 +2,12 @@
+Tue Aug 23 14:54:28 UTC 2022 - Peter Simons <[email protected]>
+
+- Update entropy to version 0.4.1.10.
+  Upstream does not provide a change log file.
+
+-------------------------------------------------------------------
+Mon Aug 15 13:30:36 UTC 2022 - Peter Simons <[email protected]>
+
+- Update entropy to version 0.4.1.7 revision 1.
+  Upstream has revised the Cabal build instructions on Hackage.
+
+-------------------------------------------------------------------

Old:
----
  entropy-0.4.1.7.tar.gz

New:
----
  entropy-0.4.1.10.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ghc-entropy.spec ++++++
--- /var/tmp/diff_new_pack.3KmUrP/_old  2022-10-13 15:41:57.362715769 +0200
+++ /var/tmp/diff_new_pack.3KmUrP/_new  2022-10-13 15:41:57.366715778 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package ghc-entropy
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
 
 %global pkg_name entropy
 Name:           ghc-%{pkg_name}
-Version:        0.4.1.7
+Version:        0.4.1.10
 Release:        0
 Summary:        A platform independent entropy source
 License:        BSD-3-Clause

++++++ entropy-0.4.1.7.tar.gz -> entropy-0.4.1.10.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/entropy-0.4.1.7/System/Entropy.hs 
new/entropy-0.4.1.10/System/Entropy.hs
--- old/entropy-0.4.1.7/System/Entropy.hs       2001-09-09 03:46:40.000000000 
+0200
+++ new/entropy-0.4.1.10/System/Entropy.hs      2001-09-09 03:46:40.000000000 
+0200
@@ -11,7 +11,6 @@
     - Windows via CryptoAPI
     - *nix systems via @\/dev\/urandom@
        - Includes QNX
-    - Xen (only when RDRAND is available)
     - ghcjs/browser via JavaScript crypto API.
 -}
 
@@ -28,8 +27,6 @@
 import System.EntropyGhcjs
 #elif defined(isWindows)
 import System.EntropyWindows
-#elif XEN
-import System.EntropyXen
 #else
 import System.EntropyNix
 #endif
@@ -39,11 +36,11 @@
 
 -- |Get a specific number of bytes of cryptographically
 -- secure random data using the *system-specific* sources.
--- (As of 0.4.  Verions <0.4 mixed system and hardware sources)
+-- (As of 0.4.  Versions <0.4 mixed system and hardware sources)
 --
 -- The returned random value is considered cryptographically secure but not 
true entropy.
 --
--- On some platforms this requies a file handle which can lead to resource
+-- On some platforms this requires a file handle which can lead to resource
 -- exhaustion in some situations.
 getEntropy :: Int               -- ^ Number of bytes
            -> IO B.ByteString
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/entropy-0.4.1.7/System/EntropyGhcjs.hs 
new/entropy-0.4.1.10/System/EntropyGhcjs.hs
--- old/entropy-0.4.1.7/System/EntropyGhcjs.hs  2001-09-09 03:46:40.000000000 
+0200
+++ new/entropy-0.4.1.10/System/EntropyGhcjs.hs 2001-09-09 03:46:40.000000000 
+0200
@@ -19,7 +19,7 @@
 import GHCJS.DOM.Crypto as Crypto
 import GHCJS.DOM.Types (ArrayBufferView (..), fromJSValUnchecked)
 import GHCJS.DOM.GlobalCrypto (getCrypto)
-import GHCJS.DOM (currentWindowUnchecked)
+import GHCJS.DOM (globalThisUnchecked)
 import Language.Javascript.JSaddle.Object as JS
 
 
@@ -36,8 +36,8 @@
 -- |Open a `CryptHandle`
 openHandle :: IO CryptHandle
 openHandle = do
-  w <- currentWindowUnchecked
-  CH <$> getCrypto w
+  this <- globalThisUnchecked
+  CH <$> getCrypto this
 
 -- |Close the `CryptHandle`
 closeHandle :: CryptHandle -> IO ()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/entropy-0.4.1.7/System/EntropyNix.hs 
new/entropy-0.4.1.10/System/EntropyNix.hs
--- old/entropy-0.4.1.7/System/EntropyNix.hs    2001-09-09 03:46:40.000000000 
+0200
+++ new/entropy-0.4.1.10/System/EntropyNix.hs   2001-09-09 03:46:40.000000000 
+0200
@@ -34,7 +34,7 @@
 #undef HAVE_RDRAND
 #endif
 
-import System.Posix (openFd, closeFd, fdReadBuf, OpenMode(..), 
defaultFileFlags, Fd)
+import System.Posix (openFd, closeFd, fdReadBuf, OpenMode(..), 
defaultFileFlags, Fd, OpenFileFlags(..))
 
 source :: FilePath
 source = "/dev/urandom"
@@ -75,7 +75,11 @@
 openRandomFile :: IO Fd
 openRandomFile = do
   evaluate ensurePoolInitialized
+#if MIN_VERSION_unix(2,8,0)
+  openFd source ReadOnly defaultFileFlags { creat = Nothing }
+#else
   openFd source ReadOnly Nothing defaultFileFlags
+#endif
 
 -- |Close the `CryptHandle`
 closeHandle :: CryptHandle -> IO ()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/entropy-0.4.1.7/System/EntropyWindows.hs 
new/entropy-0.4.1.10/System/EntropyWindows.hs
--- old/entropy-0.4.1.7/System/EntropyWindows.hs        2001-09-09 
03:46:40.000000000 +0200
+++ new/entropy-0.4.1.10/System/EntropyWindows.hs       2001-09-09 
03:46:40.000000000 +0200
@@ -31,21 +31,20 @@
 import Foreign.Marshal.Utils (toBool)
 import Foreign.Storable (peek)
 
-{- C example for windows rng - taken from a blog, can't recall which one but 
thank you!
-        #include <Windows.h>
-        #include <Wincrypt.h>
-        ...
-        //
-        // DISCLAIMER: Don't forget to check your error codes!!
-        // I am not checking as to make the example simple...
-        //
-        HCRYPTPROV hCryptCtx = NULL;
-        BYTE randomArray[128];
-
-        CryptAcquireContext(&hCryptCtx, NULL, MS_DEF_PROV, PROV_RSA_FULL, 
CRYPT_VERIFYCONTEXT);
-        CryptGenRandom(hCryptCtx, 128, randomArray);
-        CryptReleaseContext(hCryptCtx, 0);
--}
+-- C example for windows rng - taken from a blog, can't recall which one but 
thank you!
+--      #include <Windows.h>
+--      #include <Wincrypt.h>
+--      ...
+--      //
+--      // DISCLAIMER: Don't forget to check your error codes!!
+--      // I am not checking as to make the example simple...
+--      //
+--      HCRYPTPROV hCryptCtx = NULL;
+--      BYTE randomArray[128];
+--
+--      CryptAcquireContext(&hCryptCtx, NULL, MS_DEF_PROV, PROV_RSA_FULL, 
CRYPT_VERIFYCONTEXT);
+--      CryptGenRandom(hCryptCtx, 128, randomArray);
+--      CryptReleaseContext(hCryptCtx, 0);
 
 
 #ifdef arch_i386
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/entropy-0.4.1.7/System/EntropyXen.hs 
new/entropy-0.4.1.10/System/EntropyXen.hs
--- old/entropy-0.4.1.7/System/EntropyXen.hs    2001-09-09 03:46:40.000000000 
+0200
+++ new/entropy-0.4.1.10/System/EntropyXen.hs   1970-01-01 01:00:00.000000000 
+0100
@@ -1,76 +0,0 @@
-{-# LANGUAGE CPP, ForeignFunctionInterface, BangPatterns, ScopedTypeVariables 
#-}
-{-|
- Maintainer: [email protected]
- Stability: beta
- Portability: portable
-
- Obtain entropy from RDRAND when available.
-
--}
-
-module System.EntropyXen
-        ( CryptHandle
-        , openHandle
-        , hGetEntropy
-        , closeHandle
-        , hardwareRandom
-        ) where
-
-import Control.Monad (liftM, when)
-import Data.ByteString as B
-import System.IO.Error (mkIOError, eofErrorType, ioeSetErrorString)
-
-import Foreign (allocaBytes)
-import Foreign.Ptr
-import Foreign.C.Types
-import Data.ByteString.Internal as B
-
-#ifdef arch_i386
--- See .cabal wrt GCC 4.8.2 asm compilation bug
-#undef HAVE_RDRAND
-#endif
-
-#ifndef HAVE_RDRAND
-#error "The entropy package requires RDRAND support when using the halvm/Xen"
-#endif
-data CryptHandle = UseRdRand -- or die trying
-
--- |Open a `CryptHandle`
-openHandle :: IO CryptHandle
-openHandle = do
-    b <- cpuHasRdRand
-    if b then return UseRdRand
-         else nonRDRandHandle
- where
-  nonRDRandHandle :: IO CryptHandle
-  nonRDRandHandle = error "entropy: On halvm there is no entropy other than 
RDRAND."
-
--- |Close the `CryptHandle`
-closeHandle :: CryptHandle -> IO ()
-closeHandle UseRdRand = return ()
-
--- | Get random values from the hardware RNG or return Nothing if no
--- supported hardware RNG is available.
---
--- Supported hardware:
---      * RDRAND
---      * Patches welcome
-hardwareRandom :: Int -> IO (Maybe B.ByteString)
-hardwareRandom sz = Just <$> hGetEntropy UseRdRand sz
-
--- |Read random data from a `CryptHandle`, which uses RDRAND (when on Xen)
-hGetEntropy :: CryptHandle -> Int -> IO B.ByteString
-hGetEntropy UseRdRand = \n -> do
-    B.create n $ \ptr ->  do
-                r <- c_get_rand_bytes (castPtr ptr) (fromIntegral n)
-                when (r /= 0)
-                     (fail "RDRand failed to gather entropy")
-
-foreign import ccall unsafe "cpu_has_rdrand"
-   c_cpu_has_rdrand :: IO CInt
-
-foreign import ccall unsafe "get_rand_bytes"
-  c_get_rand_bytes :: Ptr CUChar -> CSize -> IO CInt
-
-cpuHasRdRand :: IO Bool
-cpuHasRdRand = (/= 0) `fmap` c_cpu_has_rdrand
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/entropy-0.4.1.7/cbits/random_initialized.c 
new/entropy-0.4.1.10/cbits/random_initialized.c
--- old/entropy-0.4.1.7/cbits/random_initialized.c      2001-09-09 
03:46:40.000000000 +0200
+++ new/entropy-0.4.1.10/cbits/random_initialized.c     2001-09-09 
03:46:40.000000000 +0200
@@ -6,12 +6,14 @@
 #include <unistd.h>
 
 #ifdef HAVE_GETENTROPY
+#ifndef DO_NOT_USE_GET_ENTROPY
 static int ensure_pool_initialized_getentropy()
 {
     char tmp;
     return getentropy(&tmp, sizeof(tmp));
 }
 #endif
+#endif
 
 // Poll /dev/random to wait for randomness. This is a proxy for the 
/dev/urandom
 // pool being initialized.
@@ -46,9 +48,11 @@
 int ensure_pool_initialized()
 {
 #ifdef HAVE_GETENTROPY
+#ifndef DO_NOT_USE_GET_ENTROPY
     if (ensure_pool_initialized_getentropy() == 0)
         return 0;
 #endif
+#endif
 
     return ensure_pool_initialized_poll();
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/entropy-0.4.1.7/entropy.cabal 
new/entropy-0.4.1.10/entropy.cabal
--- old/entropy-0.4.1.7/entropy.cabal   2001-09-09 03:46:40.000000000 +0200
+++ new/entropy-0.4.1.10/entropy.cabal  2001-09-09 03:46:40.000000000 +0200
@@ -1,6 +1,6 @@
 name:           entropy
 
-version:        0.4.1.7
+version:        0.4.1.10
 description:    A mostly platform independent method to obtain 
cryptographically strong entropy
                 (RDRAND, urandom, CryptAPI, and patches welcome)
                 Users looking for cryptographically strong 
(number-theoretically
@@ -16,8 +16,6 @@
 bug-reports:    https://github.com/TomMD/entropy/issues
 stability:      stable
 
--- build-type:  Simple
--- ^^ Used for HaLVM
 build-type:     Custom
 
 -- ^^ Test for RDRAND support using 'ghc'
@@ -26,16 +24,14 @@
 -- data-files:
 extra-source-files:   ./cbits/getrandom.c ./cbits/random_initialized.c 
./cbits/rdrand.c, ./cbits/rdrand.h, README.md
 
--- Notice to compile  with HaLVM the above 'build-type' must be changed
--- to 'Simple' instead of 'Custom'.  The current build system naively
--- runs GHC to determine if the compiler supports RDRAND before proceeding.
-flag halvm
-    description:        Build for the HaLVM
-    default:            False
-
+Flag DoNotGetEntropy
+  Description: Avoid use of the getentropy() *nix function. By default 
getentropy will be used
+               if detected during compilation (this plays poorly with cross 
compilation).
+  Default: False
+  Manual: True
 
 custom-setup
-  setup-depends: Cabal >= 1.10 && < 3.7
+  setup-depends: Cabal >= 1.10 && < 3.9
                , base < 5
                , filepath < 1.5
                , directory < 1.4
@@ -50,10 +46,7 @@
     if os(windows)
       other-modules: System.EntropyWindows
     else {
-         if os(halvm)
-           other-modules: System.EntropyXen
-         else
-           other-modules: System.EntropyNix
+      other-modules: System.EntropyNix
     }
   }
   other-extensions:    CPP, ForeignFunctionInterface, BangPatterns,
@@ -63,13 +56,10 @@
   default-language:    Haskell2010
 
   if impl(ghcjs) || os(ghcjs) {
-    build-depends:     ghcjs-dom
+    build-depends:     ghcjs-dom >= 0.9.5.0 && < 1
                      , jsaddle
   }
   else {
-    if(os(halvm))
-      cpp-options: -DXEN -DHAVE_RDRAND
-      cc-options:  -DXEN -DHAVE_RDRAND
     if arch(x86_64)
       cpp-options: -Darch_x86_64
       cc-options:  -Darch_x86_64 -O2
@@ -85,9 +75,11 @@
       cc-options:  -DisWindows
       extra-libraries: advapi32
     else
-      if !os(halvm)
-         Build-Depends: unix
-         c-sources: cbits/getrandom.c cbits/random_initialized.c
+      Build-Depends: unix
+      c-sources: cbits/getrandom.c cbits/random_initialized.c
+  }
+  if flag(DoNotGetEntropy) {
+    cc-options: -DDO_NOT_USE_GET_ENTROPY
   }
 
 

Reply via email to