pdt icon indicating copy to clipboard operation
pdt copied to clipboard

PDT fails to handle PHAR (.phar) files signed with a SHA-256 or SHA-512 digest.

Open mhoffrog opened this issue 2 years ago • 0 comments

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

  1. Open Project / Properties
  2. Select PHP / Source Paths / Include Path
  3. Click "Add External PHARs..."
  4. Select e.g. phpunit-8.5.26.phar from the local directory
  5. See error on screen
  6. 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.

mhoffrog avatar May 19 '22 22:05 mhoffrog