ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1467225 - in /webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security: handler/WSHandler.java message/WSSecSignature.java
Date Fri, 12 Apr 2013 09:44:09 GMT
Author: coheigea
Date: Fri Apr 12 09:44:09 2013
New Revision: 1467225

URL: http://svn.apache.org/r1467225
Log:
Better Logging + error handling when a Signature Crypto instance isn't specified or cannot
be loaded

Modified:
    webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/handler/WSHandler.java
    webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/WSSecSignature.java

Modified: webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/handler/WSHandler.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/handler/WSHandler.java?rev=1467225&r1=1467224&r2=1467225&view=diff
==============================================================================
--- webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/handler/WSHandler.java
(original)
+++ webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/handler/WSHandler.java
Fri Apr 12 09:44:09 2013
@@ -893,6 +893,11 @@ public abstract class WSHandler {
                     cryptos.put(refId, crypto);
                 }
             }
+            if (crypto == null) {
+                log.warn("The Crypto reference " + refId + " specified by "
+                    + cryptoPropertyRefId + " could not be loaded"
+                );
+            }
         }
         
         //
@@ -907,7 +912,21 @@ public abstract class WSHandler {
                     cryptos.put(propFile, crypto);
                 }
             } 
+            if (crypto == null) {
+                if (propFile == null) {
+                    log.warn(
+                         "The Crypto properties file specified by "
+                         + cryptoPropertyFile + " is null"
+                    );
+                } else {
+                    log.warn(
+                         "The Crypto properties file " + propFile + " specified by "
+                         + cryptoPropertyFile + " could not be loaded or found"
+                    );
+                }
+            }
         }
+
         return crypto;
     }
 

Modified: webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/WSSecSignature.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/WSSecSignature.java?rev=1467225&r1=1467224&r2=1467225&view=diff
==============================================================================
--- webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/WSSecSignature.java
(original)
+++ webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/message/WSSecSignature.java
Fri Apr 12 09:44:09 2013
@@ -783,6 +783,9 @@ public class WSSecSignature extends WSSe
             if (useThisCert == null) {
                 CryptoType cryptoType = new CryptoType(CryptoType.TYPE.ALIAS);
                 cryptoType.setAlias(user);
+                if (crypto == null) {
+                    throw new WSSecurityException(WSSecurityException.FAILURE, "noSigCryptoFile");
+                }
                 certs = crypto.getX509Certificates(cryptoType);
             } else {
                 certs = new X509Certificate[] {useThisCert};



Mime
View raw message