[libpdfbox-java] 01/02: Standards-Version updated to 3.9.8

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Wed Jun 1 06:43:27 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 128d9503461b726307c2cf1b60fdd5866f8e2aee
Author: Emmanuel Bourg <ebourg at apache.org>
Date:   Wed Jun 1 08:31:55 2016 +0200

    Standards-Version updated to 3.9.8
---
 debian/changelog                                   |  6 ++
 debian/control                                     |  2 +-
 pdfbox/build.xml                                   | 81 ++++++++++++++++++----
 .../encryption/PublicKeySecurityHandler.java       | 24 +++----
 4 files changed, 86 insertions(+), 27 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 4d81881..7abc84a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+libpdfbox-java (1:1.8.11+dfsg-2) UNRELEASED; urgency=medium
+
+  * Standards-Version updated to 3.9.8 (no changes)
+
+ -- Emmanuel Bourg <ebourg at apache.org>  Wed, 01 Jun 2016 08:31:37 +0200
+
 libpdfbox-java (1:1.8.11+dfsg-1) unstable; urgency=medium
 
   * debian/watch: add repacksuffix to get back +dfsg in the version.
diff --git a/debian/control b/debian/control
index ceeb8dd..5214eab 100644
--- a/debian/control
+++ b/debian/control
@@ -22,7 +22,7 @@ Build-Depends-Indep: ant-optional,
                      libicu4j-java,
                      maven-repo-helper,
                      poppler-data
-Standards-Version: 3.9.6
+Standards-Version: 3.9.8
 Vcs-Browser: https://anonscm.debian.org/cgit/pkg-java/libpdfbox-java.git
 Vcs-Git: git://anonscm.debian.org/pkg-java/libpdfbox-java.git
 Homepage: http://pdfbox.apache.org
diff --git a/pdfbox/build.xml b/pdfbox/build.xml
index d520a6d..af62437 100644
--- a/pdfbox/build.xml
+++ b/pdfbox/build.xml
@@ -24,8 +24,8 @@
     <property name="build.compiler" value="modern" />
 
     <property name="download.dir" value="download" />
-    <property name="jar.dir" value="external" />
-    <property name="tool.dir" value="tools" />
+    <property name="jar.dir" value="/usr/share/java" />
+    <property name="tool.dir" value="/usr/share/java" />
     <property name="bin.dir" value="bin" />
 
     <property name="project.version" value="1.8.11" />
@@ -64,23 +64,23 @@
     <property name="maven.repo1" value="http://repo1.maven.org/maven2" />
     <property name="maven.repo2" value="http://repo2.maven.org/maven2" />
 
-    <property name="bcprov.name" value="bcprov-jdk15-1.44" />
+    <property name="bcprov.name" value="bcprov" />
     <property name="bcprov.url" value="${maven.repo2}/org/bouncycastle/bcprov-jdk15/1.44/${bcprov.name}.jar" />
     <property name="bcprov.jar" value="${jar.dir}/${bcprov.name}.jar" />
 
-    <property name="bcmail.name" value="bcmail-jdk15-1.44" />
+    <property name="bcmail.name" value="bcmail" />
     <property name="bcmail.url" value="${maven.repo2}/org/bouncycastle/bcmail-jdk15/1.44/${bcmail.name}.jar" />
     <property name="bcmail.jar" value="${jar.dir}/${bcmail.name}.jar" />
 
-    <property name="junit.name" value="junit-4.8.1" />
+    <property name="junit.name" value="junit4" />
     <property name="junit.url" value="${maven.repo2}/junit/junit/4.8.1/${junit.name}.jar" />
     <property name="junit.jar" value="${jar.dir}/${junit.name}.jar" />
 
-    <property name="logging.name" value="commons-logging-1.1.1" />
+    <property name="logging.name" value="commons-logging" />
     <property name="logging.url" value="${maven.repo1}/commons-logging/commons-logging/1.1.1/${logging.name}.jar" />
     <property name="logging.jar" value="${jar.dir}/${logging.name}.jar" />
 
