[libpdfbox-java] 02/06: Merged the BouncyCastle patches

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Wed Jun 1 09:09:10 UTC 2016


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to branch master
in repository libpdfbox-java.

commit 57f0758162f10bfb79a137e1ba5ea1c640e48809
Author: Emmanuel Bourg <ebourg at apache.org>
Date:   Wed Jun 1 10:36:24 2016 +0200

    Merged the BouncyCastle patches
---
 debian/changelog                                   |  1 +
 ...7.patch => 01-bouncycastle-compatibility.patch} | 55 +++++++++++++++++-----
 debian/patches/series                              |  7 +--
 3 files changed, 46 insertions(+), 17 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 7b455bc..ddbab1c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
 libpdfbox-java (1:1.8.11+dfsg-2) UNRELEASED; urgency=medium
 
   * Build with maven-debian-helper instead of ant
+  * Merged the BouncyCastle patches
   * Standards-Version updated to 3.9.8 (no changes)
   * Use a secure Vcs-Git URL
 
diff --git a/debian/patches/bc-1.47.patch b/debian/patches/01-bouncycastle-compatibility.patch
similarity index 62%
rename from debian/patches/bc-1.47.patch
rename to debian/patches/01-bouncycastle-compatibility.patch
index eab1c70..a51e6a8 100644
--- a/debian/patches/bc-1.47.patch
+++ b/debian/patches/01-bouncycastle-compatibility.patch
@@ -1,14 +1,19 @@
-Description: adjust to Bouncy Castle >= 1.47
- cf. http://www.bouncycastle.org/wiki/display/JA1/Porting+from+earlier+BC+releases+to+1.47+and+later
+Description: Fix the compatibility with the latest version of BouncyCastle in Debian
 Origin: vendor
 Bug: https://issues.apache.org/jira/browse/PDFBOX-1587
- https://issues.apache.org/jira/browse/PDFBOX-1669
-Author: gregor herrmann <gregoa at debian.org>
-Last-Update: 2016-01-23
-
+     https://issues.apache.org/jira/browse/PDFBOX-1669
+Author: Gregor Herrmann <gregoa at debian.org>, Tony Mancill <tmancill at debian.org>
 --- a/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/PublicKeySecurityHandler.java
 +++ b/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/PublicKeySecurityHandler.java
-@@ -38,8 +38,8 @@
+@@ -27,6 +27,7 @@
+ import java.security.MessageDigest;
+ import java.security.NoSuchAlgorithmException;
+ import java.security.NoSuchProviderException;
++import java.security.PrivateKey;
+ import java.security.SecureRandom;
+ import java.security.cert.X509Certificate;
+ import java.util.Iterator;
+@@ -38,8 +39,8 @@
  import org.apache.commons.logging.LogFactory;
  
  import org.bouncycastle.asn1.ASN1InputStream;
@@ -19,7 +24,35 @@ Last-Update: 2016-01-23
  import org.bouncycastle.asn1.DEROctetString;
  import org.bouncycastle.asn1.DEROutputStream;
  import org.bouncycastle.asn1.DERSet;
-@@ -311,7 +311,7 @@
+@@ -56,6 +57,7 @@
+ import org.bouncycastle.cms.CMSEnvelopedData;
+ import org.bouncycastle.cms.CMSException;
+ import org.bouncycastle.cms.RecipientInformation;
++import org.bouncycastle.cms.jcajce.JceKeyTransEnvelopedRecipient;
+ import org.apache.pdfbox.cos.COSArray;
+ import org.apache.pdfbox.cos.COSString;
+ import org.apache.pdfbox.exceptions.CryptographyException;
+@@ -185,7 +187,7 @@
+                     if (ri.getRID().match(material.getCertificate()) && !foundRecipient)
+                     {
+                         foundRecipient = true;
+-                        envelopedData = ri.getContent(material.getPrivateKey(), "BC");
++                        envelopedData = ri.getContent(new JceKeyTransEnvelopedRecipient((PrivateKey) material.getPrivateKey()).setProvider("BC"));
+                         break;
+                     }
+                 }
+@@ -239,10 +241,6 @@
+         {
+             throw new CryptographyException(e);
+         }
+-        catch (NoSuchProviderException e)
+-        {
+-            throw new CryptographyException(e);
+-        }
+         catch (NoSuchAlgorithmException e)
+         {
+             throw new CryptographyException(e);
+@@ -311,7 +309,7 @@
                  pkcs7input[22] = two;
                  pkcs7input[23] = one;
  
@@ -28,7 +61,7 @@ Last-Update: 2016-01-23
  
                  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  
-@@ -378,7 +378,7 @@
+@@ -378,7 +376,7 @@
  
      }
  
@@ -37,7 +70,7 @@ Last-Update: 2016-01-23
          throws IOException,
                 GeneralSecurityException
      {
-@@ -389,7 +389,7 @@
+@@ -389,7 +387,7 @@
          AlgorithmParameters algorithmparameters = algorithmparametergenerator.generateParameters();
          ByteArrayInputStream bytearrayinputstream = new ByteArrayInputStream(algorithmparameters.getEncoded("ASN.1"));
          ASN1InputStream asn1inputstream = new ASN1InputStream(bytearrayinputstream);
@@ -46,7 +79,7 @@ Last-Update: 2016-01-23
          KeyGenerator keygenerator = KeyGenerator.getInstance(s);
          keygenerator.init(128);
          SecretKey secretkey = keygenerator.generateKey();
-@@ -399,13 +399,13 @@
+@@ -399,13 +397,13 @@
          DEROctetString deroctetstring = new DEROctetString(abyte1);
          KeyTransRecipientInfo keytransrecipientinfo = computeRecipientInfo(cert, secretkey.getEncoded());
          DERSet derset = new DERSet(new RecipientInfo(keytransrecipientinfo));
diff --git a/debian/patches/series b/debian/patches/series
index 45a47f2..bddecbe 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,7 +1,2 @@
-#build.xml.patch
-#build-subproject-docs.patch
-bc-1.47.patch
-#reproducible-build.patch
-05_bc1.51.patch
-#02-bundle-dependencies.patch
+01-bouncycastle-compatibility.patch
 02-jar-packaging.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/libpdfbox-java.git



More information about the pkg-java-commits mailing list