Coder Social home page Coder Social logo

gnupg's People

Contributors

heiglandreas avatar theseer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gnupg's Issues

Class aliasing

Hi there. Thanks for this library. The use of class aliasing seems a bit non-standard, at least it stood out to me anyway.

Would you accept a PR to change this so that this library has it's own GnupgInterface, and then two adapters that implement it, the factory chooses between, rather than have the binary fallback implementation pretend to be the PHP one? (Would require a new major release of this package.)

implode(): Invalid arguments passed

Reproducing issue

  • Download and verify Phive:
wget -O phive.phar "https://phar.io/releases/phive.phar"
wget -O phive.phar.asc "https://phar.io/releases/phive.phar.asc"
gpg --keyserver hkps.pool.sks-keyservers.net --recv-keys 0x9D8A98B29B2D5D79
gpg --verify phive.phar.asc phive.phar
rm phive.phar.asc
chmod +x phive.phar
  • Phive version: 0.13.2
  • Install some executable Phar builds via following commands:
./phive.phar --no-progress --home ./.phive install --trust-gpg-keys 4AA394086372C20A,31C7E470E2138192,8E730BA25823D8B5,CF1A108D0E7AE720 --force-accept-unsigned

Expected

  • There's no error during above command excuting.

Actual

  • The error message is as follows:
Phive 0.13.2 - Copyright (C) 2015-2020 by Arne Blankerts, Sebastian Heuer and Contributors
Copying phpunit-8.5.2.phar to ./tools/phpunit
Downloading https://squizlabs.github.io/PHP_CodeSniffer/phars/phpcs-3.5.4.phar
Downloading https://squizlabs.github.io/PHP_CodeSniffer/phars/phpcs-3.5.4.phar.asc
Copying phpcs-3.5.4.phar to ./tools/phpcs
Downloading https://github.com/phpstan/phpstan/releases/download/0.12.9/phpstan.phar
Downloading https://github.com/phpstan/phpstan/releases/download/0.12.9/phpstan.phar.asc
Downloading key CF1A108D0E7AE720
Trying to connect to keys.openpgp.org (37.218.245.50)
Downloading https://keys.openpgp.org/pks/lookup?op=get&options=mr&search=0xCF1A108D0E7AE720
Successfully downloaded key.

	Fingerprint: D326 80D5 957D C711 6BE2 9C14 CF1A 108D 0E7A E720

	Ondrej Mirtes <[email protected]>

	Created: 2019-12-09

[ERROR]    An error occurred while processing your request:

          implode(): Invalid arguments passed
          
          #0 src/services/signature/gpg/GnupgVerificationResult.php(27)
          phar-io/phive#1 unknown file(0): PharIo\Phive\Cli\Runner->errorHandler()
          phar-io/phive#2 src/services/signature/gpg/GnupgVerificationResult.php(27): implode()
          phar-io/phive#3 src/services/phar/PharDownloader.php(90): PharIo\Phive\GnupgVerificationResult->getStatusMessage()
          phar-io/phive#4 src/services/phar/PharDownloader.php(44): PharIo\Phive\PharDownloader->verifySignature()
          phar-io/phive#5 src/services/phar/PharService.php(22): PharIo\Phive\PharDownloader->download()
          phar-io/phive#6 src/services/phar/InstallService.php(45): PharIo\Phive\PharService->getPharFromRelease()
          phar-io/phive#7 src/commands/install/InstallCommand.php(45): PharIo\Phive\InstallService->execute()
          phar-io/phive#8 src/commands/install/InstallCommand.php(37): PharIo\Phive\InstallCommand->installRequestedPhar()
          phar-io/phive#9 src/shared/cli/Runner.php(193): PharIo\Phive\InstallCommand->execute()
          phar-io/phive#10 src/shared/cli/Runner.php(60): PharIo\Phive\Cli\Runner->execute()
          phar-io/phive#11 (313): PharIo\Phive\Cli\Runner->run()
          phar-io/phive#12 {main}

          Environment: PHP 7.3.17-1+ubuntu18.04.1+deb.sury.org+1
          Phive Version: 0.13.2

          This should not have happened and is most likely a bug.
          Please report it at https://github.com/phar-io/phive/issues, make sure you include
          the full output of this error message. Thank you!

After tracing error message output, I think the problematic code snippets are as follows:

https://github.com/phar-io/phive/blob/e75aa29de010ec25f12afcbe242fc2072284f066/src/services/signature/gpg/GnupgVerificationResult.php#L27

And the $this->verificationData['status'] variable may not be array type.

To resolve this issue, I think it should cast the $this->verificationData['status'] variable to array type before making implode function call.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.