Skip to content

Use AWS CRT instead of cryptography for Cloudfront url signing #9423

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

Merged
merged 3 commits into from
Apr 29, 2025

Conversation

kdaily
Copy link
Member

@kdaily kdaily commented Apr 4, 2025

Issue #, if available:

Description of changes:

Fixes issue from #9258 to support PKCS8-formatted private key PEM files. The support for this was added directly to awscrt==0.25.6 (awslabs/aws-crt-python#638). This PR bumps CRT to 0.26.1.

Added a test to prevent regression for support of this format. I also manually ran aws cloudfront sign commands and confirmed that the expected signature is generated using both a PKCS1 and PKCS8 pem file.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@kdaily kdaily force-pushed the crt-cryptography-cloudfront-signing branch from 69d3886 to fffc73b Compare April 4, 2025 17:10
@ashovlin
Copy link
Member

ashovlin commented Apr 8, 2025

Does this still need the changes to cloudfront.py that were originally in #9109, since we reverted to all of the cryptography.hazmat?

@kdaily
Copy link
Member Author

kdaily commented Apr 8, 2025

Does this still need the changes to cloudfront.py that were originally in #9109, since we reverted to all of the cryptography.hazmat?

Yeah. Not sure how I missed pushing that commit.

@kdaily
Copy link
Member Author

kdaily commented Apr 8, 2025

Does this still need the changes to cloudfront.py that were originally in #9109, since we reverted to all of the cryptography.hazmat?

Yeah. Not sure how I missed pushing that commit.

Fixed in 53c3b0e

@kdaily kdaily requested a review from ashovlin April 8, 2025 20:44
@kdaily kdaily closed this Apr 8, 2025
@kdaily kdaily reopened this Apr 8, 2025
@kdaily kdaily force-pushed the crt-cryptography-cloudfront-signing branch 4 times, most recently from 533be41 to 50007b9 Compare April 8, 2025 21:59
@kdaily kdaily force-pushed the crt-cryptography-cloudfront-signing branch 4 times, most recently from de795df to 3962527 Compare April 25, 2025 22:37
@kdaily kdaily requested a review from ashovlin April 29, 2025 15:40
kdaily added 3 commits April 29, 2025 08:44
Also add test for a PKCS8-formatted pem private key

Uses the method described in the CloudFront docs to generate a private
key:

https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-trusted-signers.html#private-content-creating-cloudfront-key-pairs
- Regenerate lock files for macOS and Linux
- Regenerate lock files for Windows
- Regenerate lock files for docs
@kdaily kdaily force-pushed the crt-cryptography-cloudfront-signing branch from 3962527 to f469f7c Compare April 29, 2025 15:45
@kdaily kdaily merged commit 4eb825f into aws:v2 Apr 29, 2025
44 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants