ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1533045 - in /webservices/wss4j/trunk: ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/ ws-security-policy-stax/src/test/java/org/apache/wss4j/policy/stax/test/ ws-security-stax/src/main/java/org/apache/w...
Date Thu, 17 Oct 2013 11:03:54 GMT
Author: coheigea
Date: Thu Oct 17 11:03:53 2013
New Revision: 1533045

URL: http://svn.apache.org/r1533045
Log:
Policy validation fix for an endpoint with SecureConversation

Removed:
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityEvent/SecureConversationTokenSecurityEvent.java
Modified:
    webservices/wss4j/trunk/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/LayoutAssertionState.java
    webservices/wss4j/trunk/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SecureConversationTokenAssertionState.java
    webservices/wss4j/trunk/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/TokenProtectionAssertionState.java
    webservices/wss4j/trunk/ws-security-policy-stax/src/test/java/org/apache/wss4j/policy/stax/test/SecureConversationTokenTest.java
    webservices/wss4j/trunk/ws-security-policy-stax/src/test/java/org/apache/wss4j/policy/stax/test/SupportingTokensTest.java
    webservices/wss4j/trunk/ws-security-policy-stax/src/test/java/org/apache/wss4j/policy/stax/test/SymmetricBindingTest.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSUtils.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityEvent/WSSecurityEventConstants.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/SecurityContextTokenValidatorImpl.java

Modified: webservices/wss4j/trunk/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/LayoutAssertionState.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/LayoutAssertionState.java?rev=1533045&r1=1533044&r2=1533045&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/LayoutAssertionState.java
(original)
+++ webservices/wss4j/trunk/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/LayoutAssertionState.java
Thu Oct 17 11:03:53 2013
@@ -47,7 +47,6 @@ public class LayoutAssertionState extend
                 WSSecurityEventConstants.KerberosToken,
                 WSSecurityEventConstants.SpnegoContextToken,
                 WSSecurityEventConstants.SecurityContextToken,
-                WSSecurityEventConstants.SecureConversationToken,
                 WSSecurityEventConstants.SamlToken,
                 WSSecurityEventConstants.RelToken,
                 WSSecurityEventConstants.HttpsToken,

Modified: webservices/wss4j/trunk/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SecureConversationTokenAssertionState.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SecureConversationTokenAssertionState.java?rev=1533045&r1=1533044&r2=1533045&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SecureConversationTokenAssertionState.java
(original)
+++ webservices/wss4j/trunk/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/SecureConversationTokenAssertionState.java
Thu Oct 17 11:03:53 2013
@@ -18,22 +18,19 @@
  */
 package org.apache.wss4j.policy.stax.assertionStates;
 
-import org.apache.wss4j.policy.WSSPolicyException;
 import org.apache.wss4j.policy.model.AbstractSecurityAssertion;
-import org.apache.wss4j.policy.model.AbstractToken;
-import org.apache.wss4j.policy.model.SecureConversationToken;
-import org.apache.xml.security.stax.securityEvent.SecurityEventConstants;
-import org.apache.xml.security.stax.securityEvent.TokenSecurityEvent;
-import org.apache.xml.security.stax.securityToken.SecurityToken;
-import org.apache.wss4j.stax.securityEvent.SecureConversationTokenSecurityEvent;
 import org.apache.wss4j.stax.securityEvent.WSSecurityEventConstants;
+import org.apache.xml.security.stax.securityEvent.SecurityEventConstants;
 
 /**
  * WSP1.3, 5.4.7 SecureConversationToken Assertion
  */
 
