poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiwiwi...@apache.org
Subject svn commit: r1641025 - /poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureInfo.java
Date Sat, 22 Nov 2014 01:47:49 GMT
Author: kiwiwings
Date: Sat Nov 22 01:47:48 2014
New Revision: 1641025

URL: http://svn.apache.org/r1641025
Log:
Don't swallow exceptions on validation

Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureInfo.java

Modified: poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureInfo.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureInfo.java?rev=1641025&r1=1641024&r2=1641025&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureInfo.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureInfo.java Sat Nov 22
01:47:48 2014
@@ -217,7 +217,10 @@ public class SignatureInfo implements Si
         
         /**
          * @return true, when the xml signature is valid, false otherwise
+         * 
+         * @throws EncryptedDocumentException if the signature can't be extracted or if its
malformed
          */
+        @SuppressWarnings("unchecked")
         public boolean validate() {
             KeyInfoKeySelector keySelector = new KeyInfoKeySelector();
             try {
@@ -259,8 +262,9 @@ public class SignatureInfo implements Si
                 
                 return valid;
             } catch (Exception e) {
-                LOG.log(POILogger.ERROR, "error in marshalling and validating the signature",
e);
-                return false;
+                String s = "error in marshalling and validating the signature";
+                LOG.log(POILogger.ERROR, s, e);
+                throw new EncryptedDocumentException(s, e);
             }
         }
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message