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

Deprecation warning on openssl_decrypt using PHP 8.1 #2620

Closed
paulohenriquesg opened this issue Jan 12, 2023 · 3 comments
Closed

Deprecation warning on openssl_decrypt using PHP 8.1 #2620

paulohenriquesg opened this issue Jan 12, 2023 · 3 comments
Assignees
Labels
bug This issue is a bug. needs-review p3 This is a minor priority issue s Effort estimation: small

Comments

@paulohenriquesg
Copy link

Describe the bug

The issue appears because on https://github.com/aws/aws-sdk-php/blob/master/src/Crypto/DecryptionTrait.php#L164 we set the default value to null, and this was deprecated on PHP 8.1

Expected Behavior

No exceptions are thrown

Current Behavior

We get a deprecation error:

ErrorException: Deprecated: openssl_decrypt(): Passing null to parameter #7 ($aad) of type string is deprecated

Reproduction Steps

--

Possible Solution

Replace the following:

                    $cipherOptions['Aad'] = isset($cipherOptions['Aad'])
                        ? $cipherOptions['Aad']
                        : null,

by

                    $cipherOptions['Aad'] = isset($cipherOptions['Aad'])
                        ? $cipherOptions['Aad']
                        : '',

Additional Information/Context

No response

SDK version used

3.256.2

Environment details (Version of PHP (php -v)? OS name and version, etc.)

PHP 8.1

@paulohenriquesg paulohenriquesg added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 12, 2023
@yenfryherrerafeliz
Copy link
Contributor

Hi @paulohenriquesg, thanks for opening this issue. I agree with the reported issue, and also the solution that you have proposed looks reasonable to me. I may post a PR soon for this.

Thanks!

@yenfryherrerafeliz yenfryherrerafeliz added needs-review and removed needs-triage This issue or PR still needs to be triaged. labels Jan 12, 2023
@yenfryherrerafeliz yenfryherrerafeliz self-assigned this Jan 12, 2023
@yenfryherrerafeliz yenfryherrerafeliz added p3 This is a minor priority issue s Effort estimation: small labels Jan 12, 2023
@SamRemis
Copy link
Member

We just made the changes you suggested in both DecryptionTrait and DecryptionTraitV2 :)
This should no longer be giving warnings. Thank you for raising this, and let us know if you still are experiencing warnings after 3.257.3 or if you are experiencing other similar warnings.

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. needs-review p3 This is a minor priority issue s Effort estimation: small
Projects
None yet
Development

No branches or pull requests

3 participants