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

ashakirin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/master by this push:
     new d1769b7  Removed useless path validation
d1769b7 is described below

commit d1769b796fdf20e0fb1f72c1db5fd965f1b721ca
Author: Andrei Shakirin <andrei.shaki...@gmail.com>
AuthorDate: Tue May 14 23:17:43 2019 +0200

    Removed useless path validation
---
 .../apache/cxf/xkms/x509/repo/file/FileCertificateRepo.java    | 10 ----------
 1 file changed, 10 deletions(-)

diff --git 
a/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/repo/file/FileCertificateRepo.java
 
b/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/repo/file/FileCertificateRepo.java
index 47379d8..0a70679 100644
--- 
a/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/repo/file/FileCertificateRepo.java
+++ 
b/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/repo/file/FileCertificateRepo.java
@@ -54,7 +54,6 @@ public class FileCertificateRepo implements CertificateRepo {
     private static final String CRLS_PATH = "crls";
     private static final String CAS_PATH = "cas";
     private static final String SPLIT_REGEX = "\\s*,\\s*";
-    private static final Pattern FILE_NAME_PATTERN = 
Pattern.compile("[a-zA-Z_0-9-_]");
     private final File storageDir;
     private final CertificateFactory certFactory;
 
@@ -83,7 +82,6 @@ public class FileCertificateRepo implements CertificateRepo {
         String name = crl.getIssuerX500Principal().getName();
         try {
             String path = convertIdForFileSystem(name) + ".cer";
-            validateFilesystemPath(path);
 
             File certFile = new File(storageDir + "/" + CRLS_PATH, path);
             certFile.getParentFile().mkdirs();
@@ -146,16 +144,9 @@ public class FileCertificateRepo implements 
CertificateRepo {
             path = cert.getSubjectDN().getName();
         }
         path = convertIdForFileSystem(path) + ".cer";
-        validateFilesystemPath(path);
         return path;
     }
 
-    private void validateFilesystemPath(String path) throws URISyntaxException 
{
-        if (!FILE_NAME_PATTERN.matcher(path).find()) {
-            throw new URISyntaxException(path, "Input did not match 
[a-zA-Z_0-9-_].");
-        }
-    }
-
     private File[] getX509Files() {
         List<File> certificateFiles = new ArrayList<>();
         try {
@@ -264,7 +255,6 @@ public class FileCertificateRepo implements CertificateRepo 
{
     public X509Certificate findByEndpoint(String endpoint) {
         try {
             String path = convertIdForFileSystem(endpoint) + ".cer";
-            validateFilesystemPath(path);
             File certFile = new File(storageDir.getAbsolutePath() + "/" + 
path);
             if (!certFile.exists()) {
                 LOG.warn(String.format("Certificate not found for endpoint %s, 
path %s", endpoint,

Reply via email to