You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by di...@apache.org on 2005/09/14 17:28:09 UTC

svn commit: r280875 - in /webservices/wss4j/trunk: ./ src/org/apache/ws/sandbox/security/conversation/ src/org/apache/ws/sandbox/security/trust/message/token/ src/org/apache/ws/security/processor/

Author: dims
Date: Wed Sep 14 08:28:04 2005
New Revision: 280875

URL: http://svn.apache.org/viewcvs?rev=280875&view=rev
Log:
make sandbox code happy

Modified:
    webservices/wss4j/trunk/build.xml
    webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/conversation/ConversationEngine.java
    webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/RequestedProofToken.java
    webservices/wss4j/trunk/src/org/apache/ws/security/processor/EncryptedKeyProcessor.java

Modified: webservices/wss4j/trunk/build.xml
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/build.xml?rev=280875&r1=280874&r2=280875&view=diff
==============================================================================
--- webservices/wss4j/trunk/build.xml (original)
+++ webservices/wss4j/trunk/build.xml Wed Sep 14 08:28:04 2005
@@ -334,7 +334,7 @@
         <javac srcdir="${dir.src}" destdir="${build.classes}" debug="on">
             <classpath refid="classpath.library"/>
             <exclude name="**/Merlin.java" unless="jdk14.present"/>
-            <exclude name="**/sandbox/**/*.java" />
+            <!-- <exclude name="**/sandbox/**/*.java" /> -->
         </javac>
         <!-- Copy Property files -->
         <copy todir="${build.classes}">

Modified: webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/conversation/ConversationEngine.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/conversation/ConversationEngine.java?rev=280875&r1=280874&r2=280875&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/conversation/ConversationEngine.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/conversation/ConversationEngine.java Wed Sep 14 08:28:04 2005
@@ -38,6 +38,7 @@
 import org.apache.ws.security.WSSConfig;
 import org.apache.ws.security.WSSecurityEngine;
 import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.processor.EncryptedKeyProcessor;
 import org.apache.ws.security.components.crypto.Crypto;
 import org.apache.ws.security.components.crypto.CryptoFactory;
 import org.apache.ws.sandbox.security.conversation.message.info.DerivedKeyInfo;
@@ -974,9 +975,9 @@
 				throw new ConversationException("Cannot find passwordcallback");
 			}
 
-            WSSecurityEngine eng = new WSSecurityEngine();
-            eng.handleEncryptedKey(eleEnc, cbHandler, crypto);
-            byte[] key = eng.getDecryptedBytes();
+            EncryptedKeyProcessor processor = new EncryptedKeyProcessor();
+            processor.handleEncryptedKey(eleEnc, cbHandler, crypto);
+            byte[] key = processor.getDecryptedBytes();
 
             return key;
 

Modified: webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/RequestedProofToken.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/RequestedProofToken.java?rev=280875&r1=280874&r2=280875&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/RequestedProofToken.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/sandbox/security/trust/message/token/RequestedProofToken.java Wed Sep 14 08:28:04 2005
@@ -23,6 +23,7 @@
 import org.apache.ws.security.WSSConfig;
 import org.apache.ws.security.WSSecurityEngine;
 import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.processor.EncryptedKeyProcessor;
 import org.apache.ws.security.components.crypto.Crypto;
 import org.apache.ws.security.message.WSEncryptBody;
 import org.apache.ws.security.message.token.BinarySecurity;
@@ -138,11 +139,12 @@
                         "RequestedProofToken: cannot create instance of password callback: "
                         + callback +":: ErrMsg "+e.getMessage());
             }
-            secEngine.handleEncryptedKey((Element) ndList.item(0),
+            EncryptedKeyProcessor processor = new EncryptedKeyProcessor();
+            processor.handleEncryptedKey((Element) ndList.item(0),
                     cbHandler,
                     crypto);
 
-            this.sharedSecret = secEngine.getDecryptedBytes();
+            this.sharedSecret = processor.getDecryptedBytes();
             log.debug(" RequestedProofToken, decryption ,Shared secret is :: " + new String(this.sharedSecret));
         } else {
             log.debug("RequestedProofToken :: CallbackHandler is null");

Modified: webservices/wss4j/trunk/src/org/apache/ws/security/processor/EncryptedKeyProcessor.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/security/processor/EncryptedKeyProcessor.java?rev=280875&r1=280874&r2=280875&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/processor/EncryptedKeyProcessor.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/processor/EncryptedKeyProcessor.java Wed Sep 14 08:28:04 2005
@@ -55,6 +55,8 @@
     private static Log tlog =
             LogFactory.getLog("org.apache.ws.security.TIME");
 
+    byte[] decryptedBytes = null;
+
     public void handleToken(Element elem, Crypto crypto, Crypto decCrypto, CallbackHandler cb, WSDocInfo wsDocInfo, Vector returnResults) throws WSSecurityException {
         if (log.isDebugEnabled()) {
             log.debug("Found encrypted key element");
@@ -270,7 +272,7 @@
         } catch (Exception e1) {
             throw new WSSecurityException(WSSecurityException.FAILED_ENC_DEC, null, null, e1);
         }
-        byte[] decryptedBytes = null;
+
         try {
             decryptedBytes =
                     cipher.doFinal(getDecodedBase64EncodedData(xencCipherValue));
@@ -384,4 +386,7 @@
         }
     }
 
+    public byte[] getDecryptedBytes() {
+        return decryptedBytes;
+    }
 }



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