incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i..@apache.org
Subject svn commit: r1539358 - /sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/topology/connector/TopologyRequestValidator.java
Date Wed, 06 Nov 2013 15:21:46 GMT
Author: ieb
Date: Wed Nov  6 15:21:46 2013
New Revision: 1539358

URL: http://svn.apache.org/r1539358
Log:
SLING-3233 NPE in TopologyRequestValidator
Fixed NPE caused by missing http headers if enabled.

Modified:
    sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/topology/connector/TopologyRequestValidator.java

Modified: sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/topology/connector/TopologyRequestValidator.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/topology/connector/TopologyRequestValidator.java?rev=1539358&r1=1539357&r2=1539358&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/topology/connector/TopologyRequestValidator.java
(original)
+++ sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/topology/connector/TopologyRequestValidator.java
Wed Nov  6 15:21:46 2013
@@ -346,6 +346,9 @@ public class TopologyRequestValidator {
      */
     private boolean checkTrustHeader(String bodyHash, String signature) {
         try {
+            if (bodyHash == null || signature == null ) {
+                return false;
+            }
             String[] parts = signature.split("/", 2);
             int keyNo = Integer.parseInt(parts[0]);
             return hmac(keyNo, bodyHash).equals(parts[1]);
@@ -361,6 +364,8 @@ public class TopologyRequestValidator {
             throw new RuntimeException(e.getMessage(), e);
         } catch (NoSuchAlgorithmException e) {
             throw new RuntimeException(e.getMessage(), e);
+        } catch (Exception e) {
+            throw new RuntimeException(e.getMessage(), e);
         }
     }
 



Mime
View raw message