Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package ghc-x509 for openSUSE:Factory 
checked in at 2022-02-11 23:10:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-x509 (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-x509.new.1956 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-x509"

Fri Feb 11 23:10:04 2022 rev:20 rq:953566 version:1.7.6

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-x509/ghc-x509.changes        2020-12-22 
11:49:16.541998806 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-x509.new.1956/ghc-x509.changes      
2022-02-11 23:12:03.303405070 +0100
@@ -1,0 +2,6 @@
+Mon Jan 17 07:54:38 UTC 2022 - Peter Simons <psim...@suse.com>
+
+- Update x509 to version 1.7.6.
+  Upstream does not provide a change log file.
+
+-------------------------------------------------------------------

Old:
----
  x509-1.7.5.tar.gz
  x509.cabal

New:
----
  x509-1.7.6.tar.gz

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

Other differences:
------------------
++++++ ghc-x509.spec ++++++
--- /var/tmp/diff_new_pack.dvEDxQ/_old  2022-02-11 23:12:03.679406158 +0100
+++ /var/tmp/diff_new_pack.dvEDxQ/_new  2022-02-11 23:12:03.683406169 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package ghc-x509
 #
-# Copyright (c) 2020 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
@@ -19,13 +19,12 @@
 %global pkg_name x509
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        1.7.5
+Version:        1.7.6
 Release:        0
 Summary:        X509 reader and writer
 License:        BSD-3-Clause
 URL:            https://hackage.haskell.org/package/%{pkg_name}
 Source0:        
https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
-Source1:        
https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/1.cabal#/%{pkg_name}.cabal
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-asn1-encoding-devel
 BuildRequires:  ghc-asn1-parse-devel
@@ -59,7 +58,6 @@
 
 %prep
 %autosetup -n %{pkg_name}-%{version}
-cp -p %{SOURCE1} %{pkg_name}.cabal
 
 %build
 %ghc_lib_build

++++++ x509-1.7.5.tar.gz -> x509-1.7.6.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/x509-1.7.5/Data/X509/AlgorithmIdentifier.hs 
new/x509-1.7.6/Data/X509/AlgorithmIdentifier.hs
--- old/x509-1.7.5/Data/X509/AlgorithmIdentifier.hs     2018-11-04 
11:10:41.000000000 +0100
+++ new/x509-1.7.6/Data/X509/AlgorithmIdentifier.hs     2021-08-03 
08:57:34.000000000 +0200
@@ -102,7 +102,10 @@
 
 instance ASN1Object SignatureALG where
     fromASN1 (Start Sequence:OID oid:Null:End Sequence:xs) =
-        Right (oidSig oid, xs)
+        case oidSig oid of
+            SignatureALG_IntrinsicHash _ ->
+                Left "fromASN1: X509.SignatureALG: EdDSA requires absent 
parameter"
+            signatureAlg -> Right (signatureAlg, xs)
     fromASN1 (Start Sequence:OID oid:End Sequence:xs) =
         Right (oidSig oid, xs)
     fromASN1 (Start Sequence:OID [1,2,840,113549,1,1,10]:Start Sequence:Start 
_:Start Sequence:OID hash1:End Sequence:End _:Start _:Start Sequence:OID 
[1,2,840,113549,1,1,8]:Start Sequence:OID _hash2:End Sequence:End Sequence:End 
_:Start _: IntVal _iv: End _: End Sequence : End Sequence:xs) =
@@ -113,4 +116,5 @@
         Left "fromASN1: X509.SignatureALG: unknown format"
     toASN1 (SignatureALG_Unknown oid) = \xs -> Start Sequence:OID oid:Null:End 
Sequence:xs
     toASN1 signatureAlg@(SignatureALG hashAlg PubKeyALG_RSAPSS) = \xs -> Start 
Sequence:OID [1,2,840,113549,1,1,10]:Start Sequence:Start (Container Context 
0):Start Sequence:OID (sigOID signatureAlg):End Sequence:End (Container Context 
0):Start (Container Context 1): Start Sequence:OID [1,2,840,113549,1,1,8]:Start 
Sequence:OID (sigOID signatureAlg):End Sequence:End Sequence:End (Container 
Context 1):Start (Container Context 2):IntVal (saltLen hashAlg):End (Container 
Context 2):End Sequence:End Sequence:xs
+    toASN1 signatureAlg@(SignatureALG_IntrinsicHash _) = \xs -> Start 
Sequence:OID (sigOID signatureAlg):End Sequence:xs
     toASN1 signatureAlg = \xs -> Start Sequence:OID (sigOID 
signatureAlg):Null:End Sequence:xs
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/x509-1.7.5/Data/X509/CRL.hs 
new/x509-1.7.6/Data/X509/CRL.hs
--- old/x509-1.7.5/Data/X509/CRL.hs     2018-07-21 10:17:34.000000000 +0200
+++ new/x509-1.7.6/Data/X509/CRL.hs     2022-01-10 04:45:31.000000000 +0100
@@ -48,13 +48,29 @@
     toASN1 crl = encodeCRL crl
     fromASN1 = runParseASN1State parseCRL
 
--- TODO support extension
 instance ASN1Object RevokedCertificate where
-    fromASN1 (Start Sequence : IntVal serial : ASN1Time _ t _ : End Sequence : 
xs) =
-        Right (RevokedCertificate serial t (Extensions Nothing), xs)
-    fromASN1 l = Left ("fromASN1: X509.RevokedCertificate: unknown format:" ++ 
show l)
-    toASN1 (RevokedCertificate serial time _) = \xs ->
-        Start Sequence : IntVal serial : ASN1Time TimeGeneralized time (Just 
(TimezoneOffset 0)) : End Sequence : xs
+    fromASN1 = runParseASN1State $
+        onNextContainer Sequence $
+        RevokedCertificate
+        <$> parseSerialNumber
+        <*> (getNext >>= toTime)
+        <*> getObject
+      where toTime (ASN1Time _ t _) = pure t
+            toTime _                = throwParseError "bad revocation date"
+    toASN1 (RevokedCertificate serial time crlEntryExtensions) = \xs ->
+        [ Start Sequence ] ++
+        [ IntVal serial ] ++
+        [ ASN1Time TimeGeneralized time (Just (TimezoneOffset 0)) ] ++
+        toASN1 crlEntryExtensions [] ++
+        [ End Sequence ] ++
+        xs
+
+parseSerialNumber :: ParseASN1 Integer
+parseSerialNumber = do
+    n <- getNext
+    case n of
+        IntVal v -> return v
+        _        -> throwParseError ("missing serial" ++ show n)
 
 parseCRL :: ParseASN1 CRL
 parseCRL = do
@@ -63,8 +79,8 @@
         <*> getObject
         <*> (getNext >>= getThisUpdate)
         <*> getNextUpdate
-        <*> getRevokedCertificates
-        <*> getObject
+        <*> parseRevokedCertificates
+        <*> parseCRLExtensions
   where getVersion (IntVal v) = return $ fromIntegral v
         getVersion _          = throwParseError "unexpected type for version"
 
@@ -76,7 +92,15 @@
         timeOrNothing (ASN1Time _ tnext _) = Just tnext
         timeOrNothing _                    = Nothing
 
-        getRevokedCertificates = onNextContainer Sequence $ getMany getObject
+parseRevokedCertificates :: ParseASN1 [RevokedCertificate]
+parseRevokedCertificates =
+    fmap (maybe [] id) $ onNextContainerMaybe Sequence $ getMany getObject
+
+parseCRLExtensions :: ParseASN1 Extensions
+parseCRLExtensions =
+    fmap adapt $ onNextContainerMaybe (Container Context 0) $ getObject
+  where adapt (Just e) = e
+        adapt Nothing = Extensions Nothing
 
 encodeCRL :: CRL -> ASN1S
 encodeCRL crl xs =
@@ -85,10 +109,11 @@
     toASN1 (crlIssuer crl) [] ++
     [ASN1Time TimeGeneralized (crlThisUpdate crl) (Just (TimezoneOffset 0))] ++
     (maybe [] (\t -> [ASN1Time TimeGeneralized t (Just (TimezoneOffset 0))]) 
(crlNextUpdate crl)) ++
-    [Start Sequence] ++
-    revoked ++
-    [End Sequence] ++
-    toASN1 (crlExtensions crl) [] ++
+    maybeRevoked (crlRevokedCertificates crl) ++
+    maybeCrlExts (crlExtensions crl) ++
     xs
   where
-    revoked = concatMap (\e -> toASN1 e []) (crlRevokedCertificates crl)
+    maybeRevoked [] = []
+    maybeRevoked xs' = asn1Container Sequence $ concatMap (\e -> toASN1 e []) 
xs'
+    maybeCrlExts (Extensions Nothing) = []
+    maybeCrlExts exts = asn1Container (Container Context 0) $ toASN1 exts []
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/x509-1.7.5/Data/X509/Cert.hs 
new/x509-1.7.6/Data/X509/Cert.hs
--- old/x509-1.7.5/Data/X509/Cert.hs    2018-07-21 10:17:34.000000000 +0200
+++ new/x509-1.7.6/Data/X509/Cert.hs    2022-01-10 04:45:31.000000000 +0100
@@ -85,6 +85,12 @@
         Subject Unique Identifier (Optional) (>= 2)
         Extensions (Optional)   (>= v3)
 -}
