pdt
pdt copied to clipboard
PDT fails to handle PHAR (.phar) files signed with a SHA-256 or SHA-512 digest.
Describe the bug If a .phar file is signed with SHA-256 or SHA-512 digest, then PDT cannot handle it. E.g.: If such a .phar file is added to the include path, then It is marked with the error icon and an error message like "Build path entry is invalid: org.eclipse.dltk.core.environment.localEnvironment/D:/Tools/phpunit-8.5.26.phar".
Describe the Eclipse environment Eclipse Version: 2021-09 (4.21.0) Build id: 20210910-1417 PDT version 7.2.0.202005271851
Describe your system
- OS: Windows 10 Professional
To Reproduce Download https://phar.phpunit.de/phpunit-8.5.26.phar to a local directory
- Open Project / Properties
- Select PHP / Source Paths / Include Path
- Click "Add External PHARs..."
- Select e.g.
phpunit-8.5.26.phar
from the local directory - See error on screen
- See Eclipse <WORKSPACE>/.metadata/.log:
!MESSAGE PHPDebug plugin internal error !STACK 0 org.eclipse.php.internal.core.phar.PharException: The signature of the phar is unsupported at org.eclipse.php.internal.core.phar.PharFile.getEntries(PharFile.java:222) at org.eclipse.php.internal.core.phar.PharFile.init(PharFile.java:83) at org.eclipse.php.internal.core.phar.PharFile.<init>(PharFile.java:48) at org.eclipse.php.internal.core.phar.PharFile.<init>(PharFile.java:56) at org.eclipse.php.internal.core.phar.PharArchiveFile.<init>(PharArchiveFile.java:44)
Expected behavior PDT should support PHAR files signed with SHA-256 or SHA-512 digest.
Root cause
Class org.eclipse.php.internal.core.phar.digest.Digest
does not yet support SHA-256 or SHA-512 digest based signatures.