You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by bi...@apache.org on 2020/04/15 16:10:13 UTC

[axis-axis2-java-rampart] 04/05: Avoid unnecessary code changes with respect to trunk.

This is an automated email from the ASF dual-hosted git repository.

billblough pushed a commit to branch RAMPART-234
in repository https://gitbox.apache.org/repos/asf/axis-axis2-java-rampart.git

commit ef34b1004aad1d22ef6c9f9c2b706156d0515dbf
Author: Andreas Veithen <ve...@apache.org>
AuthorDate: Sun Jan 29 15:30:18 2017 +0000

    Avoid unnecessary code changes with respect to trunk.
---
 .../src/main/java/org/apache/rampart/util/RampartUtil.java | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/modules/rampart-core/src/main/java/org/apache/rampart/util/RampartUtil.java b/modules/rampart-core/src/main/java/org/apache/rampart/util/RampartUtil.java
index 2de0201..0bfda53 100644
--- a/modules/rampart-core/src/main/java/org/apache/rampart/util/RampartUtil.java
+++ b/modules/rampart-core/src/main/java/org/apache/rampart/util/RampartUtil.java
@@ -1823,12 +1823,16 @@ public class RampartUtil {
      * @throws RampartException
      */
     public static void validateTransport(RampartMessageData rmd) throws RampartException {
-        
+
         MessageContext msgContext = rmd.getMsgContext();
         RampartPolicyData rpd = rmd.getPolicyData();
         AxisConfiguration axisConf = msgContext.getConfigurationContext().getAxisConfiguration();
-        
-        if(rpd != null && rpd.isTransportBinding() && !rmd.isInitiator()){
+
+        if (rpd == null) {
+            return;
+        }
+
+        if (rpd.isTransportBinding() && !rmd.isInitiator()) {
             if (rpd.getTransportToken() instanceof HttpsToken) {
                 try {
                     TransportInDescription transportIn = msgContext.getTransportIn();
@@ -1868,8 +1872,7 @@ public class RampartUtil {
                 // verify client certificate used
                 // try to obtain the client certificate chain directly from the message context
                 // and then from the servlet request
-                HttpsToken token = (HttpsToken)rpd.getTransportToken();
-                if (token.isRequireClientCertificate()) {
+                if (((HttpsToken)rpd.getTransportToken()).isRequireClientCertificate()) {
                     Object certificateChainProperty = msgContext.getProperty(RampartConstants.HTTPS_CLIENT_CERT_KEY);
                     if (certificateChainProperty instanceof X509Certificate[]) {
                         // HTTPS client certificate chain found
@@ -1889,6 +1892,7 @@ public class RampartUtil {
                     // HTTPS client certificate chain NOT found
                     throw new RampartException("httpsClientCertValidationFailed");
                 }
+
             }
         }
     }