#3 Add bouncycastle 1.67 support ( from daviddavid)
Merged 3 years ago by sergiomb. Opened 3 years ago by neoclust.
Unknown source master  into  master

@@ -0,0 +1,50 @@

+ From bec4a46950fb5a81f81baf649edfb0af428c9dd0 Mon Sep 17 00:00:00 2001

+ From: Tilman Hausherr <tilman@apache.org>

+ Date: Thu, 17 Sep 2020 18:05:14 +0000

+ Subject: [PATCH] PDFBOX-4892: replace deprecated DEROutputStream

+ 

+ git-svn-id: https://svn.apache.org/repos/asf/pdfbox/branches/2.0@1881799 13f79535-47bb-0310-9956-ffa450edef68

+ ---

+  .../encryption/PublicKeySecurityHandler.java       | 14 +++++---------

+  1 file changed, 5 insertions(+), 9 deletions(-)

+ 

+ diff --git a/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/PublicKeySecurityHandler.java b/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/PublicKeySecurityHandler.java

+ index 3d65793c34..702622ece9 100644

+ --- a/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/PublicKeySecurityHandler.java

+ +++ b/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/PublicKeySecurityHandler.java

+ @@ -44,12 +44,12 @@

+  import org.apache.pdfbox.cos.COSName;

+  import org.apache.pdfbox.cos.COSString;

+  import org.apache.pdfbox.pdmodel.PDDocument;

+ +import org.bouncycastle.asn1.ASN1Encoding;

+  import org.bouncycastle.asn1.ASN1InputStream;

+  import org.bouncycastle.asn1.ASN1ObjectIdentifier;

+  import org.bouncycastle.asn1.ASN1Primitive;

+  import org.bouncycastle.asn1.ASN1Set;

+  import org.bouncycastle.asn1.DEROctetString;

+ -import org.bouncycastle.asn1.DEROutputStream;

+  import org.bouncycastle.asn1.DERSet;

+  import org.bouncycastle.asn1.cms.ContentInfo;

+  import org.bouncycastle.asn1.cms.EncryptedContentInfo;

+ @@ -477,17 +477,13 @@ private void prepareEncryptionDictAES(PDEncryption encryptionDictionary, COSName

+              pkcs7input[21] = three;

+              pkcs7input[22] = two;

+              pkcs7input[23] = one;

+ -            

+ +

+              ASN1Primitive obj = createDERForRecipient(pkcs7input, certificate);

+ -            

+              ByteArrayOutputStream baos = new ByteArrayOutputStream();

+ -            

+ -            DEROutputStream k = new DEROutputStream(baos);

+ -            

+ -            k.writeObject(obj);

+ -            

+ +            obj.encodeTo(baos, ASN1Encoding.DER);

+ +

+              recipientsField[i] = baos.toByteArray();

+ -            

+ +

+              i++;

+          }

+          return recipientsField;

file modified
+4 -1
@@ -1,6 +1,6 @@

  Name:          pdfbox

  Version:       2.0.21

- Release:       2%{?dist}

+ Release:       3%{?dist}

  Summary:       Apache PDFBox library for working with PDF documents

  License:       ASL 2.0

  URL:           http://pdfbox.apache.org/
@@ -10,6 +10,8 @@

  Patch0:        pdfbox-use-system-liberation-font.patch

  # Use system icc profiles

  Patch1:        pdfbox-use-system-icc-profiles-openicc.patch

+ # Fix build with bouncycastle 1.67

+ Patch2:        0001-replace-deprecated-DEROutputStream.patch

  

  BuildRequires:  maven-local

  BuildRequires:  mvn(commons-io:commons-io)
@@ -112,6 +114,7 @@

  

  %patch0 -p1 -b .font

  %patch1 -b .openicc

+ %patch2 -p1 -b .bouncycastle

  

  # Don't build apps (it's just a bundle of everything)

  %pom_disable_module preflight-app

no initial comment

rebased onto 54bd909

3 years ago

Pull-Request has been merged by sergiomb

3 years ago

thanks please next time do [1] to add also changelog entry

[1]

rpmdev-bumpspec -c "Add bouncycastle 1.67 support (from daviddavid)" pdfbox.spec