-public class SecureConversationTokenAssertionState extends TokenAssertionState {
+public class SecureConversationTokenAssertionState extends SecurityContextTokenAssertionState
{
 
+    //todo sp:SC13SecurityContextToken:
+    //todo MustNotSendCancel etc...
+    
     public SecureConversationTokenAssertionState(AbstractSecurityAssertion assertion, boolean
asserted, boolean initiator) {
         super(assertion, asserted, initiator);
     }
@@ -41,31 +38,8 @@ public class SecureConversationTokenAsse
     @Override
     public SecurityEventConstants.Event[] getSecurityEventType() {
         return new SecurityEventConstants.Event[]{
-                WSSecurityEventConstants.SecureConversationToken
+                WSSecurityEventConstants.SecurityContextToken
         };
     }
 
-    @Override
-    public boolean assertToken(TokenSecurityEvent<? extends SecurityToken> tokenSecurityEvent,
-                               AbstractToken abstractToken) throws WSSPolicyException {
-        if (!(tokenSecurityEvent instanceof SecureConversationTokenSecurityEvent)) {
-            throw new WSSPolicyException("Expected a SecureConversationSecurityEvent but
got " + tokenSecurityEvent.getClass().getName());
-        }
-        SecureConversationTokenSecurityEvent secureConversationSecurityEvent = (SecureConversationTokenSecurityEvent)
tokenSecurityEvent;
-        SecureConversationToken secureConversationToken = (SecureConversationToken) abstractToken;
-
-        if (secureConversationToken.getIssuerName() != null && !secureConversationToken.getIssuerName().equals(secureConversationSecurityEvent.getIssuerName()))
{
-            setErrorMessage("IssuerName in Policy (" + secureConversationToken.getIssuerName()
+ ") didn't match with the one in the SecureConversationToken (" + secureConversationSecurityEvent.getIssuerName()
+ ")");
-            return false;
-        }
-        if (secureConversationToken.isRequireExternalUriReference() && !secureConversationSecurityEvent.isExternalUriRef())
{
-            setErrorMessage("Policy enforces externalUriRef but we didn't got one");
-            return false;
-        }
-        //todo sp:SC13SecurityContextToken:
-        //todo MustNotSendCancel etc...
-        //always return true to prevent false alarm in case additional tokens with the same
usage
-        //appears in the message but do not fulfill the policy and are also not needed to
fulfil the policy.
-        return true;
-    }
 }

Modified: webservices/wss4j/trunk/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/TokenProtectionAssertionState.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/TokenProtectionAssertionState.java?rev=1533045&r1=1533044&r2=1533045&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/TokenProtectionAssertionState.java
(original)
+++ webservices/wss4j/trunk/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/TokenProtectionAssertionState.java
Thu Oct 17 11:03:53 2013
@@ -64,7 +64,6 @@ public class TokenProtectionAssertionSta
                 SecurityEventConstants.KeyValueToken,
                 WSSecurityEventConstants.RelToken,
                 WSSecurityEventConstants.SamlToken,
-                WSSecurityEventConstants.SecureConversationToken,
                 WSSecurityEventConstants.SecurityContextToken,
                 WSSecurityEventConstants.SpnegoContextToken,
                 WSSecurityEventConstants.UsernameToken,

Modified: webservices/wss4j/trunk/ws-security-policy-stax/src/test/java/org/apache/wss4j/policy/stax/test/SecureConversationTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-policy-stax/src/test/java/org/apache/wss4j/policy/stax/test/SecureConversationTokenTest.java?rev=1533045&r1=1533044&r2=1533045&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-policy-stax/src/test/java/org/apache/wss4j/policy/stax/test/SecureConversationTokenTest.java
(original)
+++ webservices/wss4j/trunk/ws-security-policy-stax/src/test/java/org/apache/wss4j/policy/stax/test/SecureConversationTokenTest.java
Thu Oct 17 11:03:53 2013
@@ -25,7 +25,7 @@ import org.apache.wss4j.stax.ext.WSSCons
 import org.apache.wss4j.stax.securityToken.WSSecurityTokenConstants;
 import org.apache.wss4j.stax.impl.securityToken.X509SecurityTokenImpl;
 import org.apache.wss4j.stax.securityEvent.OperationSecurityEvent;
-import org.apache.wss4j.stax.securityEvent.SecureConversationTokenSecurityEvent;
+import org.apache.wss4j.stax.securityEvent.SecurityContextTokenSecurityEvent;
 import org.apache.wss4j.stax.securityEvent.SignedPartSecurityEvent;
 import org.apache.xml.security.stax.ext.XMLSecurityConstants;
 import org.apache.xml.security.stax.securityEvent.ContentEncryptedElementSecurityEvent;
@@ -34,6 +34,7 @@ import org.testng.Assert;
 import org.testng.annotations.Test;
 
 import javax.xml.namespace.QName;
+
 import java.util.LinkedList;
 import java.util.List;
 
@@ -73,7 +74,7 @@ public class SecureConversationTokenTest
                         "</sp:SymmetricBinding>";
 
         PolicyEnforcer policyEnforcer = buildAndStartPolicyEngine(policyString);
-        SecureConversationTokenSecurityEvent initiatorTokenSecurityEvent = new SecureConversationTokenSecurityEvent();
+        SecurityContextTokenSecurityEvent initiatorTokenSecurityEvent = new SecurityContextTokenSecurityEvent();
         initiatorTokenSecurityEvent.setIssuerName("xs:anyURI");
         initiatorTokenSecurityEvent.setExternalUriRef(true);
         X509SecurityTokenImpl securityToken = getX509Token(WSSecurityTokenConstants.X509V3Token);
@@ -81,7 +82,7 @@ public class SecureConversationTokenTest
         initiatorTokenSecurityEvent.setSecurityToken(securityToken);
         policyEnforcer.registerSecurityEvent(initiatorTokenSecurityEvent);
 
-        SecureConversationTokenSecurityEvent recipientTokenSecurityEvent = new SecureConversationTokenSecurityEvent();
+        SecurityContextTokenSecurityEvent recipientTokenSecurityEvent = new SecurityContextTokenSecurityEvent();
         recipientTokenSecurityEvent.setIssuerName("xs:anyURI");
         recipientTokenSecurityEvent.setExternalUriRef(true);
         securityToken = getX509Token(WSSecurityTokenConstants.X509V3Token);
@@ -144,7 +145,7 @@ public class SecureConversationTokenTest
                         "</wsp:Policy>\n" +
                         "</sp:SymmetricBinding>";
         PolicyEnforcer policyEnforcer = buildAndStartPolicyEngine(policyString);
-        SecureConversationTokenSecurityEvent initiatorTokenSecurityEvent = new SecureConversationTokenSecurityEvent();
+        SecurityContextTokenSecurityEvent initiatorTokenSecurityEvent = new SecurityContextTokenSecurityEvent();
         initiatorTokenSecurityEvent.setIssuerName("sss");
         initiatorTokenSecurityEvent.setExternalUriRef(true);
         InboundSecurityToken securityToken = getX509Token(WSSecurityTokenConstants.X509V3Token);
@@ -152,7 +153,7 @@ public class SecureConversationTokenTest
         initiatorTokenSecurityEvent.setSecurityToken(securityToken);
         policyEnforcer.registerSecurityEvent(initiatorTokenSecurityEvent);
 
-        SecureConversationTokenSecurityEvent recipientTokenSecurityEvent = new SecureConversationTokenSecurityEvent();
+        SecurityContextTokenSecurityEvent recipientTokenSecurityEvent = new SecurityContextTokenSecurityEvent();
         recipientTokenSecurityEvent.setIssuerName("sss");
         recipientTokenSecurityEvent.setExternalUriRef(true);
         securityToken = getX509Token(WSSecurityTokenConstants.X509V3Token);
@@ -184,7 +185,7 @@ public class SecureConversationTokenTest
         } catch (WSSecurityException e) {
             Assert.assertTrue(e.getCause() instanceof PolicyViolationException);
             Assert.assertEquals(e.getCause().getMessage(),
-                    "IssuerName in Policy (xs:anyURI) didn't match with the one in the SecureConversationToken
(sss)");
+                    "IssuerName in Policy (xs:anyURI) didn't match with the one in the SecurityContextToken
(sss)");
             Assert.assertEquals(e.getFaultCode(), WSSecurityException.INVALID_SECURITY);
         }
     }

Modified: webservices/wss4j/trunk/ws-security-policy-stax/src/test/java/org/apache/wss4j/policy/stax/test/SupportingTokensTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-policy-stax/src/test/java/org/apache/wss4j/policy/stax/test/SupportingTokensTest.java?rev=1533045&r1=1533044&r2=1533045&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-policy-stax/src/test/java/org/apache/wss4j/policy/stax/test/SupportingTokensTest.java
(original)
+++ webservices/wss4j/trunk/ws-security-policy-stax/src/test/java/org/apache/wss4j/policy/stax/test/SupportingTokensTest.java
Thu Oct 17 11:03:53 2013
@@ -1015,14 +1015,14 @@ public class SupportingTokensTest extend
 
         PolicyEnforcer policyEnforcer = buildAndStartPolicyEngine(policyString);
 
-        SecureConversationTokenSecurityEvent tokenSecurityEvent = new SecureConversationTokenSecurityEvent();
+        SecurityContextTokenSecurityEvent tokenSecurityEvent = new SecurityContextTokenSecurityEvent();
         tokenSecurityEvent.setIssuerName("CN=transmitter,OU=swssf,C=CH");
         X509SecurityTokenImpl x509SecurityToken = getX509Token(WSSecurityTokenConstants.X509V3Token);
         x509SecurityToken.addTokenUsage(WSSecurityTokenConstants.TokenUsage_SupportingTokens);
         tokenSecurityEvent.setSecurityToken(x509SecurityToken);
         policyEnforcer.registerSecurityEvent(tokenSecurityEvent);
 
-        tokenSecurityEvent = new SecureConversationTokenSecurityEvent();
+        tokenSecurityEvent = new SecurityContextTokenSecurityEvent();
         tokenSecurityEvent.setIssuerName("CN=transmitter,OU=swssf,C=CH");
         x509SecurityToken = getX509Token(WSSecurityTokenConstants.X509V3Token);
         x509SecurityToken.addTokenUsage(WSSecurityTokenConstants.TokenUsage_SupportingTokens);
@@ -1050,14 +1050,14 @@ public class SupportingTokensTest extend
 
         PolicyEnforcer policyEnforcer = buildAndStartPolicyEngine(policyString);
 
-        SecureConversationTokenSecurityEvent tokenSecurityEvent = new SecureConversationTokenSecurityEvent();
+        SecurityContextTokenSecurityEvent tokenSecurityEvent = new SecurityContextTokenSecurityEvent();
         tokenSecurityEvent.setIssuerName("test");
         X509SecurityTokenImpl x509SecurityToken = getX509Token(WSSecurityTokenConstants.X509V3Token);
         x509SecurityToken.addTokenUsage(WSSecurityTokenConstants.TokenUsage_SupportingTokens);
         tokenSecurityEvent.setSecurityToken(x509SecurityToken);
         policyEnforcer.registerSecurityEvent(tokenSecurityEvent);
 
-        tokenSecurityEvent = new SecureConversationTokenSecurityEvent();
+        tokenSecurityEvent = new SecurityContextTokenSecurityEvent();
         tokenSecurityEvent.setIssuerName("test");
         x509SecurityToken = getX509Token(WSSecurityTokenConstants.X509V3Token);
         x509SecurityToken.addTokenUsage(WSSecurityTokenConstants.TokenUsage_SupportingTokens);
@@ -1089,14 +1089,14 @@ public class SupportingTokensTest extend
 
         PolicyEnforcer policyEnforcer = buildAndStartPolicyEngine(policyString);
 
-        SecureConversationTokenSecurityEvent tokenSecurityEvent = new SecureConversationTokenSecurityEvent();
+        SecurityContextTokenSecurityEvent tokenSecurityEvent = new SecurityContextTokenSecurityEvent();
         tokenSecurityEvent.setIssuerName("CN=transmitter,OU=swssf,C=CH");
         X509SecurityTokenImpl x509SecurityToken = getX509Token(WSSecurityTokenConstants.X509V3Token);
         x509SecurityToken.addTokenUsage(WSSecurityTokenConstants.TokenUsage_SupportingTokens);
         tokenSecurityEvent.setSecurityToken(x509SecurityToken);
         policyEnforcer.registerSecurityEvent(tokenSecurityEvent);
 
-        tokenSecurityEvent = new SecureConversationTokenSecurityEvent();
+        tokenSecurityEvent = new SecurityContextTokenSecurityEvent();
         tokenSecurityEvent.setIssuerName("test");
         x509SecurityToken = getX509Token(WSSecurityTokenConstants.X509V3Token);
         x509SecurityToken.addTokenUsage(WSSecurityTokenConstants.TokenUsage_SupportingTokens);
@@ -1124,14 +1124,14 @@ public class SupportingTokensTest extend
 
         PolicyEnforcer policyEnforcer = buildAndStartPolicyEngine(policyString);
 
-        SecureConversationTokenSecurityEvent tokenSecurityEvent = new SecureConversationTokenSecurityEvent();
+        SecurityContextTokenSecurityEvent tokenSecurityEvent = new SecurityContextTokenSecurityEvent();
         tokenSecurityEvent.setIssuerName("test");
         X509SecurityTokenImpl x509SecurityToken = getX509Token(WSSecurityTokenConstants.X509V3Token);
         x509SecurityToken.addTokenUsage(WSSecurityTokenConstants.TokenUsage_SupportingTokens);
         tokenSecurityEvent.setSecurityToken(x509SecurityToken);
         policyEnforcer.registerSecurityEvent(tokenSecurityEvent);
 
-        tokenSecurityEvent = new SecureConversationTokenSecurityEvent();
+        tokenSecurityEvent = new SecurityContextTokenSecurityEvent();
         tokenSecurityEvent.setIssuerName("CN=transmitter,OU=swssf,C=CH");
         x509SecurityToken = getX509Token(WSSecurityTokenConstants.X509V3Token);
         x509SecurityToken.addTokenUsage(WSSecurityTokenConstants.TokenUsage_SupportingTokens);

Modified: webservices/wss4j/trunk/ws-security-policy-stax/src/test/java/org/apache/wss4j/policy/stax/test/SymmetricBindingTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-policy-stax/src/test/java/org/apache/wss4j/policy/stax/test/SymmetricBindingTest.java?rev=1533045&r1=1533044&r2=1533045&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-policy-stax/src/test/java/org/apache/wss4j/policy/stax/test/SymmetricBindingTest.java
(original)
+++ webservices/wss4j/trunk/ws-security-policy-stax/src/test/java/org/apache/wss4j/policy/stax/test/SymmetricBindingTest.java
Thu Oct 17 11:03:53 2013
@@ -65,7 +65,7 @@ public class SymmetricBindingTest extend
         requiredElementSecurityEvent.setElementPath(headerPath);
         policyEnforcer.registerSecurityEvent(requiredElementSecurityEvent);
 
-        SecureConversationTokenSecurityEvent initiatorTokenSecurityEvent = new SecureConversationTokenSecurityEvent();
+        SecurityContextTokenSecurityEvent initiatorTokenSecurityEvent = new SecurityContextTokenSecurityEvent();
         SecureConversationSecurityTokenImpl securityToken =
                 new SecureConversationSecurityTokenImpl(
                         null, "1", WSSecurityTokenConstants.KeyIdentifier_SecurityTokenDirectReference);
@@ -73,7 +73,7 @@ public class SymmetricBindingTest extend
         initiatorTokenSecurityEvent.setSecurityToken(securityToken);
         policyEnforcer.registerSecurityEvent(initiatorTokenSecurityEvent);
 
-        SecureConversationTokenSecurityEvent recipientTokenSecurityEvent = new SecureConversationTokenSecurityEvent();
+        SecurityContextTokenSecurityEvent recipientTokenSecurityEvent = new SecurityContextTokenSecurityEvent();
         securityToken = new SecureConversationSecurityTokenImpl(
                 null, "1", WSSecurityTokenConstants.KeyIdentifier_SecurityTokenDirectReference);
         securityToken.addTokenUsage(WSSecurityTokenConstants.TokenUsage_MainEncryption);
@@ -125,7 +125,7 @@ public class SymmetricBindingTest extend
                         "</sp:SymmetricBinding>";
         PolicyEnforcer policyEnforcer = buildAndStartPolicyEngine(policyString);
 
-        SecureConversationTokenSecurityEvent initiatorTokenSecurityEvent = new SecureConversationTokenSecurityEvent();
+        SecurityContextTokenSecurityEvent initiatorTokenSecurityEvent = new SecurityContextTokenSecurityEvent();
         SecureConversationSecurityTokenImpl securityToken =
                 new SecureConversationSecurityTokenImpl(
                         null, "1", WSSecurityTokenConstants.KeyIdentifier_SecurityTokenDirectReference);
@@ -133,7 +133,7 @@ public class SymmetricBindingTest extend
         initiatorTokenSecurityEvent.setSecurityToken(securityToken);
         policyEnforcer.registerSecurityEvent(initiatorTokenSecurityEvent);
 
-        SecureConversationTokenSecurityEvent recipientTokenSecurityEvent = new SecureConversationTokenSecurityEvent();
+        SecurityContextTokenSecurityEvent recipientTokenSecurityEvent = new SecurityContextTokenSecurityEvent();
         securityToken = new SecureConversationSecurityTokenImpl(
                 null, "1", WSSecurityTokenConstants.KeyIdentifier_SecurityTokenDirectReference);
         securityToken.addTokenUsage(WSSecurityTokenConstants.TokenUsage_MainEncryption);
@@ -174,13 +174,13 @@ public class SymmetricBindingTest extend
                         "</wsp:Policy>\n" +
                         "</sp:SymmetricBinding>";
         PolicyEnforcer policyEnforcer = buildAndStartPolicyEngine(policyString);
-        SecureConversationTokenSecurityEvent secureConversationTokenSecurityEvent = new SecureConversationTokenSecurityEvent();
+        SecurityContextTokenSecurityEvent SecurityContextTokenSecurityEvent = new SecurityContextTokenSecurityEvent();
         SecureConversationSecurityTokenImpl securityToken =
                 new SecureConversationSecurityTokenImpl(
                         null, "1", WSSecurityTokenConstants.KeyIdentifier_SecurityTokenDirectReference);
         securityToken.addTokenUsage(WSSecurityTokenConstants.TokenUsage_MainEncryption);
-        secureConversationTokenSecurityEvent.setSecurityToken(securityToken);
-        policyEnforcer.registerSecurityEvent(secureConversationTokenSecurityEvent);
+        SecurityContextTokenSecurityEvent.setSecurityToken(securityToken);
+        policyEnforcer.registerSecurityEvent(SecurityContextTokenSecurityEvent);
 
         List<XMLSecurityConstants.ContentType> protectionOrder = new LinkedList<XMLSecurityConstants.ContentType>();
         protectionOrder.add(XMLSecurityConstants.ContentType.SIGNATURE);
@@ -222,7 +222,7 @@ public class SymmetricBindingTest extend
         TimestampSecurityEvent timestampSecurityEvent = new TimestampSecurityEvent();
         policyEnforcer.registerSecurityEvent(timestampSecurityEvent);
 
-        SecureConversationTokenSecurityEvent initiatorTokenSecurityEvent = new SecureConversationTokenSecurityEvent();
+        SecurityContextTokenSecurityEvent initiatorTokenSecurityEvent = new SecurityContextTokenSecurityEvent();
         SecureConversationSecurityTokenImpl securityToken =
                 new SecureConversationSecurityTokenImpl(
                         null, "1", WSSecurityTokenConstants.KeyIdentifier_SecurityTokenDirectReference);
@@ -230,7 +230,7 @@ public class SymmetricBindingTest extend
         initiatorTokenSecurityEvent.setSecurityToken(securityToken);
         policyEnforcer.registerSecurityEvent(initiatorTokenSecurityEvent);
 
-        SecureConversationTokenSecurityEvent recipientTokenSecurityEvent = new SecureConversationTokenSecurityEvent();
+        SecurityContextTokenSecurityEvent recipientTokenSecurityEvent = new SecurityContextTokenSecurityEvent();
         securityToken = new SecureConversationSecurityTokenImpl(
                 null, "1", WSSecurityTokenConstants.KeyIdentifier_SecurityTokenDirectReference);
         securityToken.addTokenUsage(WSSecurityTokenConstants.TokenUsage_MainEncryption);
@@ -279,7 +279,7 @@ public class SymmetricBindingTest extend
         TimestampSecurityEvent timestampSecurityEvent = new TimestampSecurityEvent();
         policyEnforcer.registerSecurityEvent(timestampSecurityEvent);
 
-        SecureConversationTokenSecurityEvent initiatorTokenSecurityEvent = new SecureConversationTokenSecurityEvent();
+        SecurityContextTokenSecurityEvent initiatorTokenSecurityEvent = new SecurityContextTokenSecurityEvent();
         SecureConversationSecurityTokenImpl securityToken =
                 new SecureConversationSecurityTokenImpl(
                         null, "1", WSSecurityTokenConstants.KeyIdentifier_SecurityTokenDirectReference);
@@ -287,7 +287,7 @@ public class SymmetricBindingTest extend
         initiatorTokenSecurityEvent.setSecurityToken(securityToken);
         policyEnforcer.registerSecurityEvent(initiatorTokenSecurityEvent);
 
-        SecureConversationTokenSecurityEvent recipientTokenSecurityEvent = new SecureConversationTokenSecurityEvent();
+        SecurityContextTokenSecurityEvent recipientTokenSecurityEvent = new SecurityContextTokenSecurityEvent();
         securityToken = new SecureConversationSecurityTokenImpl(
                 null, "1", WSSecurityTokenConstants.KeyIdentifier_SecurityTokenDirectReference);
         securityToken.addTokenUsage(WSSecurityTokenConstants.TokenUsage_MainEncryption);

Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSUtils.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSUtils.java?rev=1533045&r1=1533044&r2=1533045&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSUtils.java
(original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSUtils.java
Thu Oct 17 11:03:53 2013
@@ -484,8 +484,6 @@ public class WSSUtils extends XMLSecurit
             tokenSecurityEvent = new SpnegoContextTokenSecurityEvent();
         } else if (WSSecurityTokenConstants.SecurityContextToken.equals(tokenType)) {
             tokenSecurityEvent = new SecurityContextTokenSecurityEvent();
-        } else if (WSSecurityTokenConstants.SecureConversationToken.equals(tokenType)) {
-            tokenSecurityEvent = new SecureConversationTokenSecurityEvent();
         } else if (WSSecurityTokenConstants.Saml10Token.equals(tokenType) ||
                 WSSecurityTokenConstants.Saml11Token.equals(tokenType) ||
                 WSSecurityTokenConstants.Saml20Token.equals(tokenType)) {

Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityEvent/WSSecurityEventConstants.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityEvent/WSSecurityEventConstants.java?rev=1533045&r1=1533044&r2=1533045&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityEvent/WSSecurityEventConstants.java
(original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityEvent/WSSecurityEventConstants.java
Thu Oct 17 11:03:53 2013
@@ -34,7 +34,6 @@ public abstract class WSSecurityEventCon
     public static final Event SpnegoContextToken = new Event("SpnegoContextToken");
     public static final Event SamlToken = new Event("SamlToken");
     public static final Event SecurityContextToken = new Event("SecurityContextToken");
-    public static final Event SecureConversationToken = new Event("SecureConversationToken");
     public static final Event RelToken = new Event("RelToken");
     public static final Event UsernameToken = new Event("UsernameToken");
     public static final Event HttpsToken = new Event("HttpsToken");

Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/SecurityContextTokenValidatorImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/SecurityContextTokenValidatorImpl.java?rev=1533045&r1=1533044&r2=1533045&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/SecurityContextTokenValidatorImpl.java
(original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/SecurityContextTokenValidatorImpl.java
Thu Oct 17 11:03:53 2013
@@ -41,7 +41,7 @@ public class SecurityContextTokenValidat
 
         AbstractInboundSecurityToken securityContextToken = new AbstractInboundSecurityToken(
                 tokenContext.getWsSecurityContext(), securityContextTokenType.getId(),
-                WSSecurityTokenConstants.KeyIdentifier_ExternalReference, false) {
+                WSSecurityTokenConstants.KeyIdentifier_ExternalReference, true) {
 
             @Override
             public boolean isAsymmetric() {



Mime
View raw message