diff --git a/src/Composer/Repository/ComposerRepository.php b/src/Composer/Repository/ComposerRepository.php index fdb7fa5cb..72a392641 100644 --- a/src/Composer/Repository/ComposerRepository.php +++ b/src/Composer/Repository/ComposerRepository.php @@ -431,8 +431,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'); } $this->cache->write($cacheKey, $encoded); diff --git a/src/Composer/Repository/RepositorySecurityException.php b/src/Composer/Repository/RepositorySecurityException.php new file mode 100644 index 000000000..fbb33fadc --- /dev/null +++ b/src/Composer/Repository/RepositorySecurityException.php @@ -0,0 +1,22 @@ + + */ +class Repository\RepositorySecurityException extends \Exception +{ + // nothing more, standard Exception +} \ No newline at end of file