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

Creativestyle AmazonCheckout: System Requirements: Unsupported version of phpseclib installed. #3652

Open
tim-breitenstein-it opened this issue Nov 13, 2023 · 5 comments
Labels

Comments

@tim-breitenstein-it
Copy link
Contributor

tim-breitenstein-it commented Nov 13, 2023

Preconditions (*)

  1. Official Amazon Pay für OpenMage
  2. Download Amazon Pay (Checkout v2) for OpenMage

Steps to reproduce (*)

  1. Download and Install the Amazon Pay (Checkout v2) for OpenMage Extension

Expected result (*)

  1. No system requirement error

Actual result (*)

  1. image

(possible) Solution

  1. composer require phpseclib/phpseclib2_compat:~1.0
  2. Because phpseclib/mcrypt_compat is installed as well phpseclib/phpseclib2_compat would also be helpful

Amazon Pay (Checkout v2) for OpenMage Extension Check for phpseclib:

        try {
            if (class_exists('Crypt_RSA', false)) {
                $rsa = new Crypt_RSA();
            } elseif (class_exists('\phpseclib\Crypt\RSA', true)) {
                $rsa = new \phpseclib\Crypt\RSA();
            } else {
                return false;
            }

            $rsa->setHash(AmazonPayV2_Client::HASH_ALGORITHM);
            $rsa->setMGFHash(AmazonPayV2_Client::HASH_ALGORITHM);
            $rsa->setSaltLength(20);

            $rsa->loadKey($this->_getDummyPrivateKey());

            if (empty($rsa->modulus) || empty($rsa->exponent)) {
                return false;
            }

        } catch (Exception $e) {
            return false;
        }

        return true;

phpseclib:v3 need phpseclib3 instead of phpseclib and has some significant code changes as well.

In this Commit a3a54fd#diff-d2ab9925cad7eac58e0ff4cc0d251a937ecf49e4b6bf57f8b95aab76648a9d34 the phpseclib library was moved to composer package installation with v3.

@fballiano
Copy link
Contributor

could you install phpseclib2_compat in your project?

@tim-breitenstein-it
Copy link
Contributor Author

could you install phpseclib2_compat in your project?

Sure!

This does not resolve the system requirement error because of this part of the check:

            if (empty($rsa->modulus) || empty($rsa->exponent)) {
                return false;
            }

The phpseclib2_compat does not have the variables.

But the rest of the checkout process might work.

@fballiano
Copy link
Contributor

with a composer patch I think you should be able to patch the module quickly if that's the only part of code that breaks

@fballiano
Copy link
Contributor

@tim-breitenstein-it did you manage to solve this in some way?

@tim-breitenstein-it
Copy link
Contributor Author

Unfortunately not yet.

But at the end of the month or the beginning of next month I have to deal with it, because a server upgrade is scheduled.

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

2 participants