cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r790659 - in /cxf/branches/2.2.x-fixes: ./ rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/ rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/
Date Thu, 02 Jul 2009 16:36:25 GMT
Author: dkulp
Date: Thu Jul  2 16:36:25 2009
New Revision: 790659

URL: http://svn.apache.org/viewvc?rev=790659&view=rev
Log:
Merged revisions 790643-790644 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r790643 | dkulp | 2009-07-02 12:19:52 -0400 (Thu, 02 Jul 2009) | 2 lines
  
  Fix SignatureConfirmation with the old interceptors which has never
  worked due to looking in the wrong place for RECV_RESULTS and SND_SIGS.
........
  r790644 | dkulp | 2009-07-02 12:20:01 -0400 (Thu, 02 Jul 2009) | 2 lines
  
  Fix broken test.   Use JUnit assert* instead of JDK assert so if -ea is
  not specified (like default in eclipse), the failures are consistent.
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JInterceptor.java
    cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
    cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java
    cxf/branches/2.2.x-fixes/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SignatureConfirmationTest.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jul  2 16:36:25 2009
@@ -1 +1 @@
-/cxf/trunk:782728-782730,783097,783294,783396,784059,784181-784184,784893,784895,785279-785282,785468,785621,785624,785651,785734,785866,786142,786271-786272,786395,786512,786514,786582-786583,786638,786647,786850,787200,787269,787277-787279,787290-787291,787305,787323,787366,787849,788030,788060,788187,788444,788451,788703,788752,788774,788819-788820,789013,789371,789387,789420,789527-789530,789704-789705,789788,789811,789896-789901,790074,790094,790134,790188,790294,790553,790637-790642
+/cxf/trunk:782728-782730,783097,783294,783396,784059,784181-784184,784893,784895,785279-785282,785468,785621,785624,785651,785734,785866,786142,786271-786272,786395,786512,786514,786582-786583,786638,786647,786850,787200,787269,787277-787279,787290-787291,787305,787323,787366,787849,788030,788060,788187,788444,788451,788703,788752,788774,788819-788820,789013,789371,789387,789420,789527-789530,789704-789705,789788,789811,789896-789901,790074,790094,790134,790188,790294,790553,790637-790644

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JInterceptor.java?rev=790659&r1=790658&r2=790659&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JInterceptor.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JInterceptor.java
Thu Jul  2 16:36:25 2009
@@ -150,6 +150,17 @@
         return MessageUtils.isRequestor(message);
     }  
 
+    protected boolean decodeEnableSignatureConfirmation(RequestData reqData) throws WSSecurityException
{
+
+        String value = getString(WSHandlerConstants.ENABLE_SIGNATURE_CONFIRMATION,
+                reqData.getMsgContext());
+
+        //we need the default to be false to not break older applications and such
+        if (value == null) {
+            return false;
+        }
+        return super.decodeEnableSignatureConfirmation(reqData);
+    }
 
     public Crypto loadSignatureCrypto(RequestData reqData) 
         throws WSSecurityException {

Modified: cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java?rev=790659&r1=790658&r2=790659&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
Thu Jul  2 16:36:25 2009
@@ -127,6 +127,19 @@
         return doc;
     }
     
+    @Override
+    public Object getProperty(Object msgContext, String key) {
+        // use the superclass first
+        Object result = super.getProperty(msgContext, key);
+        
+        // handle the special case of the SEND_SIGV
+        if (result == null 
+            && key == WSHandlerConstants.SEND_SIGV
+            && this.isRequestor((SoapMessage)msgContext)) {
+            result = ((SoapMessage)msgContext).getExchange().getOutMessage().get(key);
+        }               
+        return result;
+    }
     
     public void handleMessage(SoapMessage msg) throws Fault {
         SOAPMessage doc = getSOAPMessage(msg);

Modified: cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java?rev=790659&r1=790658&r2=790659&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JOutInterceptor.java
Thu Jul  2 16:36:25 2009
@@ -83,6 +83,7 @@
         this.mtomEnabled = allowMTOM;
     }
     
+
     @Override
     public Object getProperty(Object msgContext, String key) {
         // use the superclass first
@@ -96,6 +97,7 @@
         }               
         return result;
     }
+
     public void handleMessage(SoapMessage mc) throws Fault {
         //must turn off mtom when using WS-Sec so binary is inlined so it can
         //be properly signed/encrypted/etc...

Modified: cxf/branches/2.2.x-fixes/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SignatureConfirmationTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SignatureConfirmationTest.java?rev=790659&r1=790658&r2=790659&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SignatureConfirmationTest.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SignatureConfirmationTest.java
Thu Jul  2 16:36:25 2009
@@ -77,6 +77,7 @@
         msg.setContent(SOAPMessage.class, saajMsg);
 
         msg.put(WSHandlerConstants.ACTION, WSHandlerConstants.SIGNATURE);
+        msg.put(WSHandlerConstants.ENABLE_SIGNATURE_CONFIRMATION, "true");
         msg.put(WSHandlerConstants.SIG_PROP_FILE, "META-INF/cxf/outsecurity.properties");
         msg.put(WSHandlerConstants.USER, "myalias");
         msg.put("password", "myAliasPassword");
@@ -97,9 +98,9 @@
         // Save the signature for future confirmation
         //
         Object sigv = msg.get(WSHandlerConstants.SEND_SIGV);
-        assert sigv != null;
-        assert sigv instanceof List;
-        assert ((List<Object>)sigv).size() != 0;
+        assertNotNull(sigv);
+        assertTrue(sigv instanceof List);
+        assertTrue(((List<Object>)sigv).size() != 0);
         List<Object> sigSaved = (List<Object>)sigv;
         
         XMLStreamReader reader = StaxUtils.createXMLStreamReader(new ByteArrayInputStream(docbytes));
@@ -123,6 +124,7 @@
 
         inHandler.setProperty(WSHandlerConstants.ACTION, WSHandlerConstants.SIGNATURE);
         inHandler.setProperty(WSHandlerConstants.SIG_PROP_FILE, "META-INF/cxf/insecurity.properties");
+        inHandler.setProperty(WSHandlerConstants.ENABLE_SIGNATURE_CONFIRMATION, "true");
 
         inHandler.handleMessage(inmsg);
         
@@ -134,8 +136,8 @@
         assertNotNull(result);
         
         List<Object> sigReceived = (List<Object>)inmsg.get(WSHandlerConstants.RECV_RESULTS);
-        assert sigReceived != null;
-        assert sigReceived.size() != 0;
+        assertNotNull(sigReceived);
+        assertTrue(sigReceived.size() != 0);
         
         testSignatureConfirmationResponse(sigSaved, sigReceived);
     }



Mime
View raw message