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 dk...@apache.org on 2008/12/18 22:21:48 UTC

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

Author: dkulp
Date: Thu Dec 18 13:21:48 2008
New Revision: 727829

URL: http://svn.apache.org/viewvc?rev=727829&view=rev
Log:
make sure the key type is set in other places

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

Modified: webservices/wss4j/trunk/src/org/apache/ws/security/processor/ReferenceListProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/org/apache/ws/security/processor/ReferenceListProcessor.java?rev=727829&r1=727828&r2=727829&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/processor/ReferenceListProcessor.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/processor/ReferenceListProcessor.java Thu Dec 18 13:21:48 2008
@@ -305,19 +305,19 @@
                 decryptedData = keyInfo.getSecret();
             }
         } else if (secRef.containsKeyIdentifier()){
-            if (secRef.getKeyIdentifierValueType().equals(SecurityTokenReference.ENC_KEY_SHA1_URI)) {
-                String sha = secRef.getKeyIdentifierValue();
-                WSPasswordCallback pwcb = new WSPasswordCallback(sha, WSPasswordCallback.ENCRYPTED_KEY_TOKEN);
-                
-                try {
-                    cb.handle(new Callback[]{pwcb});
-                } catch (Exception e) {
-                    throw new WSSecurityException(WSSecurityException.FAILURE,
-                            "noPassword", new Object[] { sha }, e);
-                }
-                decryptedData = pwcb.getKey();
+            String sha = secRef.getKeyIdentifierValue();
+            WSPasswordCallback pwcb = new WSPasswordCallback(secRef.getKeyIdentifierValue(),
+                                                             null,
+                                                             secRef.getKeyIdentifierValueType(),
+                                                             WSPasswordCallback.ENCRYPTED_KEY_TOKEN);
+            
+            try {
+                cb.handle(new Callback[]{pwcb});
+            } catch (Exception e) {
+                throw new WSSecurityException(WSSecurityException.FAILURE,
+                        "noPassword", new Object[] { sha }, e);
             }
-        
+            decryptedData = pwcb.getKey();
         } else {
             throw new WSSecurityException(WSSecurityException.FAILED_CHECK,
                     "noReference");

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=727829&r1=727828&r2=727829&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 Thu Dec 18 13:21:48 2008
@@ -289,7 +289,9 @@
                     
                     String id = secRef.getKeyIdentifierValue();
                     WSPasswordCallback pwcb = new WSPasswordCallback(id,
-                                                       WSPasswordCallback.ENCRYPTED_KEY_TOKEN);
+                                                                     null,
+                                                                     SecurityTokenReference.ENC_KEY_SHA1_URI,
+                                                                     WSPasswordCallback.ENCRYPTED_KEY_TOKEN);
                     try {
                         cb.handle(new Callback[]{pwcb});
                     } catch (Exception e) {



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