You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wss4j-dev@ws.apache.org by mu...@apache.org on 2008/06/05 08:43:19 UTC

svn commit: r663470 - /webservices/wss4j/trunk/src/org/apache/ws/security/processor/SignatureProcessor.java

Author: muthulee
Date: Wed Jun  4 23:43:19 2008
New Revision: 663470

URL: http://svn.apache.org/viewvc?rev=663470&view=rev
Log:
Fixing WSS4J-126 issue.


Modified:
    webservices/wss4j/trunk/src/org/apache/ws/security/processor/SignatureProcessor.java

Modified: webservices/wss4j/trunk/src/org/apache/ws/security/processor/SignatureProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/org/apache/ws/security/processor/SignatureProcessor.java?rev=663470&r1=663469&r2=663470&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/processor/SignatureProcessor.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/processor/SignatureProcessor.java Wed Jun  4 23:43:19 2008
@@ -219,17 +219,16 @@
                         WSSecurityUtil.getKeyLength(signatureMethodURI);
                     
                     secretKey = dktProcessor.getKeyBytes(keyLength);
-                } 
-                else {
-                    if (crypto == null) {
-                        throw new WSSecurityException(WSSecurityException.FAILURE,
-                                "noSigCryptoFile");
-                    }
+                } else {
                     if (el.equals(WSSecurityEngine.binaryToken)) {
                         //TODO: Use results from BinarySecurityTokenProcessor
                         certs = getCertificatesTokenReference((Element) token,
                                 crypto);
                     } else if (el.equals(WSSecurityEngine.SAML_TOKEN)) {
+                        if (crypto == null) {
+                            throw new WSSecurityException(WSSecurityException.FAILURE,
+                                "noSigCryptoFile");
+                        }
                         samlKi = SAMLUtil.getSAMLKeyInfo(
                                 (Element) token, crypto, cb);
                         certs = samlKi.getCerts();
@@ -242,7 +241,10 @@
                                 wsDocInfo.getProcessor(encryptedKeyID);
                         
                         if (encryptKeyProcessor == null ) {
-                        
+                            if (crypto == null) {
+                                throw new WSSecurityException(WSSecurityException.FAILURE,
+                                    "noSigCryptoFile");
+                            }
                             encryptKeyProcessor = new EncryptedKeyProcessor();
                             encryptKeyProcessor.handleEncryptedKey((Element)token, cb, crypto);
                         
@@ -445,6 +447,10 @@
     public X509Certificate[] getCertificatesTokenReference(Element elem,
                                                            Crypto crypto)
             throws WSSecurityException {
+        if (crypto == null) {
+            throw new WSSecurityException(WSSecurityException.FAILURE,
+                    "noSigCryptoFile");
+        }
         BinarySecurity token = createSecurityToken(elem);
         if (token instanceof PKIPathSecurity) {
             return ((PKIPathSecurity) token).getX509Certificates(false, crypto);



---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org