[libpdfbox-java] 05/08: Drop 01-bouncycastle-compatibility.patch

Markus Koschany apo at moszumanska.debian.org
Wed Jul 26 21:55:46 UTC 2017


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

apo pushed a commit to annotated tag debian/1%1.8.13-1
in repository libpdfbox-java.

commit 39dfa5f4fda6dace58259a6155e66be03040eadb
Author: Markus Koschany <apo at debian.org>
Date:   Wed Jul 26 22:16:59 2017 +0200

    Drop 01-bouncycastle-compatibility.patch
---
 debian/patches/01-bouncycastle-compatibility.patch | 98 ----------------------
 debian/patches/series                              |  1 -
 2 files changed, 99 deletions(-)

diff --git a/debian/patches/01-bouncycastle-compatibility.patch b/debian/patches/01-bouncycastle-compatibility.patch
deleted file mode 100644
index a51e6a8..0000000
--- a/debian/patches/01-bouncycastle-compatibility.patch
+++ /dev/null
@@ -1,98 +0,0 @@
-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>, 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
-@@ -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;
--import org.bouncycastle.asn1.DERObject;
--import org.bouncycastle.asn1.DERObjectIdentifier;
-+import org.bouncycastle.asn1.ASN1Primitive;
-+import org.bouncycastle.asn1.ASN1ObjectIdentifier;
- import org.bouncycastle.asn1.DEROctetString;
- import org.bouncycastle.asn1.DEROutputStream;
- import org.bouncycastle.asn1.DERSet;
-@@ -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;
- 
--                DERObject obj = createDERForRecipient(pkcs7input, certificate);
-+                ASN1Primitive obj = createDERForRecipient(pkcs7input, certificate);
- 
-                 ByteArrayOutputStream baos = new ByteArrayOutputStream();
- 
-@@ -378,7 +376,7 @@
- 
-     }
- 
--    private DERObject createDERForRecipient(byte[] in, X509Certificate cert)
-+    private ASN1Primitive createDERForRecipient(byte[] in, X509Certificate cert)
-         throws IOException,
-                GeneralSecurityException
-     {
-@@ -389,7 +387,7 @@
-         AlgorithmParameters algorithmparameters = algorithmparametergenerator.generateParameters();
-         ByteArrayInputStream bytearrayinputstream = new ByteArrayInputStream(algorithmparameters.getEncoded("ASN.1"));
-         ASN1InputStream asn1inputstream = new ASN1InputStream(bytearrayinputstream);
--        DERObject derobject = asn1inputstream.readObject();
-+        ASN1Primitive derobject = asn1inputstream.readObject();
-         KeyGenerator keygenerator = KeyGenerator.getInstance(s);
-         keygenerator.init(128);
-         SecretKey secretkey = keygenerator.generateKey();
-@@ -399,13 +397,13 @@
-         DEROctetString deroctetstring = new DEROctetString(abyte1);
-         KeyTransRecipientInfo keytransrecipientinfo = computeRecipientInfo(cert, secretkey.getEncoded());
-         DERSet derset = new DERSet(new RecipientInfo(keytransrecipientinfo));
--        AlgorithmIdentifier algorithmidentifier = new AlgorithmIdentifier(new DERObjectIdentifier(s), derobject);
-+        AlgorithmIdentifier algorithmidentifier = new AlgorithmIdentifier(new ASN1ObjectIdentifier(s), derobject);
-         EncryptedContentInfo encryptedcontentinfo =
-             new EncryptedContentInfo(PKCSObjectIdentifiers.data, algorithmidentifier, deroctetstring);
--        EnvelopedData env = new EnvelopedData(null, derset, encryptedcontentinfo, null);
-+        EnvelopedData env = new EnvelopedData(null, derset, encryptedcontentinfo, (org.bouncycastle.asn1.ASN1Set) null);
-         ContentInfo contentinfo =
-             new ContentInfo(PKCSObjectIdentifiers.envelopedData, env);
--        return contentinfo.getDERObject();
-+        return contentinfo.toASN1Primitive();
-     }
- 
-     private KeyTransRecipientInfo computeRecipientInfo(X509Certificate x509certificate, byte[] abyte0)
diff --git a/debian/patches/series b/debian/patches/series
index bddecbe..2b83427 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1 @@
-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