cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [2/3] cxf git commit: NPE fix
Date Mon, 27 Feb 2017 12:51:46 GMT
NPE fix

# Conflicts:
#	rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/CryptoCoverageChecker.java


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

Branch: refs/heads/3.1.x-fixes
Commit: 8c57d925223c3b8f9d9b5eeb699837385df9ce77
Parents: a535fb9
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Mon Feb 27 12:49:47 2017 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Mon Feb 27 12:50:14 2017 +0000

----------------------------------------------------------------------
 .../security/wss4j/CryptoCoverageChecker.java   | 30 ++++++++++++++++++++
 1 file changed, 30 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/8c57d925/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/CryptoCoverageChecker.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/CryptoCoverageChecker.java
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/CryptoCoverageChecker.java
index 50d8d32..dff68e6 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/CryptoCoverageChecker.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/CryptoCoverageChecker.java
@@ -137,6 +137,7 @@ public class CryptoCoverageChecker extends AbstractSoapInterceptor {
                 (List<?>) message.get(WSHandlerConstants.RECV_RESULTS));
         
         // Get all encrypted and signed references
+<<<<<<< HEAD
         for (WSHandlerResult wshr : results) {
             List<WSSecurityEngineResult> signedResults = wshr.getActionResults().get(WSConstants.SIGN);
             if (signedResults != null) {
@@ -162,6 +163,35 @@ public class CryptoCoverageChecker extends AbstractSoapInterceptor {
                         CastUtils.cast((List<?>)encryptedResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS));
                     if (el != null) {
                         encrypted.addAll(el);
+=======
+        if (results != null) {
+            for (WSHandlerResult wshr : results) {
+                List<WSSecurityEngineResult> signedResults = wshr.getActionResults().get(WSConstants.SIGN);
+                if (signedResults != null) {
+                    for (WSSecurityEngineResult signedResult : signedResults) {
+                        List<WSDataRef> sl =
+                            CastUtils.cast((List<?>)signedResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS));
+                        if (sl != null) {
+                            if (sl.size() == 1
+                                && sl.get(0).getName().equals(new QName(WSConstants.SIG_NS,
WSConstants.SIG_LN))) {
+                                //endorsing the signature so don't include
+                                continue;
+                            }
+
+                            signed.addAll(sl);
+                        }
+                    }
+                }
+
+                List<WSSecurityEngineResult> encryptedResults = wshr.getActionResults().get(WSConstants.ENCR);
+                if (encryptedResults != null) {
+                    for (WSSecurityEngineResult encryptedResult : encryptedResults) {
+                        List<WSDataRef> el =
+                            CastUtils.cast((List<?>)encryptedResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS));
+                        if (el != null) {
+                            encrypted.addAll(el);
+                        }
+>>>>>>> 156b166... NPE fix
                     }
                 }
             }


Mime
View raw message