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

feat(node): crypto.{Cipheriv,Decipheriv}.setAutoPadding() #22228

Closed
wants to merge 21 commits into from

Conversation

iuioiua
Copy link
Contributor

@iuioiua iuioiua commented Feb 2, 2024

Closes #21804

Copy link
Member

@littledivy littledivy left a comment

Choose a reason for hiding this comment

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

We can also enable parallel/test-crypto-padding-aes256.js test

ext/node/ops/crypto/cipher.rs Outdated Show resolved Hide resolved
ext/node/polyfills/internal/crypto/cipher.ts Outdated Show resolved Hide resolved
ext/node/polyfills/internal/crypto/cipher.ts Outdated Show resolved Hide resolved
@iuioiua iuioiua changed the title feat(node): Cipheriv.setAutoPadding() feat(node): (Cipheriv|Decipheriv).setAutoPadding() Feb 2, 2024
@iuioiua iuioiua changed the title feat(node): (Cipheriv|Decipheriv).setAutoPadding() feat(node): crypto.{Cipheriv,Decipheriv}.setAutoPadding() Feb 7, 2024
@iuioiua iuioiua marked this pull request as ready for review February 7, 2024 02:28
@iuioiua
Copy link
Contributor Author

iuioiua commented Feb 7, 2024

@littledivy, are you able to see where I went wrong? Also, I thought Dipher.getAuthTag() and Decipher.setAuthTag() were implemented, but when I try to use them, I'm told they're not.

Comment on lines 351 to +353
buf,
this.#authTag || NO_TAG,
this.#autoPadding,
Copy link
Member

Choose a reason for hiding this comment

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

The tests are failing because buf is a fixed buffer of size 16 (block size).

When auto padding is disabled, buf should be sliced from (0, len] where len is the length of the unpadded block returned by decrypt_block_b2b_mut

@iuioiua iuioiua marked this pull request as draft February 15, 2024 03:58
This reverts commit b52deba.
@littledivy littledivy added this to the 1.41 milestone Feb 20, 2024
@littledivy
Copy link
Member

@iuioiua FYI I don't think I'll have time to get this in for 1.41. It's a little more work than I thought - will keep you updated

@littledivy littledivy removed this from the 1.41 milestone Feb 21, 2024
@bartlomieju bartlomieju modified the milestone: 1.42 Mar 6, 2024
@iuioiua
Copy link
Contributor Author

iuioiua commented Aug 8, 2024

Closing in favor #24940.

@iuioiua iuioiua closed this Aug 8, 2024
@iuioiua iuioiua deleted the node-crypto-setAutoPadding branch August 8, 2024 13:03
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.

Implement Cipheriv.setAutoPadding
3 participants