[java-metadata-aggregator] branch master updated: JSPT-93 - Clean up API for BaseXXSupport decoders (ENCODE)

Phil Smart philip.smart at jisc.ac.uk
Fri Feb 7 12:12:56 EST 2020


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

philsmart pushed a commit to branch master
in repository java-metadata-aggregator.

View the commit online:
http://git.shibboleth.net/view/?p=java-metadata-aggregator.git;a=commit;h=c958dec411c70dd0a613145ea7488b55eb4d6e8d

The following commit(s) were added to refs/heads/master by this push:
       new  c958dec   JSPT-93 - Clean up API for BaseXXSupport decoders (ENCODE)
c958dec is described below

commit c958dec411c70dd0a613145ea7488b55eb4d6e8d
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Fri Feb 7 17:04:50 2020 +0000

    JSPT-93 - Clean up API for BaseXXSupport decoders (ENCODE)
    
     - Add appropriate error handling for the new EncodingException thrown by the
        Base64Support and Base32Support encode methods.
    
    https://issues.shibboleth.net/jira/browse/JSPT-93
---
 .../net/shibboleth/metadata/dom/XMLSignatureValidator.java   | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XMLSignatureValidator.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XMLSignatureValidator.java
index 19c8105..164280d 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XMLSignatureValidator.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XMLSignatureValidator.java
@@ -28,6 +28,7 @@ import javax.annotation.Nullable;
 
 import net.shibboleth.metadata.dom.ds.XMLDSIGSupport;
 import net.shibboleth.utilities.java.support.codec.Base64Support;
+import net.shibboleth.utilities.java.support.codec.EncodingException;
 import net.shibboleth.utilities.java.support.logic.Constraint;
 import net.shibboleth.utilities.java.support.xml.AttributeSupport;
 import net.shibboleth.utilities.java.support.xml.ElementSupport;
@@ -261,8 +262,15 @@ final class XMLSignatureValidator {
             throw new ValidationException("Signature algorithm " + alg + " is blacklisted");
         }        
 
-        log.debug("Verifying XML signature with key\n{}",
-                Base64Support.encode(verificationKey.getEncoded(), false));
+        if (log.isDebugEnabled()) {
+            try {
+                log.debug("Verifying XML signature with key\n{}",
+                        Base64Support.encode(verificationKey.getEncoded(), false));
+            } catch (final EncodingException e) {
+                //do nothing, as only logging, and this is unlikely. 
+            }
+        }
+        
         
         try {
             if (signature.checkSignatureValue(verificationKey)) {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list