-    <property name="icu4j.name" value="icu4j-3.8" />
+    <property name="icu4j.name" value="icu4j" />
     <property name="icu4j.url" value="${maven.repo1}/com/ibm/icu/icu4j/3.8/${icu4j.name}.jar" />
     <property name="icu4j.jar" value="${jar.dir}/${icu4j.name}.jar" />
 
@@ -177,9 +177,11 @@
         <javac srcdir="${pdfbox.src.dir}" destdir="${pdfbox.dest.dir}"
                target="1.5" source="1.5" debug="on" deprecation="on"
                classpathref="pdfbox.build.classpath" encoding="ISO-8859-1"/>
+<!--
         <javac srcdir="${pdfbox.test.dir}" destdir="${pdfbox.dest.dir}"
                target="1.5" source="1.5" debug="on" deprecation="on"
                classpathref="pdfbox.build.classpath" encoding="ISO-8859-1"/>
+-->
     </target>
 
     <target name="fontbox.compile" depends="fontbox.init"
@@ -188,9 +190,11 @@
         <javac srcdir="${fontbox.src.dir}" destdir="${fontbox.dest.dir}"
                target="1.5" source="1.5" debug="on" deprecation="on"
                classpathref="fontbox.build.classpath" encoding="ISO-8859-1"/>
+<!--
         <javac srcdir="${fontbox.test.dir}" destdir="${fontbox.dest.dir}"
                target="1.5" source="1.5" debug="on" deprecation="on"
                classpathref="fontbox.build.classpath" encoding="ISO-8859-1"/>
+-->
     </target>
 
     <target name="jempbox.compile" depends="jempbox.init"
@@ -199,15 +203,17 @@
         <javac srcdir="${jempbox.src.dir}" destdir="${jempbox.dest.dir}"
                target="1.5" source="1.5" debug="on" deprecation="on"
                classpathref="jempbox.build.classpath" encoding="ISO-8859-1"/>
+<!--
         <javac srcdir="${jempbox.test.dir}" destdir="${jempbox.dest.dir}"
                target="1.5" source="1.5" debug="on" deprecation="on"
                classpathref="jempbox.build.classpath" encoding="ISO-8859-1"/>
+-->
     </target>
 
     <target name="test" depends="testextract,test-junit,testimage" description="Run all the junit tests"/>
 
     <target name="find.adobefiles">
-        <available property="adobefiles.found" file="${dest.dir}/org/apache/pdfbox/resources/cmap"/>
+        <available property="adobefiles.found" file="${pdfbox.dest.dir}/org/apache/pdfbox/resources/cmap"/>
     </target>
 
     <target name="get.adobefiles"
@@ -387,9 +393,7 @@
     </target>
 
     <target name="pdfbox.package" depends="get.externallibs.pdfbox,pdfbox.compile" description="Package pdfbox into a jar file">
-        <propertyfile file="${pdfbox.resources.dir}/org/apache/pdfbox/resources/pdfbox.version">
-            <entry  key="pdfbox.version" value="${pdfbox.release.name}"/>
-        </propertyfile>
+        <echo file="${pdfbox.resources.dir}/org/apache/pdfbox/resources/pdfbox.version">pdfbox.version=${pdfbox.release.name}</echo>
 
         <jar jarfile="./${pdfbox.target.dir}/${pdfbox.release.name}.jar">
             <fileset dir="${pdfbox.dest.dir}"/>
@@ -435,7 +439,7 @@
 
     <!-- We use Maven to create the release packages. Keep this target for -->
     <!-- now for backwards compatibility with old build scripts and habits -->
-    <target name="dist" depends="pdfbox.clean,pdfbox.package,javadoc,build.NET,checkstyle"/>
+    <target name="dist" depends="pdfbox.clean,pdfbox.package,pdfbox.javadoc,build.NET,checkstyle"/>
 
     <target name="clean" depends="fontbox.clean,jempbox.clean,pdfbox.clean"/>
 
@@ -834,7 +838,7 @@
         </exec>
     </target>
 
-    <target name="javadoc" depends="pdfbox.compile" description="Create Javadocs">
+    <target name="pdfbox.javadoc" depends="pdfbox.compile" description="Create Javadocs">
         <javadoc packagenames="org.*"
                sourcepath="${pdfbox.src.dir}"
                destdir="${pdfbox.target.dir}/javadoc"
