Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2CCD218AD0 for ; Thu, 18 Jun 2015 15:37:20 +0000 (UTC) Received: (qmail 70817 invoked by uid 500); 18 Jun 2015 15:37:20 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 70698 invoked by uid 500); 18 Jun 2015 15:37:20 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 70420 invoked by uid 99); 18 Jun 2015 15:37:19 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jun 2015 15:37:19 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B5D5FE3C8E; Thu, 18 Jun 2015 15:37:19 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: coheigea@apache.org To: commits@cxf.apache.org Date: Thu, 18 Jun 2015 15:37:19 -0000 Message-Id: <752d2d3d1f4b4a46911bb76ccb827dc0@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/6] cxf git commit: [CXF-6464] - Minor refactor of applied patch. This closes #77 Repository: cxf Updated Branches: refs/heads/3.0.x-fixes aa85f5f4e -> cd5ac08a5 [CXF-6464] - Minor refactor of applied patch. This closes #77 Conflicts: rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/2c1c3725 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/2c1c3725 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/2c1c3725 Branch: refs/heads/3.0.x-fixes Commit: 2c1c372578ecb436b2ec38909413644277df8e3d Parents: aa85f5f Author: Colm O hEigeartaigh Authored: Thu Jun 18 12:27:29 2015 +0100 Committer: Colm O hEigeartaigh Committed: Thu Jun 18 15:22:53 2015 +0100 ---------------------------------------------------------------------- .../policyhandlers/SymmetricBindingHandler.java | 43 ++++++++++++-------- 1 file changed, 27 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/2c1c3725/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java ---------------------------------------------------------------------- diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java index 6bc2528..717480e 100644 --- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java +++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java @@ -480,12 +480,19 @@ public class SymmetricBindingHandler extends AbstractBindingBuilder { Element encrDKTokenElem = null; encrDKTokenElem = dkEncr.getdktElement(); addDerivedKeyElement(encrDKTokenElem); + Element refList = dkEncr.encryptForExternalRef(null, encrParts); +<<<<<<< HEAD if (atEnd) { this.insertBeforeBottomUp(refList); } else { this.addDerivedKeyElement(refList); } +======= + List attachments = dkEncr.getAttachmentEncryptedDataElements(); + addAttachmentsForEncryption(atEnd, refList, attachments); + +>>>>>>> e9e4d0b... [CXF-6464] - Minor refactor of applied patch. This closes #77 return dkEncr; } catch (Exception e) { LOG.log(Level.FINE, e.getMessage(), e); @@ -589,21 +596,7 @@ public class SymmetricBindingHandler extends AbstractBindingBuilder { Element refList = encr.encryptForRef(null, encrParts); List attachments = encr.getAttachmentEncryptedDataElements(); - if (atEnd) { - this.insertBeforeBottomUp(refList); - if (attachments != null) { - for (Element attachment : attachments) { - this.insertBeforeBottomUp(attachment); - } - } - } else { - this.addDerivedKeyElement(refList); - if (attachments != null) { - for (Element attachment : attachments) { - this.addDerivedKeyElement(attachment); - } - } - } + addAttachmentsForEncryption(atEnd, refList, attachments); return encr; } catch (WSSecurityException e) { @@ -613,7 +606,25 @@ public class SymmetricBindingHandler extends AbstractBindingBuilder { } } return null; - } + } + + private void addAttachmentsForEncryption(boolean atEnd, Element refList, List attachments) { + if (atEnd) { + this.insertBeforeBottomUp(refList); + if (attachments != null) { + for (Element attachment : attachments) { + this.insertBeforeBottomUp(attachment); + } + } + } else { + this.addDerivedKeyElement(refList); + if (attachments != null) { + for (Element attachment : attachments) { + this.addDerivedKeyElement(attachment); + } + } + } + } private byte[] doSignatureDK(List sigs, AbstractTokenWrapper policyAbstractTokenWrapper,