Skip to content

deoxys, ocb3: clear plaintext on authentication failure - #889

Open
ECD5A wants to merge 2 commits into
RustCrypto:masterfrom
ECD5A:fix/888-zeroize-failed-decrypt
Open

ECD5A wants to merge 2 commits into
RustCrypto:masterfrom
ECD5A:fix/888-zeroize-failed-decrypt

Conversation

@ECD5A

@ECD5A ECD5A commented Oct 18, 2026

Copy link
Copy Markdown

Deoxys-I, Deoxys-II and OCB3 leave unauthenticated plaintext in the output buffer when tag verification fails. Clear the output before returning the authentication error.

The regression tests cover in-place and separate buffers, block boundaries, and modified tags, AAD, nonces and ciphertext.

Validation:

  • Reproduced the issue before the fix and confirmed cleanup after it.
  • Verified that authenticated ciphertext, tags and plaintext remain unchanged.
  • Package tests passed on Windows and Linux, including release/all-features runs.
  • Tests also passed on Rust 1.85.1.
  • cargo fmt --all -- --check and Clippy with -D warnings passed.

Fixes #888

This branch has not been deployed

No deployments
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.

deoxys+ocb3: plaintext exposed on tag decryption failure

1 participant