+
+parseExtensions :: ParseASN1 Extensions
+parseExtensions = fmap adapt $ onNextContainerMaybe (Container Context 3) $ 
getObject
+  where adapt (Just e) = e
+        adapt Nothing = Extensions Nothing
+
 parseCertificate :: ParseASN1 Certificate
 parseCertificate =
     Certificate <$> parseCertHeaderVersion
@@ -94,7 +100,7 @@
                 <*> parseCertHeaderValidity
                 <*> getObject
                 <*> getObject
-                <*> getObject
+                <*> parseExtensions
 
 encodeCertificateHeader :: Certificate -> [ASN1]
 encodeCertificateHeader cert =
@@ -108,7 +114,9 @@
                                            ,ASN1Time (timeType t2) t2 (Just 
(TimezoneOffset 0))]
         eSubject  = toASN1 (certSubjectDN cert) []
         epkinfo   = toASN1 (certPubKey cert) []
-        eexts     = toASN1 (certExtensions cert) []
+        eexts     = case certExtensions cert of
+                      Extensions Nothing -> []
+                      exts -> asn1Container (Container Context 3) $ toASN1 
exts []
         timeType t =
             if t >= timeConvert (Date 2050 January 1)
             then TimeGeneralized
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/x509-1.7.5/Data/X509/ExtensionRaw.hs 
new/x509-1.7.6/Data/X509/ExtensionRaw.hs
--- old/x509-1.7.5/Data/X509/ExtensionRaw.hs    2018-07-21 10:17:34.000000000 
+0200
+++ new/x509-1.7.6/Data/X509/ExtensionRaw.hs    2022-01-10 04:45:31.000000000 
+0100
@@ -45,10 +45,9 @@
 instance ASN1Object Extensions where
     toASN1 (Extensions Nothing) = \xs -> xs
     toASN1 (Extensions (Just exts)) = \xs ->
