cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1458252 - in /cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security: policy/ policy/interceptors/ wss4j/
Date Tue, 19 Mar 2013 12:44:27 GMT
Author: coheigea
Date: Tue Mar 19 12:44:27 2013
New Revision: 1458252

URL: http://svn.apache.org/r1458252
Log:
Fixing more failing tests

Modified:
    cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/WSSecurityPolicyLoader.java
    cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationTokenInterceptorProvider.java
    cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/WSSecurityPolicyInterceptorProvider.java
    cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/SamlTokenInterceptor.java
    cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/UsernameTokenInterceptor.java

Modified: cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/WSSecurityPolicyLoader.java
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/WSSecurityPolicyLoader.java?rev=1458252&r1=1458251&r2=1458252&view=diff
==============================================================================
--- cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/WSSecurityPolicyLoader.java
(original)
+++ cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/WSSecurityPolicyLoader.java
Tue Mar 19 12:44:27 2013
@@ -197,7 +197,7 @@ public final class WSSecurityPolicyLoade
             
             // Layout
             SP11Constants.LAX, SP11Constants.LAXTSFIRST, SP11Constants.LAXTSLAST, SP11Constants.STRICT,

-            SP12Constants.LAX, SP12Constants.LAXTSFIRST, SP12Constants.LAXTSLAST, SP11Constants.STRICT,
+            SP12Constants.LAX, SP12Constants.LAXTSFIRST, SP12Constants.LAXTSLAST, SP12Constants.STRICT,
             
             // UsernameToken
             SP11Constants.WSS_USERNAME_TOKEN10, SP12Constants.WSS_USERNAME_TOKEN10,  

Modified: cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationTokenInterceptorProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationTokenInterceptorProvider.java?rev=1458252&r1=1458251&r2=1458252&view=diff
==============================================================================
--- cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationTokenInterceptorProvider.java
(original)
+++ cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationTokenInterceptorProvider.java
Tue Mar 19 12:44:27 2013
@@ -52,7 +52,9 @@ public class SecureConversationTokenInte
 
     public SecureConversationTokenInterceptorProvider() {
         super(Arrays.asList(SP11Constants.SECURE_CONVERSATION_TOKEN,
-                            SP12Constants.SECURE_CONVERSATION_TOKEN));
+                            SP12Constants.SECURE_CONVERSATION_TOKEN,
+                            SP12Constants.BOOTSTRAP_POLICY,
+                            SP11Constants.BOOTSTRAP_POLICY));
         this.getOutInterceptors().add(new SecureConversationOutInterceptor());
         this.getOutFaultInterceptors().add(new SecureConversationOutInterceptor());
         this.getInInterceptors().add(new SecureConversationInInterceptor());

Modified: cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/WSSecurityPolicyInterceptorProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/WSSecurityPolicyInterceptorProvider.java?rev=1458252&r1=1458251&r2=1458252&view=diff
==============================================================================
--- cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/WSSecurityPolicyInterceptorProvider.java
(original)
+++ cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/WSSecurityPolicyInterceptorProvider.java
Tue Mar 19 12:44:27 2013
@@ -64,11 +64,10 @@ public class WSSecurityPolicyInterceptor
         ASSERTION_TYPES.add(SP12Constants.SIGNED_SUPPORTING_TOKENS);
         ASSERTION_TYPES.add(SP12Constants.ENDORSING_SUPPORTING_TOKENS);
         ASSERTION_TYPES.add(SP12Constants.ENCRYPTED_SUPPORTING_TOKENS);
-        ASSERTION_TYPES.add(SP12Constants.ENCRYPTED_SUPPORTING_TOKENS);
+        ASSERTION_TYPES.add(SP12Constants.SIGNED_ENDORSING_SUPPORTING_TOKENS);
         ASSERTION_TYPES.add(SP12Constants.SIGNED_ENCRYPTED_SUPPORTING_TOKENS);
         ASSERTION_TYPES.add(SP12Constants.ENDORSING_ENCRYPTED_SUPPORTING_TOKENS);
         ASSERTION_TYPES.add(SP12Constants.SIGNED_ENDORSING_ENCRYPTED_SUPPORTING_TOKENS);
