Hello community,

here is the log from the commit of package ghc-pkcs10 for openSUSE:Factory 
checked in at 2017-04-11 09:38:32
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-pkcs10 (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-pkcs10.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-pkcs10"

Tue Apr 11 09:38:32 2017 rev:2 rq:484154 version:0.2.0.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-pkcs10/ghc-pkcs10.changes    2017-03-24 
02:05:43.939254665 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-pkcs10.new/ghc-pkcs10.changes       
2017-04-11 09:38:35.204821523 +0200
@@ -1,0 +2,5 @@
+Sun Feb 12 14:08:22 UTC 2017 - [email protected]
+
+- Update to version 0.2.0.0 with cabal2obs.
+
+-------------------------------------------------------------------

Old:
----
  pkcs10-0.1.1.0.tar.gz

New:
----
  pkcs10-0.2.0.0.tar.gz

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

Other differences:
------------------
++++++ ghc-pkcs10.spec ++++++
--- /var/tmp/diff_new_pack.meb5aH/_old  2017-04-11 09:38:36.136689885 +0200
+++ /var/tmp/diff_new_pack.meb5aH/_new  2017-04-11 09:38:36.140689320 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package ghc-pkcs10
 #
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
 %global pkg_name pkcs10
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        0.1.1.0
+Version:        0.2.0.0
 Release:        0
 Summary:        PKCS#10 library
 License:        Apache-2.0
@@ -45,7 +45,7 @@
 %endif
 
 %description
-Please see README.md.
+PKCS#10 library.
 
 %package devel
 Summary:        Haskell %{pkg_name} library development files

++++++ pkcs10-0.1.1.0.tar.gz -> pkcs10-0.2.0.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkcs10-0.1.1.0/pkcs10.cabal 
new/pkcs10-0.2.0.0/pkcs10.cabal
--- old/pkcs10-0.1.1.0/pkcs10.cabal     2016-05-28 03:17:13.000000000 +0200
+++ new/pkcs10-0.2.0.0/pkcs10.cabal     2016-11-02 09:54:44.000000000 +0100
@@ -1,5 +1,5 @@
 name:                pkcs10
-version:             0.1.1.0
+version:             0.2.0.0
 synopsis:            PKCS#10 library
 description:         Please see README.md
 homepage:            https://github.com/fcomb/pkcs10-hs#readme
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkcs10-0.1.1.0/src/Data/X509/PKCS10.hs 
new/pkcs10-0.2.0.0/src/Data/X509/PKCS10.hs
--- old/pkcs10-0.1.1.0/src/Data/X509/PKCS10.hs  2016-01-01 10:11:20.000000000 
+0100
+++ new/pkcs10-0.2.0.0/src/Data/X509/PKCS10.hs  2016-11-02 10:34:15.000000000 
+0100
@@ -184,6 +184,12 @@
 newtype Signature =
         Signature B.ByteString deriving (Show, Eq)
 
+-- | Errors.
+data Error =
+     ASN1UnknownError String
+   | PEMUnknownFormat
+   deriving (Show, Eq)
+
 instance ASN1Object CertificationRequest where
   toASN1 (CertificationRequest info sigAlg sig) xs =
     Start Sequence :
@@ -431,14 +437,14 @@
   fromASN1 _ = Left "fromASN1: DSA.Signature: unknown format"
 
 -- | Generate CSR.
-generateCSR :: (MonadRandom m, HashAlgorithmConversion hashAlg, HashAlgorithm 
hashAlg) => X520Attributes -> PKCS9Attributes -> KeyPair -> hashAlg -> m 
(Either String CertificationRequest)
+generateCSR :: (MonadRandom m, HashAlgorithmConversion hashAlg, HashAlgorithm 
hashAlg) => X520Attributes -> PKCS9Attributes -> KeyPair -> hashAlg -> m 
(Either Error CertificationRequest)
 
 generateCSR subject extAttrs (KeyPairRSA pubKey privKey) hashAlg =
   f <$> sign certReqInfo
   where
     certReqInfo = makeCertReqInfo subject extAttrs $ PubKeyRSA pubKey
     sign = RSA.signSafer (Just hashAlg) privKey . encodeToDER
-    f = either (Left . show) (Right . certReq)
+    f = either (Left . ASN1UnknownError . show) (Right . certReq)
     certReq s = makeCertReq certReqInfo s hashAlg PubKeyALG_RSA
 
 generateCSR subject extAttrs (KeyPairDSA pubKey privKey) hashAlg =
@@ -517,13 +523,15 @@
 }
 
 -- | Convert ByteString to signed CSR.
-fromDER :: BC.ByteString -> Either String SignedCertificationRequest
+fromDER :: BC.ByteString -> Either Error SignedCertificationRequest
 fromDER bs =
-   fst <$> (parseSignedCertificationRequest =<< decodeDER bs)
+   fst <$> f (parseSignedCertificationRequest =<< decodeDER bs)
+   where
+     f = either (Left . ASN1UnknownError . show) Right
 
 -- | Convert PEM to signed CSR.
-fromPEM :: PEM -> Either String SignedCertificationRequest
+fromPEM :: PEM -> Either Error SignedCertificationRequest
 fromPEM p =
   if pemName p == requestHeader || pemName p == newFormatRequestHeader
   then fromDER . pemContent $ p
-  else Left "PEM: unknown format"
+  else Left PEMUnknownFormat
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pkcs10-0.1.1.0/test/Spec.hs 
new/pkcs10-0.2.0.0/test/Spec.hs
--- old/pkcs10-0.1.1.0/test/Spec.hs     2016-01-01 10:11:59.000000000 +0100
+++ new/pkcs10-0.2.0.0/test/Spec.hs     2016-11-02 10:33:57.000000000 +0100
@@ -210,4 +210,4 @@
 readCSR bs =
   case fromDER bs of
     Right (scr @ SignedCertificationRequest {}) -> scr
-    Left e -> error e
+    Left e -> error . show $ e


Reply via email to