cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1534963 - in /cxf/trunk: rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxSymmetricBindingHandler.java systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/StaxKerberosTokenTest.java
Date Wed, 23 Oct 2013 09:23:14 GMT
Author: coheigea
Date: Wed Oct 23 09:23:14 2013
New Revision: 1534963

URL: http://svn.apache.org/r1534963
Log:
Fixing a derived streaming Kerberos test

Modified:
    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/StaxKerberosTokenTest.java

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=1534963&r1=1534962&r2=1534963&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
Wed Oct 23 09:23:14 2013
@@ -452,6 +452,9 @@ public class StaxSymmetricBindingHandler
             } else if (recToken.getToken() instanceof KerberosToken && !isRequestor())
{
                 config.put(ConfigurationConstants.ENC_KEY_ID, "KerberosSHA1");
                 config.put(ConfigurationConstants.DERIVED_TOKEN_KEY_ID, "KerberosSHA1");
+                if (recToken.getToken().getDerivedKeys() == DerivedKeys.RequireDerivedKeys)
{
+                    config.put(ConfigurationConstants.ENC_KEY_ID, "DirectReference");
+                }
             } else if ((recToken.getToken() instanceof IssuedToken 
                 || recToken.getToken() instanceof SecureConversationToken
                 || recToken.getToken() instanceof SpnegoContextToken) && !isRequestor())
{
@@ -571,7 +574,11 @@ public class StaxSymmetricBindingHandler
             if (isRequestor()) {
                 config.put(ConfigurationConstants.DERIVED_TOKEN_KEY_ID, "DirectReference");
             } else {
-                config.put(ConfigurationConstants.SIG_KEY_ID, "KerberosSHA1");
+                if (wrapper.getToken().getDerivedKeys() == DerivedKeys.RequireDerivedKeys)
{
+                    config.put(ConfigurationConstants.SIG_KEY_ID, "DirectReference");
+                } else {
+                    config.put(ConfigurationConstants.SIG_KEY_ID, "KerberosSHA1");
+                }
                 config.put(ConfigurationConstants.DERIVED_TOKEN_KEY_ID, "KerberosSHA1");
             }
         } else if (policyToken instanceof IssuedToken || policyToken instanceof SecurityContextToken

Modified: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/StaxKerberosTokenTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/StaxKerberosTokenTest.java?rev=1534963&r1=1534962&r2=1534963&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/StaxKerberosTokenTest.java
(original)
+++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/StaxKerberosTokenTest.java
Wed Oct 23 09:23:14 2013
@@ -320,7 +320,7 @@ public class StaxKerberosTokenTest exten
         ((java.io.Closeable)kerberosPort).close();
         bus.shutdown(true);
     }
-    /*
+    
     @org.junit.Test
     public void testKerberosOverSymmetricDerivedProtection() throws Exception {
 
@@ -338,13 +338,17 @@ public class StaxKerberosTokenTest exten
                 service.getPort(portQName, DoubleItPortType.class);
         
         updateAddressPort(kerberosPort, PORT);
-        int result = kerberosPort.doubleIt(25);
-        assertTrue(result == 50);
+        
+        // DOM
+        kerberosPort.doubleIt(25);
+        
+        // Streaming
+        // SecurityTestUtil.enableStreaming(kerberosPort);
+        // kerberosPort.doubleIt(25);
         
         ((java.io.Closeable)kerberosPort).close();
         bus.shutdown(true);
     }
-    */
     
     @org.junit.Test
     public void testKerberosOverAsymmetricSignedEndorsing() throws Exception {



Mime
View raw message