-        asn1Container (Container Context 3) (asn1Container Sequence (concatMap 
encodeExt exts)) ++ xs
+        asn1Container Sequence (concatMap encodeExt exts) ++ xs
     fromASN1 s = runParseASN1State (Extensions <$> parseExtensions) s
-      where parseExtensions = onNextContainerMaybe (Container Context 3) $
-                              onNextContainer Sequence (getMany getObject)
+      where parseExtensions = onNextContainerMaybe Sequence (getMany getObject)
 
 instance ASN1Object ExtensionRaw where
     toASN1 extraw = \xs -> encodeExt extraw ++ xs
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/x509-1.7.5/Data/X509/PublicKey.hs 
new/x509-1.7.6/Data/X509/PublicKey.hs
--- old/x509-1.7.5/Data/X509/PublicKey.hs       2018-11-04 11:10:41.000000000 
+0100
+++ new/x509-1.7.6/Data/X509/PublicKey.hs       2022-01-10 04:45:31.000000000 
+0100
@@ -35,6 +35,7 @@
 import qualified Crypto.PubKey.Curve448   as X448
 import qualified Crypto.PubKey.Ed25519    as Ed25519
 import qualified Crypto.PubKey.Ed448      as Ed448
+import           Crypto.Number.Basic (numBytes)
 import           Crypto.Number.Serialize (os2ip)
 import Data.Word
 
@@ -234,11 +235,10 @@
 rsaPubFromASN1 (Start Sequence:IntVal smodulus:IntVal pubexp:End Sequence:xs) =
     Right (pub, xs)
   where
-    pub = RSA.PublicKey { RSA.public_size = calculate_modulus modulus 1
+    pub = RSA.PublicKey { RSA.public_size = numBytes modulus
                         , RSA.public_n    = modulus
                         , RSA.public_e    = pubexp
                         }
-    calculate_modulus n i = if (2 ^ (i * 8)) > n then i else calculate_modulus 
n (i+1)
     -- some bad implementation will not serialize ASN.1 integer properly, 
leading
     -- to negative modulus. if that's the case, we correct it.
     modulus = toPositive smodulus
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/x509-1.7.5/Tests/Tests.hs 
new/x509-1.7.6/Tests/Tests.hs
--- old/x509-1.7.5/Tests/Tests.hs       2018-11-04 11:10:41.000000000 +0100
+++ new/x509-1.7.6/Tests/Tests.hs       2022-01-10 04:45:31.000000000 +0100
@@ -179,7 +179,7 @@
 instance Arbitrary RevokedCertificate where
     arbitrary = RevokedCertificate <$> arbitrary
                                    <*> arbitrary
-                                   <*> pure (Extensions Nothing)
+                                   <*> arbitrary
 
 instance Arbitrary CRL where
     arbitrary = CRL <$> pure 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/x509-1.7.5/x509.cabal new/x509-1.7.6/x509.cabal
--- old/x509-1.7.5/x509.cabal   2018-11-04 12:41:30.000000000 +0100
+++ new/x509-1.7.6/x509.cabal   2022-01-17 08:48:42.000000000 +0100
@@ -1,5 +1,5 @@
 Name:                x509
-version:             1.7.5
+version:             1.7.6
 Description:         X509 reader and writer. please see README
 License:             BSD3
 License-file:        LICENSE

Reply via email to