You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by co...@apache.org on 2015/10/08 12:52:55 UTC

svn commit: r1707471 - in /webservices/wss4j/trunk: ws-security-common/src/main/java/org/apache/wss4j/common/bsp/ ws-security-common/src/main/java/org/apache/wss4j/common/crypto/ ws-security-common/src/main/java/org/apache/wss4j/common/saml/ ws-securit...

Author: coheigea
Date: Thu Oct  8 10:52:54 2015
New Revision: 1707471

URL: http://svn.apache.org/viewvc?rev=1707471&view=rev
Log:
Some minor logging work

Modified:
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/bsp/BSPEnforcer.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/CryptoBase.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/util/Loader.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSignature.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSecSignatureSAML.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/X509SecurityTokenImpl.java

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/bsp/BSPEnforcer.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/bsp/BSPEnforcer.java?rev=1707471&r1=1707470&r2=1707471&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/bsp/BSPEnforcer.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/bsp/BSPEnforcer.java Thu Oct  8 10:52:54 2015
@@ -56,7 +56,7 @@ public class BSPEnforcer {
             throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY, "empty",
                                           new Object[] {"BSP:" + bspRule.name() + ": " + bspRule.getMsg()}
             );
-        } else {
+        } else if (LOG.isDebugEnabled()) {
             LOG.debug("BSP:" + bspRule.name() + ": " + bspRule.getMsg());
         }
     }

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/CryptoBase.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/CryptoBase.java?rev=1707471&r1=1707470&r2=1707471&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/CryptoBase.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/CryptoBase.java Thu Oct  8 10:52:54 2015
@@ -318,7 +318,9 @@ public abstract class CryptoBase impleme
             for (Pattern subjectDNPattern : subjectDNPatterns) {
                 final Matcher matcher = subjectDNPattern.matcher(subjectName);
                 if (matcher.matches()) {
-                    LOG.debug("Subject DN " + subjectName + " matches with pattern " + subjectDNPattern);
+                    if (LOG.isDebugEnabled()) {
+                        LOG.debug("Subject DN " + subjectName + " matches with pattern " + subjectDNPattern);
+                    }
                     subjectMatch = true;
                     break;
                 }

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java?rev=1707471&r1=1707470&r2=1707471&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java Thu Oct  8 10:52:54 2015
@@ -499,7 +499,9 @@ public class SamlAssertionWrapper {
             c14nAlgo = defaultCanonicalizationAlgorithm;
         }
         signature.setCanonicalizationAlgorithm(c14nAlgo);
-        LOG.debug("Using Canonicalization algorithm " + c14nAlgo);
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Using Canonicalization algorithm " + c14nAlgo);
+        }
         // prepare to sign the SAML token
         CryptoType cryptoType = new CryptoType(CryptoType.TYPE.ALIAS);
         cryptoType.setAlias(issuerKeyName);
@@ -521,7 +523,9 @@ public class SamlAssertionWrapper {
         if (pubKeyAlgo.equalsIgnoreCase("DSA")) {
             sigAlgo = defaultDSASignatureAlgorithm;
         }
-        LOG.debug("Using Signature algorithm " + sigAlgo);
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Using Signature algorithm " + sigAlgo);
+        }
         PrivateKey privateKey = null;
         try {
             privateKey = issuerCrypto.getPrivateKey(issuerKeyName, issuerKeyPassword);

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/util/Loader.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/util/Loader.java?rev=1707471&r1=1707470&r2=1707471&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/util/Loader.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/util/Loader.java Thu Oct  8 10:52:54 2015
@@ -55,7 +55,9 @@ public class Loader {
         try {
             ClassLoader classLoader = getTCL();
             if (classLoader != null) {
-                LOG.debug("Trying to find [" + resource + "] using " + classLoader + " class loader.");
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("Trying to find [" + resource + "] using " + classLoader + " class loader.");
+                }
                 url = classLoader.getResource(resource);
                 if (url == null && resource.startsWith("/")) {
                     //certain classloaders need it without the leading /
@@ -86,7 +88,9 @@ public class Loader {
         // may be the case that clazz was loaded by the Extension class
         // loader which the parent of the system class loader. Hence the
         // code below.
-        LOG.debug("Trying to find [" + resource + "] using ClassLoader.getSystemResource().");
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Trying to find [" + resource + "] using ClassLoader.getSystemResource().");
+        }
         return ClassLoader.getSystemResource(resource);
     }
 
@@ -112,7 +116,9 @@ public class Loader {
         URL url = null;
         try {
             if (loader != null) {
-                LOG.debug("Trying to find [" + resource + "] using " + loader + " class loader.");
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("Trying to find [" + resource + "] using " + loader + " class loader.");
+                }
                 url = loader.getResource(resource);
                 if (url == null && resource.startsWith("/")) {
                     //certain classloaders need it without the leading /

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSignature.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSignature.java?rev=1707471&r1=1707470&r2=1707471&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSignature.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSignature.java Thu Oct  8 10:52:54 2015
@@ -834,7 +834,9 @@ public class WSSecSignature extends WSSe
             //
             if (sigAlgo == null) {
                 String pubKeyAlgo = certs[0].getPublicKey().getAlgorithm();
-                LOG.debug("Automatic signature algorithm detection: " + pubKeyAlgo);
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("Automatic signature algorithm detection: " + pubKeyAlgo);
+                }
                 if (pubKeyAlgo.equalsIgnoreCase("DSA")) {
                     sigAlgo = WSConstants.DSA;
                 } else if (pubKeyAlgo.equalsIgnoreCase("RSA")) {

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSecSignatureSAML.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSecSignatureSAML.java?rev=1707471&r1=1707470&r2=1707471&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSecSignatureSAML.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSecSignatureSAML.java Thu Oct  8 10:52:54 2015
@@ -283,7 +283,9 @@ public class WSSecSignatureSAML extends
             }
             
             String pubKeyAlgo = key.getAlgorithm();
-            LOG.debug("automatic sig algo detection: " + pubKeyAlgo);
+            if (doDebug) {
+                LOG.debug("automatic sig algo detection: " + pubKeyAlgo);
+            }
             if (pubKeyAlgo.equalsIgnoreCase("DSA")) {
                 setSignatureAlgorithm(WSConstants.DSA);
             } else if (pubKeyAlgo.equalsIgnoreCase("RSA")) {

Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/X509SecurityTokenImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/X509SecurityTokenImpl.java?rev=1707471&r1=1707470&r2=1707471&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/X509SecurityTokenImpl.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/X509SecurityTokenImpl.java Thu Oct  8 10:52:54 2015
@@ -143,7 +143,9 @@ public abstract class X509SecurityTokenI
             for (Pattern subjectDNPattern : subjectDNPatterns) {
                 final Matcher matcher = subjectDNPattern.matcher(subjectName);
                 if (matcher.matches()) {
-                    LOG.debug("Subject DN " + subjectName + " matches with pattern " + subjectDNPattern);
+                    if (LOG.isDebugEnabled()) {
+                        LOG.debug("Subject DN " + subjectName + " matches with pattern " + subjectDNPattern);
+                    }
                     subjectMatch = true;
                     break;
                 }