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: An efficiency improvement when reconciling encrypted and signed refs
Date Tue, 07 Jul 2015 17:18:38 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes c6fcdcb1e -> 2c2a1971e


An efficiency improvement when reconciling encrypted and signed refs

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


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

Branch: refs/heads/3.0.x-fixes
Commit: d114bd9d19861efb4c777410763bdf22104b83e3
Parents: c6fcdcb
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Tue Jul 7 15:37:09 2015 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Tue Jul 7 18:14:22 2015 +0100

----------------------------------------------------------------------
 .../ws/security/wss4j/CryptoCoverageUtil.java   | 28 ++++++++++++++++++++
 1 file changed, 28 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/d114bd9d/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/CryptoCoverageUtil.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/CryptoCoverageUtil.java
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/CryptoCoverageUtil.java
index a86ee61..d490a4c 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/CryptoCoverageUtil.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/CryptoCoverageUtil.java
@@ -73,6 +73,7 @@ public final class CryptoCoverageUtil {
         
         final List<WSDataRef> encryptedSignedRefs = new LinkedList<WSDataRef>();
         
+<<<<<<< HEAD
         for (WSDataRef encryptedRef : encryptedRefs) {
             final Iterator<WSDataRef> signedRefsIt = signedRefs.iterator();
             while (signedRefsIt.hasNext()) {
@@ -95,6 +96,33 @@ public final class CryptoCoverageUtil {
                     encryptedSignedRef.setXpath(encryptedRef.getXpath());
                     
                     encryptedSignedRefs.add(encryptedSignedRef);
+=======
+        for (WSDataRef signedRef : signedRefs) {
+            Element protectedElement = signedRef.getProtectedElement();
+            if (protectedElement != null
+                && ("EncryptedData".equals(protectedElement.getLocalName())
+                && WSConstants.ENC_NS.equals(protectedElement.getNamespaceURI())
+                || WSConstants.ENCRYPTED_HEADER.equals(protectedElement.getLocalName())
+                && WSConstants.WSSE11_NS.equals(protectedElement.getNamespaceURI())
+                || WSConstants.ENCRYPED_ASSERTION_LN.equals(protectedElement.getLocalName())
+                && WSConstants.SAML2_NS.equals(protectedElement.getNamespaceURI())))
{
+                for (WSDataRef encryptedRef : encryptedRefs) {
+                    if (protectedElement == encryptedRef.getEncryptedElement()) {
+
+                        final WSDataRef encryptedSignedRef = new WSDataRef();
+                        encryptedSignedRef.setWsuId(signedRef.getWsuId());
+                        
+                        encryptedSignedRef.setContent(false);
+                        encryptedSignedRef.setName(encryptedRef.getName());
+                        encryptedSignedRef.setProtectedElement(encryptedRef
+                                .getProtectedElement());
+                        
+                        encryptedSignedRef.setXpath(encryptedRef.getXpath());
+                        
+                        encryptedSignedRefs.add(encryptedSignedRef);
+                        break;
+                    }
+>>>>>>> 4ddc8d5... An efficiency improvement when reconciling encrypted
and signed refs
                 }
             }
         }


Mime
View raw message