cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject git commit: Minor changes to how tokens are referenced
Date Mon, 19 May 2014 10:34:42 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 846451664 -> 1091ca3db


Minor changes to how tokens are referenced


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/1091ca3d
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/1091ca3d
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/1091ca3d

Branch: refs/heads/master
Commit: 1091ca3dba842093f2a65f3727e44344605b005b
Parents: 8464516
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Mon May 19 11:34:09 2014 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Mon May 19 11:34:25 2014 +0100

----------------------------------------------------------------------
 .../policyhandlers/AbstractBindingBuilder.java   | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/1091ca3d/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
index 6fbf4d7..f87c9fd 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
@@ -1516,23 +1516,24 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
         assertPolicy(wrapper);
         
         if (!tokenTypeSet) {
-            if (token.getIncludeTokenType() == IncludeTokenType.INCLUDE_TOKEN_NEVER) {
+            boolean requestor = isRequestor();
+            if (token.getIncludeTokenType() == IncludeTokenType.INCLUDE_TOKEN_NEVER
+                || token instanceof X509Token 
+                && ((token.getIncludeTokenType() == IncludeTokenType.INCLUDE_TOKEN_ALWAYS_TO_RECIPIENT
+                    && !requestor) 
+                || (token.getIncludeTokenType() == IncludeTokenType.INCLUDE_TOKEN_ALWAYS_TO_INITIATOR
+                    && requestor))) {
                 Wss10 wss = getWss10();
                 assertPolicy(wss);
                 if (wss == null || wss.isMustSupportRefKeyIdentifier()) {
                     secBase.setKeyIdentifierType(WSConstants.SKI_KEY_IDENTIFIER);
                 } else if (wss.isMustSupportRefIssuerSerial()) {
                     secBase.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
-                } else if (wss instanceof Wss11
-                                && ((Wss11) wss).isMustSupportRefThumbprint()) {
+                } else if (wss instanceof Wss11 && ((Wss11) wss).isMustSupportRefThumbprint())
{
                     secBase.setKeyIdentifierType(WSConstants.THUMBPRINT_IDENTIFIER);
+                } else {
+                    secBase.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
                 }
-            } else if (token.getIncludeTokenType() == IncludeTokenType.INCLUDE_TOKEN_ALWAYS_TO_RECIPIENT
-                && !isRequestor() && token instanceof X509Token) {
-                secBase.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
-            } else if (token.getIncludeTokenType() == IncludeTokenType.INCLUDE_TOKEN_ALWAYS_TO_INITIATOR
-                && isRequestor() && token instanceof X509Token) {
-                secBase.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
             } else {
                 secBase.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
             }


Mime
View raw message