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

CloudFront silently fail to generate signature when SHA-1 not available #2608

Closed
DocLM opened this issue Dec 22, 2022 · 4 comments
Closed

CloudFront silently fail to generate signature when SHA-1 not available #2608

DocLM opened this issue Dec 22, 2022 · 4 comments
Assignees
Labels
bug This issue is a bug. needs-review p2 This is a standard priority issue

Comments

@DocLM
Copy link
Contributor

DocLM commented Dec 22, 2022

Describe the bug

On recent RHEL/RockyLinux/Alma 9 the default system security policies disable SHA-1.

This cause CloudFrontClient to silently fail signature generation in getSignedUrl when using openssl_sign function and generate an URL with empty signature.

Expected Behavior

An exception or a log that mention the issue.

Current Behavior

Generate the URL but with empty signature

Reproduction Steps

Run getSignedUrl on RHEL/Alma/RockyLinux with default crypto policies or another system without SHA-1 available in OpenSSL.

Possible Solution

Throw an exception when feature not available
See #2590

Additional Information/Context

No response

SDK version used

3.252.1

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

PHP 8.1.8 (cli) (built: Jul 5 2022 21:55:55) (NTS gcc x86_64) - Rocky Linux release 9.1 (Blue Onyx)

@DocLM DocLM added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 22, 2022
@yenfryherrerafeliz yenfryherrerafeliz self-assigned this Jan 6, 2023
@yenfryherrerafeliz
Copy link
Contributor

Hi @DocLM, thanks for opening this issue. I feel that openssl should throw an error when a cipher is not available.
I reviewed your PR and it looks good for me, however, it also needs to be reviewed by the team.

I will get back to you as soon as possible.

Thanks!

@yenfryherrerafeliz yenfryherrerafeliz added investigating This issue is being investigated and/or work is in progress to resolve the issue. needs-review p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Jan 9, 2023
@danielchristianschroeter

I had the same issues from RHEL 8 to RHEL 9 upgrade with signed cookies for Cloudfront. No value for CloudFront-Signature will be returned. After re-enable SHA-1 with "update-crypto-policies --set DEFAULT:SHA1" now CloudFront-Signature value is returned.

When will you fix it?

@yenfryherrerafeliz
Copy link
Contributor

Hi, I am closing this issue since it was fixed by the following PR.

Thank you!

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 p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

3 participants