Skip to content

Add SHA256 fallback if MD5 isn't available on the system #9534

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

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

nateprewitt
Copy link
Member

Description of changes:
This PR will move our usage of md5 to enable the usedforsecurity flag set to false since these checksumming functions are only intended to create a deterministic path. If MD5 is still not available on the system, we'll attempt to use a FIPS compliant algorithm (SHA256 in this case) to derive an alternative path.

Path names should stay deterministic on similarly configured systems but customers uploading from both FIPS compliant and non-compliant environments to the same bucket may see some redundant uploads for the same template. Risk of this should be low given compliance requirements.

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

@nateprewitt nateprewitt requested a review from kdaily June 6, 2025 22:08
@kdaily
Copy link
Member

kdaily commented Jun 6, 2025

Implementation looks good to me.

We should update the command description here to account for this change:

https://github.com/aws/aws-cli/blob/60ae3cbd865d8cdaa5c9a425b3b743027e621a3a/awscli/examples/cloudformation/_package_description.rst

Before the command uploads artifacts, it checks if the artifacts are already present in the S3 bucket to prevent unnecessary uploads. The command uses MD5 checksums to compare files. If the values match, the command doesn't upload the artifacts. Use the --force-upload flag to skip this check and always upload the artifacts.

Suggestion:

Before the command uploads artifacts, it checks if the artifacts are already present in the S3 bucket to prevent unnecessary uploads. The command uses a hashing function to compare files. If the values match, the command doesn't upload the artifacts. Use the --force-upload flag to skip this check and always upload the artifacts. By default, an MD5 checksum is used as a hash. If MD5 is not available in the environment, a SHA256 checksum is used.

@nateprewitt nateprewitt added the v1 label Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants