Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported signature #973

Closed
posttechguy opened this issue Jan 31, 2018 · 7 comments
Closed

Unsupported signature #973

posttechguy opened this issue Jan 31, 2018 · 7 comments
Labels

Comments

@posttechguy
Copy link

posttechguy commented Jan 31, 2018

Hi,

I have tried to find a solution for this without any luck. I am using the latest, but cannot say for certain what it is. I don't think that it is a n98 issues so much as environment issue.

I am running PHP5.6 on a vagrant box Ubuntu 14.04 LTS.

I have all the necessary modules loaded

Any help would be greatly appreciated. Thanks

Stack trace:
#0 /vagrant/httpdocs/www/shell/n98-magerun.phar(4): Phar::mapPhar('n98-magerun.pha...')
#1 {main}
  thrown in /vagrant/httpdocs/www/shell/n98-magerun.phar on line 4

Fatal error: Uncaught exception 'PharException' with message 'phar "/vagrant/httpdocs/www/shell/n98-magerun.phar" has a unsupported signature' in /vagrant/httpdocs/www/shell/n98-magerun.phar on line 4

PharException: phar "/vagrant/httpdocs/www/shell/n98-magerun.phar" has a unsupported signature in /vagrant/httpdocs/www/shell/n98-magerun.phar on line 4

Call Stack:
    0.0006     228072   1. {main}() /vagrant/httpdocs/www/shell/n98-magerun.phar:0
    0.0006     228168   2. Phar::mapPhar() /vagrant/httpdocs/www/shell/n98-magerun.phar:4```
@pocallaghan
Copy link
Contributor

Can you run php -r 'print_r(Phar::getSupportedSignatures());' on your vagrant box and show us the output. The Phars are given a signature, running:

$phar = new Phar('n98-magerun.phar');
var_dump($phar->getSignature());

results in:

  ["hash"]=>
  string(128) "13F96C2ED025742E1AD429E1CCD49D79E34950A55B2E17E13D0DCF0B17EA87AA779EC78A411AD22A7C910A2BF0F38018F7DCBC8E01BFA223A814F5F48AE3A63B"
  ["hash_type"]=>
  string(7) "SHA-512"
}

for the latest download. I'm assuming that SHA-512 will not be listed in the output from getSupportedSignatures.

@ktomk
Copy link
Collaborator

ktomk commented Jan 31, 2018

The SHA256 and SHA512 signature support was introduced with API version 1.1.0.
Source; PHP Manual

Which should be no problem for PHP 5.6 at all. It's over a decade or so. Looks a bit strange.

@ktomk ktomk added the support label Jan 31, 2018
@posttechguy
Copy link
Author

You are right pocallaghan

Array ( [0] => MD5 [1] => SHA-1 [2] => OpenSSL )

And ktomk also correct as PHP hash engines enabled include sha512

I seem to remember (not very clearly) a cli command to add hash types. Is that how i fix it?

Thanks

@posttechguy
Copy link
Author

Also here is my phar version info

PHP Version: 5.6.31
phar.phar version: $Id: a58a9f060a207c567585aa4858b862d9278df83d $
Phar EXT version: 2.0.2
Phar API version: 1.1.1
Phar-based phar archives: enabled
Tar-based phar archives: enabled
ZIP-based phar archives: enabled
gzip compression: enabled
bzip2 compression: disabled
supported signatures: MD5, SHA-1, OpenSSL

@pocallaghan
Copy link
Contributor

There's some info in this thread where somebody else was encountering the same issue with phpunit. Seems to be something to do with how your PHP was compiled, i.e. both openssl and hash need to be shared modules, as the determination of support is made at compile, not run time. So if one of them is shared and the other isn't, the extra signatures aren't present.

@posttechguy
Copy link
Author

Thanks pocallaghan, Interesting read and somewhat frustrating as I can't move of of 5.6 for development reasons. Thanks for referencing my ticket there as well. I wonder if n98-magerun could/would "force the usage of legacy SHA-1 hashes" also.

@cmuench
Copy link
Member

cmuench commented Feb 15, 2018

@posttechguy You can build your own phar file. Clone the repository and change the signature in this line: https://github.com/netz98/n98-magerun/blob/master/build.xml#L120

The you are able to build the phar file with phing. Phing will be installed if you run "composer install" after the clone.
The run vendor/bin/phing

@cmuench cmuench closed this as completed May 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants