diff --git a/src/Composer/Repository/ComposerRepository.php b/src/Composer/Repository/ComposerRepository.php index 194e1c7c3..356a2fbb1 100644 --- a/src/Composer/Repository/ComposerRepository.php +++ b/src/Composer/Repository/ComposerRepository.php @@ -468,8 +468,8 @@ class ComposerRepository extends ArrayRepository implements StreamableRepository continue; } - // TODO throw SecurityException and abort once we are sure this can not happen accidentally $this->io->write('The contents of '.$filename.' do not match its signature, this is most likely due to a temporary glitch but could indicate a man-in-the-middle attack. Try running composer again and please report it if it still persists.'); + throw new RepositorySecurityException('The contents of '.$filename.' do not match its signature'); } $data = JsonFile::parseJson($json, $filename); $this->cache->write($cacheKey, $json); diff --git a/src/Composer/Repository/RepositorySecurityException.php b/src/Composer/Repository/RepositorySecurityException.php new file mode 100644 index 000000000..4a49f11f2 --- /dev/null +++ b/src/Composer/Repository/RepositorySecurityException.php @@ -0,0 +1,22 @@ + + */ +class RepositorySecurityException extends \Exception +{ + // nothing more, standard Exception +} \ No newline at end of file