cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [3/3] cxf git commit: Fixing backmerge
Date Tue, 04 Aug 2015 11:16:34 GMT
Fixing backmerge


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

Branch: refs/heads/3.0.x-fixes
Commit: 0479e4610d38cf7561ab594bbb6c61049df3dab2
Parents: 03e18fa
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Tue Aug 4 12:08:01 2015 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Tue Aug 4 12:08:01 2015 +0100

----------------------------------------------------------------------
 .../AsymmetricBindingHandler.java               | 48 +++-----------------
 1 file changed, 7 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/0479e461/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AsymmetricBindingHandler.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AsymmetricBindingHandler.java
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AsymmetricBindingHandler.java
index 7fa6873..c94c913 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AsymmetricBindingHandler.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AsymmetricBindingHandler.java
@@ -454,39 +454,7 @@ public class AsymmetricBindingHandler extends AbstractBindingBuilder
{
             assertPolicy(encrToken);
             AlgorithmSuite algorithmSuite = abinding.getAlgorithmSuite();
             if (encrToken.getDerivedKeys() == DerivedKeys.RequireDerivedKeys) {
-<<<<<<< HEAD
-                try {
-                    WSSecDKEncrypt dkEncr = new WSSecDKEncrypt(wssConfig);
-                    dkEncr.setAttachmentCallbackHandler(new AttachmentCallbackHandler(message));
-                    dkEncr.setStoreBytesInAttachment(storeBytesInAttachment);
-                    if (recToken.getToken().getVersion() == SPConstants.SPVersion.SP11) {
-                        dkEncr.setWscVersion(ConversationConstants.VERSION_05_02);
-                    }
-                    
-                    if (encrKey == null) {
-                        setupEncryptedKey(recToken, encrToken);
-                    }
-                    
-                    dkEncr.setExternalKey(this.encryptedKeyValue, this.encryptedKeyId);
-                    dkEncr.setParts(encrParts);
-                    dkEncr.setCustomValueType(WSConstants.SOAPMESSAGE_NS11 + "#"
-                            + WSConstants.ENC_KEY_VALUE_TYPE);
-                    AlgorithmSuiteType algType = algorithmSuite.getAlgorithmSuiteType();
-                    dkEncr.setSymmetricEncAlgorithm(algType.getEncryption());
-                    dkEncr.setDerivedKeyLength(algType.getEncryptionDerivedKeyLength() /
8);
-                    dkEncr.prepare(saaj.getSOAPPart());
-                    
-                    addDerivedKeyElement(dkEncr.getdktElement());
-                    Element refList = dkEncr.encryptForExternalRef(null, encrParts);
-                    insertBeforeBottomUp(refList);
-                    return dkEncr;
-                } catch (Exception e) {
-                    LOG.log(Level.FINE, e.getMessage(), e);
-                    policyNotAsserted(recToken, e);
-                }
-=======
                 return doEncryptionDerived(recToken, encrToken, encrParts, algorithmSuite);
->>>>>>> 5048d0b... Some refactoring due to WSS-549
             } else {
                 try {
                     WSSecEncrypt encr = new WSSecEncrypt(wssConfig);
@@ -585,28 +553,26 @@ public class AsymmetricBindingHandler extends AbstractBindingBuilder
{
                                      List<WSEncryptionPart> encrParts,
                                      AlgorithmSuite algorithmSuite) {
         try {
-            WSSecDKEncrypt dkEncr = new WSSecDKEncrypt();
-            dkEncr.setIdAllocator(wssConfig.getIdAllocator());
-            dkEncr.setCallbackLookup(callbackLookup);
+            WSSecDKEncrypt dkEncr = new WSSecDKEncrypt(wssConfig);
             dkEncr.setAttachmentCallbackHandler(new AttachmentCallbackHandler(message));
             dkEncr.setStoreBytesInAttachment(storeBytesInAttachment);
             if (recToken.getToken().getVersion() == SPConstants.SPVersion.SP11) {
                 dkEncr.setWscVersion(ConversationConstants.VERSION_05_02);
             }
-
+            
             if (encrKey == null) {
                 setupEncryptedKey(recToken, encrToken);
             }
-
+                    
             dkEncr.setExternalKey(this.encryptedKeyValue, this.encryptedKeyId);
-            dkEncr.getParts().addAll(encrParts);
+            dkEncr.setParts(encrParts);
             dkEncr.setCustomValueType(WSConstants.SOAPMESSAGE_NS11 + "#"
-                + WSConstants.ENC_KEY_VALUE_TYPE);
+                    + WSConstants.ENC_KEY_VALUE_TYPE);
             AlgorithmSuiteType algType = algorithmSuite.getAlgorithmSuiteType();
             dkEncr.setSymmetricEncAlgorithm(algType.getEncryption());
             dkEncr.setDerivedKeyLength(algType.getEncryptionDerivedKeyLength() / 8);
             dkEncr.prepare(saaj.getSOAPPart());
-
+            
             addDerivedKeyElement(dkEncr.getdktElement());
             Element refList = dkEncr.encryptForExternalRef(null, encrParts);
             if (refList != null) {
@@ -615,7 +581,7 @@ public class AsymmetricBindingHandler extends AbstractBindingBuilder {
             return dkEncr;
         } catch (Exception e) {
             LOG.log(Level.FINE, e.getMessage(), e);
-            unassertPolicy(recToken, e);
+            policyNotAsserted(recToken, e);
         }
         
         return null;


Mime
View raw message