-        ASSERTION_TYPES.add(SP12Constants.SUPPORTING_TOKENS);
         
         ASSERTION_TYPES.add(SP11Constants.LAYOUT);
         ASSERTION_TYPES.add(SP11Constants.INCLUDE_TIMESTAMP);
@@ -97,7 +96,7 @@ public class WSSecurityPolicyInterceptor
         ASSERTION_TYPES.add(SP11Constants.SUPPORTING_TOKENS);
         ASSERTION_TYPES.add(SP11Constants.SIGNED_SUPPORTING_TOKENS);
         ASSERTION_TYPES.add(SP11Constants.ENDORSING_SUPPORTING_TOKENS);
-        ASSERTION_TYPES.add(SP11Constants.SUPPORTING_TOKENS);
+        ASSERTION_TYPES.add(SP11Constants.SIGNED_ENDORSING_SUPPORTING_TOKENS);
     }
 
     public WSSecurityPolicyInterceptorProvider() {

Modified: cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/SamlTokenInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/SamlTokenInterceptor.java?rev=1458252&r1=1458251&r2=1458252&view=diff
==============================================================================
--- cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/SamlTokenInterceptor.java
(original)
+++ cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/SamlTokenInterceptor.java
Tue Mar 19 12:44:27 2013
@@ -123,7 +123,7 @@ public class SamlTokenInterceptor extend
                                 SamlAssertionWrapper assertionWrapper = 
                                     (SamlAssertionWrapper)result.get(WSSecurityEngineResult.TAG_SAML_ASSERTION);
 
-                                if (!checkVersion(samlToken, assertionWrapper)) {
+                                if (!checkVersion(aim, samlToken, assertionWrapper)) {
                                     ai.setNotAsserted("Wrong SAML Version");
                                 }
                             }
@@ -191,6 +191,10 @@ public class SamlTokenInterceptor extend
     }
 
     protected AbstractToken assertTokens(SoapMessage message) {
+        AssertionInfoMap aim = message.get(AssertionInfoMap.class);
+        assertPolicy(aim, "WssSamlV11Token10");
+        assertPolicy(aim, "WssSamlV11Token11");
+        assertPolicy(aim, "WssSamlV20Token11");
         return assertTokens(message, SPConstants.SAML_TOKEN, true);
     }
 
@@ -366,7 +370,11 @@ public class SamlTokenInterceptor extend
     /**
      * Check the policy version against the received assertion
      */
-    private boolean checkVersion(SamlToken samlToken, SamlAssertionWrapper assertionWrapper)
{
+    private boolean checkVersion(
+        AssertionInfoMap aim,
+        SamlToken samlToken, 
+        SamlAssertionWrapper assertionWrapper
+    ) {
         SamlTokenType tokenType = samlToken.getSamlTokenType();
         if ((tokenType == SamlTokenType.WssSamlV11Token10 
             || tokenType == SamlTokenType.WssSamlV11Token11)
@@ -376,6 +384,7 @@ public class SamlTokenInterceptor extend
             && assertionWrapper.getSamlVersion() != SAMLVersion.VERSION_20) {
             return false;
         }
+        assertPolicy(aim, new QName(samlToken.getVersion().getNamespace(), tokenType.name()));
         return true;
     }
     

Modified: cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/UsernameTokenInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/UsernameTokenInterceptor.java?rev=1458252&r1=1458251&r2=1458252&view=diff
==============================================================================
--- cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/UsernameTokenInterceptor.java
(original)
+++ cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/UsernameTokenInterceptor.java
Tue Mar 19 12:44:27 2013
@@ -257,7 +257,7 @@ public class UsernameTokenInterceptor ex
                 assertPolicy(aim, SPConstants.HASH_PASSWORD);
             }
             
-            if ((tok.getPasswordType() == UsernameToken.PasswordType.NoPassword)
+            if ((tok.getPasswordType() != UsernameToken.PasswordType.NoPassword)
                 && isNonEndorsingSupportingToken(tok)
                 && (princ == null || princ.getPassword() == null)) {
                 ai.setNotAsserted("Username Token No Password supplied");



Mime
View raw message