cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asold...@apache.org
Subject git commit: [CXF-5892] Ensure EncryptedKey references BST before it
Date Fri, 18 Jul 2014 16:32:18 GMT
Repository: cxf
Updated Branches:
  refs/heads/master d1244e191 -> 1bcb4ec0d


[CXF-5892] Ensure EncryptedKey references BST before it


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

Branch: refs/heads/master
Commit: 1bcb4ec0d19267365535340365c7d64a4f9629f4
Parents: d1244e1
Author: Alessio Soldano <asoldano@redhat.com>
Authored: Fri Jul 18 18:31:29 2014 +0200
Committer: Alessio Soldano <asoldano@redhat.com>
Committed: Fri Jul 18 18:31:29 2014 +0200

----------------------------------------------------------------------
 .../wss4j/policyhandlers/AsymmetricBindingHandler.java    | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/1bcb4ec0/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 e71baf7..2182092 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
@@ -521,10 +521,6 @@ public class AsymmetricBindingHandler extends AbstractBindingBuilder
{
                     encr.setKeyEncAlgo(algType.getAsymmetricKeyWrap());
                     encr.prepare(saaj.getSOAPPart(), crypto);
                     
-                    if (encr.getBSTTokenId() != null) {
-                        encr.prependBSTElementToHeader(secHeader);
-                    }
-                    
                     Element encryptedKeyElement = encr.getEncryptedKeyElement();
                     List<Element> attachments = encr.getAttachmentEncryptedDataElements();
                     //Encrypt, get hold of the ref list and add it
@@ -549,6 +545,12 @@ public class AsymmetricBindingHandler extends AbstractBindingBuilder
{
                             }
                         }
                     }
+
+                    // Put BST before EncryptedKey element
+                    if (encr.getBSTTokenId() != null) {
+                        encr.prependBSTElementToHeader(secHeader);
+                    }
+
                     return encr;
                 } catch (WSSecurityException e) {
                     LOG.log(Level.FINE, e.getMessage(), e);


Mime
View raw message