cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1497448 - in /cxf/trunk: rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/ systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/
Date Thu, 27 Jun 2013 17:05:26 GMT
Author: coheigea
Date: Thu Jun 27 17:05:26 2013
New Revision: 1497448

URL: http://svn.apache.org/r1497448
Log:
KerberosToken ProtectionToken test with SymmetricBinding streaming now working

Modified:
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractStaxBindingHandler.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxSymmetricBindingHandler.java
    cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/KerberosTokenTest.java

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractStaxBindingHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractStaxBindingHandler.java?rev=1497448&r1=1497447&r2=1497448&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractStaxBindingHandler.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractStaxBindingHandler.java
Thu Jun 27 17:05:26 2013
@@ -460,6 +460,8 @@ public abstract class AbstractStaxBindin
             && ("IssuerSerial".equals(config.get(ConfigurationConstants.SIG_KEY_ID))
                 || "Thumbprint".equals(config.get(ConfigurationConstants.SIG_KEY_ID)))) {
             config.put(ConfigurationConstants.INCLUDE_SIGNATURE_TOKEN, "true");
+        } else {
+            config.put(ConfigurationConstants.INCLUDE_SIGNATURE_TOKEN, "false");
         }
 
         String userNameKey = SecurityConstants.SIGNATURE_USERNAME;

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxSymmetricBindingHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxSymmetricBindingHandler.java?rev=1497448&r1=1497447&r2=1497448&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxSymmetricBindingHandler.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxSymmetricBindingHandler.java
Thu Jun 27 17:05:26 2013
@@ -141,8 +141,10 @@ public class StaxSymmetricBindingHandler
             //SecureConversationToken
             String tokenId = null;
             SecurityToken tok = null;
-            if (encryptionToken instanceof IssuedToken 
-                || encryptionToken instanceof KerberosToken
+            if (encryptionToken instanceof KerberosToken) {
+                tok = getSecurityToken();
+                addKerberosToken((KerberosToken)encryptionToken, false, false);
+            } else if (encryptionToken instanceof IssuedToken 
                 || encryptionToken instanceof SecureConversationToken
                 || encryptionToken instanceof SecurityContextToken
                 || encryptionToken instanceof SpnegoContextToken) {
@@ -232,10 +234,12 @@ public class StaxSymmetricBindingHandler
         try {
             SecurityToken sigTok = null;
             if (sigToken != null) {
-                if (sigToken instanceof SecureConversationToken
+                if (sigToken instanceof KerberosToken) {
+                    sigTok = getSecurityToken();
+                    addKerberosToken((KerberosToken)sigToken, false, false);
+                } else if (sigToken instanceof SecureConversationToken
                     || sigToken instanceof SecurityContextToken
                     || sigToken instanceof IssuedToken 
-                    || sigToken instanceof KerberosToken
                     || sigToken instanceof SpnegoContextToken) {
                     sigTok = getSecurityToken();
                 } else if (sigToken instanceof X509Token) {
@@ -360,6 +364,10 @@ public class StaxSymmetricBindingHandler
             if (encUser != null) {
                 config.put(ConfigurationConstants.ENCRYPTION_USER, encUser);
             }
+            
+            if (encrToken instanceof KerberosToken) {
+                config.put(ConfigurationConstants.ENC_SYM_ENC_KEY, "false");
+            }
         }
     }
     

Modified: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/KerberosTokenTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/KerberosTokenTest.java?rev=1497448&r1=1497447&r2=1497448&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/KerberosTokenTest.java
(original)
+++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/KerberosTokenTest.java
Thu Jun 27 17:05:26 2013
@@ -303,9 +303,9 @@ public class KerberosTokenTest extends A
         // DOM
         kerberosPort.doubleIt(25);
         
-        // TODO Streaming
-        // SecurityTestUtil.enableStreaming(kerberosPort);
-        // kerberosPort.doubleIt(25);
+        // Streaming
+        SecurityTestUtil.enableStreaming(kerberosPort);
+        kerberosPort.doubleIt(25);
         
         ((java.io.Closeable)kerberosPort).close();
         bus.shutdown(true);



Mime
View raw message