Skip to content

Comments

Improve Cipher input validation, output buffer sizing, and update behavior#148

Merged
rlm2002 merged 1 commit intowolfSSL:masterfrom
cconlon:cipherInputOutputFixes
Aug 29, 2025
Merged

Improve Cipher input validation, output buffer sizing, and update behavior#148
rlm2002 merged 1 commit intowolfSSL:masterfrom
cconlon:cipherInputOutputFixes

Conversation

@cconlon
Copy link
Member

@cconlon cconlon commented Aug 28, 2025

This PR enhances input validation for Cipher update() and doFinal() methods in regards to bounds checking and null checks. It also improves output buffer size validation with more accurate ShortBufferException handling for PKCS5Padding decrypt operations.

JUnit tests are included here to prevent against regression.

This fixes the OpenJDK SunJCE test: crypto/provider/Cipher/AES/Test4517355.java and crypto/provider/Cipher/AES/TestShortBuffer.java

@cconlon cconlon assigned cconlon and rlm2002 and unassigned cconlon Aug 28, 2025
@rlm2002 rlm2002 merged commit 6d11f72 into wolfSSL:master Aug 29, 2025
118 of 122 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