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

PKCS7: added encryption with AES-256-CBC #12172

Merged
merged 6 commits into from
Dec 29, 2024
Merged

Conversation

nitneuqr
Copy link
Contributor

@nitneuqr nitneuqr commented Dec 20, 2024

A few things to check:

  • Should we name the parameters content_algorithm instead of just algorihm
  • I also have a version with mode included (as we might need it on next S/MIME versions), should I include it now?
  • Maybe go even simpler with an enum (AES128 & AES256) ?

@nitneuqr nitneuqr force-pushed the aes-256-cbc-encrypt branch from 6cde053 to cc79ad2 Compare December 20, 2024 10:52
@nitneuqr
Copy link
Contributor Author

Made some changes to adapt, let me know what you think @alex !

Comment on lines 270 to 272
self._content_encryption_algorithm = (
self._content_encryption_algorithm or algorithms.AES128
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't mutate self here, just use a local. You'll get wrong behavior on a reused builder.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I'll need to modify the rust code accordingly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@alex
Copy link
Member

alex commented Dec 29, 2024

Looks like there's a merge conflict in the changelog. can you rebase/merge main before I review?

added & updated tests accordingly

updated documentation

removed useless test vector
changed name to content_encryption_algorithm

simplified the rust code accordingly

tried to simplify the documentation
adapted rust code accordingly
@nitneuqr nitneuqr force-pushed the aes-256-cbc-encrypt branch from 84fdaca to b29e77d Compare December 29, 2024 17:50
@nitneuqr
Copy link
Contributor Author

Looks like there's a merge conflict in the changelog. can you rebase/merge main before I review?

Yup, done!

@alex alex merged commit 6143683 into pyca:main Dec 29, 2024
63 checks passed
@nitneuqr nitneuqr deleted the aes-256-cbc-encrypt branch January 4, 2025 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants