Blame SOURCES/tika-1.4-bouncycastle-1.50.patch

aa1005
From 27cdcfe0e2b39fdc3ac0620cfb94e1910ca467bb Mon Sep 17 00:00:00 2001
aa1005
From: Michal Srb <msrb@redhat.com>
aa1005
Date: Fri, 7 Mar 2014 08:39:06 +0100
aa1005
Subject: [PATCH] bouncycastle 1.50
aa1005
aa1005
---
aa1005
 .../src/main/java/org/apache/tika/parser/crypto/Pkcs7Parser.java    | 6 +++++-
aa1005
 1 file changed, 5 insertions(+), 1 deletion(-)
aa1005
aa1005
diff --git a/tika-parsers/src/main/java/org/apache/tika/parser/crypto/Pkcs7Parser.java b/tika-parsers/src/main/java/org/apache/tika/parser/crypto/Pkcs7Parser.java
aa1005
index d66b95e..094659b 100644
aa1005
--- a/tika-parsers/src/main/java/org/apache/tika/parser/crypto/Pkcs7Parser.java
aa1005
+++ b/tika-parsers/src/main/java/org/apache/tika/parser/crypto/Pkcs7Parser.java
aa1005
@@ -31,6 +31,8 @@ import org.apache.tika.parser.Parser;
aa1005
 import org.bouncycastle.cms.CMSException;
aa1005
 import org.bouncycastle.cms.CMSSignedDataParser;
aa1005
 import org.bouncycastle.cms.CMSTypedStream;
aa1005
+import org.bouncycastle.operator.OperatorCreationException;
aa1005
+import org.bouncycastle.operator.jcajce.JcaDigestCalculatorProviderBuilder;
aa1005
 import org.xml.sax.ContentHandler;
aa1005
 import org.xml.sax.SAXException;
aa1005
 
aa1005
@@ -58,7 +60,7 @@ public class Pkcs7Parser extends AbstractParser {
aa1005
             throws IOException, SAXException, TikaException {
aa1005
         try {
aa1005
             CMSSignedDataParser parser =
aa1005
-                    new CMSSignedDataParser(new CloseShieldInputStream(stream));
aa1005
+                  new CMSSignedDataParser(new JcaDigestCalculatorProviderBuilder().setProvider("BC").build(), new CloseShieldInputStream(stream));
aa1005
             try {
aa1005
                 CMSTypedStream content = parser.getSignedContent();     
aa1005
                 if (content == null) {
aa1005
@@ -77,6 +79,8 @@ public class Pkcs7Parser extends AbstractParser {
aa1005
             }
aa1005
         } catch (CMSException e) {
aa1005
             throw new TikaException("Unable to parse pkcs7 signed data", e);
aa1005
+        } catch (OperatorCreationException e) {
aa1005
+            throw new TikaException("Unable to parse pkcs7 signed data", e);
aa1005
         }
aa1005
     }
aa1005
 
aa1005
-- 
aa1005
1.8.5.3
aa1005