cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [1/4] cxf git commit: Secure Conversation fix
Date Fri, 03 Apr 2015 11:35:32 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 102df12c6 -> 33c7781f4


Secure Conversation fix


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

Branch: refs/heads/master
Commit: 33c7781f4f847431a7bbdc9335657d3281cd525e
Parents: d5d87b8
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Fri Apr 3 11:42:26 2015 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Fri Apr 3 12:33:57 2015 +0100

----------------------------------------------------------------------
 .../policy/interceptors/NegotiationUtils.java   | 42 ++++++++++----------
 1 file changed, 22 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/33c7781f/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/NegotiationUtils.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/NegotiationUtils.java
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/NegotiationUtils.java
index 2b0ca66..82862f3 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/NegotiationUtils.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/NegotiationUtils.java
@@ -221,31 +221,33 @@ final class NegotiationUtils {
         }
         
         for (WSHandlerResult rResult : results) {
+            
             List<WSSecurityEngineResult> sctResults = 
                 rResult.getActionResults().get(WSConstants.SCT);
+            if (sctResults != null) {
+                for (WSSecurityEngineResult wser : sctResults) {
+                    SecurityContextToken tok = 
+                        (SecurityContextToken)wser.get(WSSecurityEngineResult.TAG_SECURITY_CONTEXT_TOKEN);
+                    message.getExchange().put(SecurityConstants.TOKEN_ID, tok.getIdentifier());
 
-            for (WSSecurityEngineResult wser : sctResults) {
-                SecurityContextToken tok = 
-                    (SecurityContextToken)wser.get(WSSecurityEngineResult.TAG_SECURITY_CONTEXT_TOKEN);
-                message.getExchange().put(SecurityConstants.TOKEN_ID, tok.getIdentifier());
-
-                SecurityToken token = TokenStoreUtils.getTokenStore(message).getToken(tok.getIdentifier());
-                if (token == null || token.isExpired()) {
-                    byte[] secret = (byte[])wser.get(WSSecurityEngineResult.TAG_SECRET);
-                    if (secret != null) {
-                        token = new SecurityToken(tok.getIdentifier());
-                        token.setToken(tok.getElement());
-                        token.setSecret(secret);
-                        token.setTokenType(tok.getTokenType());
-                        TokenStoreUtils.getTokenStore(message).add(token);
+                    SecurityToken token = TokenStoreUtils.getTokenStore(message).getToken(tok.getIdentifier());
+                    if (token == null || token.isExpired()) {
+                        byte[] secret = (byte[])wser.get(WSSecurityEngineResult.TAG_SECRET);
+                        if (secret != null) {
+                            token = new SecurityToken(tok.getIdentifier());
+                            token.setToken(tok.getElement());
+                            token.setSecret(secret);
+                            token.setTokenType(tok.getTokenType());
+                            TokenStoreUtils.getTokenStore(message).add(token);
+                        }
                     }
-                }
-                if (token != null) {
-                    final SecurityContext sc = token.getSecurityContext();
-                    if (sc != null) {
-                        message.put(SecurityContext.class, sc);
+                    if (token != null) {
+                        final SecurityContext sc = token.getSecurityContext();
+                        if (sc != null) {
+                            message.put(SecurityContext.class, sc);
+                        }
+                        return true;
                     }
-                    return true;
                 }
             }
         }


Mime
View raw message