[java-opensaml COMMIT] /trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/common/binding/security/impl/SAMLOut...

noreply at shibboleth.net noreply at shibboleth.net
Mon Jun 2 22:03:16 EDT 2014


Author: scantor
Date: Mon Jun  2 22:03:16 2014
New Revision: 3912

URL: http://svn.shibboleth.net/view/java-opensaml?rev=3912&view=rev
Log:
Fix logging around signature settings.

Modified:
    trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/common/binding/security/impl/SAMLOutboundProtocolMessageSigningHandler.java

Modified: trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/common/binding/security/impl/SAMLOutboundProtocolMessageSigningHandler.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/common/binding/security/impl/SAMLOutboundProtocolMessageSigningHandler.java?rev=3912&r1=3911&r2=3912&view=diff
==============================================================================
--- trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/common/binding/security/impl/SAMLOutboundProtocolMessageSigningHandler.java (original)
+++ trunk/opensaml-saml-impl/src/main/java/org/opensaml/saml/common/binding/security/impl/SAMLOutboundProtocolMessageSigningHandler.java Mon Jun  2 22:03:16 2014
@@ -70,14 +70,19 @@
     protected void doInvoke(@Nonnull final MessageContext<SAMLObject> messageContext) throws MessageHandlerException {
         final SignatureSigningParameters signingParameters = 
                 SAMLMessageSecuritySupport.getContextSigningParameters(messageContext);
-        if (signingParameters != null && (signErrorResponses || !isErrorResponse(messageContext.getMessage()))) {
-            try {
-                SAMLMessageSecuritySupport.signMessage(messageContext);
-            } catch (SecurityException | MarshallingException | SignatureException e) {
-                throw new MessageHandlerException("Error signing outbound protocol message", e);
+        if (signingParameters != null) {
+            if (!signErrorResponses && isErrorResponse(messageContext.getMessage())) {
+                log.debug("{} Message context contained signing parameters, but error response signatures are disabled",
+                        getLogPrefix());
+            } else {
+                try {
+                    SAMLMessageSecuritySupport.signMessage(messageContext);
+                } catch (SecurityException | MarshallingException | SignatureException e) {
+                    throw new MessageHandlerException("Error signing outbound protocol message", e);
+                }
             }
         } else {
-            log.info("{} Message context did not contain signing parameters, outbound message will not be signed",
+            log.debug("{} Message context did not contain signing parameters, outbound message will not be signed",
                     getLogPrefix());
         }
     }



More information about the commits mailing list