@@ -846,6 +850,7 @@
                verbose="no"
                classpathref="pdfbox.build.classpath"
                encoding="ISO-8859-1"
+               locale="en"
                breakiterator="yes">
             <link href="http://java.sun.com/j2se/1.5.0/docs/api/"/>
         </javadoc>
@@ -857,4 +862,54 @@
         </replaceregexp>
     </target>
 
+    <target name="fontbox.javadoc" depends="fontbox.compile" description="Create Javadocs">
+        <property name="fontbox.release.name" value="${project.name}-${project.version}" />
+        <javadoc packagenames="org.*"
+               sourcepath="${fontbox.src.dir}"
+               destdir="${fontbox.target.dir}/javadoc"
+               author="true"
+               version="true"
+               use="true"
+               windowtitle="${fontbox.release.name} API"
+               doctitle="${project.name}"
+               verbose="no"
+               classpathref="fontbox.build.classpath"
+               encoding="ISO-8859-1"
+               locale="en"
+               breakiterator="yes">
+            <link href="http://java.sun.com/j2se/1.5.0/docs/api/"/>
+        </javadoc>
+        <!-- PDFBOX-461: Disable javadoc creation timestamp -->
+        <replaceregexp match="<!-- Generated by javadoc .* -->"
+                       replace="<!-- Generated by javadoc -->"
+                       flags="g" byline="true">
+            <fileset dir="${fontbox.target.dir}/javadoc" includes="**/*.html" />
+        </replaceregexp>
+    </target>
+
+    <target name="jempbox.javadoc" depends="jempbox.compile" description="Create Javadocs">
+        <property name="jempbox.release.name" value="${project.name}-${project.version}" />
+        <javadoc packagenames="org.*"
+               sourcepath="${jempbox.src.dir}"
+               destdir="${jempbox.target.dir}/javadoc"
+               author="true"
+               version="true"
+               use="true"
+               windowtitle="${jempbox.release.name} API"
+               doctitle="${project.name}"
+               verbose="no"
+               classpathref="jempbox.build.classpath"
+               encoding="ISO-8859-1"
+               locale="en"
+               breakiterator="yes">
+            <link href="http://java.sun.com/j2se/1.5.0/docs/api/"/>
+        </javadoc>
+        <!-- PDFBOX-461: Disable javadoc creation timestamp -->
+        <replaceregexp match="<!-- Generated by javadoc .* -->"
+                       replace="<!-- Generated by javadoc -->"
+                       flags="g" byline="true">
+            <fileset dir="${jempbox.target.dir}/javadoc" includes="**/*.html" />
+        </replaceregexp>
+    </target>
+
 </project>
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 b1aa400..48160d8 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
@@ -27,6 +27,7 @@ import java.security.KeyStoreException;
 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.Log;
 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.asn1.x509.TBSCertificateStructure;
 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 @@ public class PublicKeySecurityHandler extends SecurityHandler
                     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 @@ public class PublicKeySecurityHandler extends SecurityHandler
         {
             throw new CryptographyException(e);
         }
-        catch (NoSuchProviderException e)
-        {
-            throw new CryptographyException(e);
-        }
         catch (NoSuchAlgorithmException e)
         {
             throw new CryptographyException(e);
@@ -311,7 +309,7 @@ public class PublicKeySecurityHandler extends SecurityHandler
                 pkcs7input[22] = two;
                 pkcs7input[23] = one;
 
-                DERObject obj = createDERForRecipient(pkcs7input, certificate);
+                ASN1Primitive obj = createDERForRecipient(pkcs7input, certificate);
 
                 ByteArrayOutputStream baos = new ByteArrayOutputStream();
 
@@ -378,7 +376,7 @@ public class PublicKeySecurityHandler extends SecurityHandler
 
     }
 
-    private DERObject createDERForRecipient(byte[] in, X509Certificate cert)
+    private ASN1Primitive createDERForRecipient(byte[] in, X509Certificate cert)
         throws IOException,
                GeneralSecurityException
     {
@@ -389,7 +387,7 @@ public class PublicKeySecurityHandler extends SecurityHandler
         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 @@ public class PublicKeySecurityHandler extends SecurityHandler
         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)

-- 
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