Bläddra i källkod

add back sanity checks

Rob Bast 9 år sedan
förälder
incheckning
008cce8d85
1 ändrade filer med 8 tillägg och 0 borttagningar
  1. 8 0
      src/Composer/Util/RemoteFilesystem.php

+ 8 - 0
src/Composer/Util/RemoteFilesystem.php

@@ -655,6 +655,14 @@ class RemoteFilesystem
             }
         }
 
+        if (isset($options['ssl']['cafile']) && (!is_readable($options['ssl']['cafile']) || !$this->validateCaFile($options['ssl']['cafile']))) {
+            throw new TransportException('The configured cafile was not valid or could not be read.');
+        }
+
+        if (isset($options['ssl']['capath']) && (!is_dir($options['ssl']['capath']) || !is_readable($options['ssl']['capath']))) {
+            throw new TransportException('The configured capath was not valid or could not be read.');
+        }
+
         /**
          * Disable TLS compression to prevent CRIME attacks where supported.
          */