Skip to content

SONARJAVA-6853 S3329: fix FP when cipher.init uses a non-final variable initialized to DECRYPT_MODE - #6035

Merged
asya-vorobeva merged 1 commit into
masterfrom
asya/fix-s3329-fps
Aug 25, 2026
Merged

SONARJAVA-6853 S3329: fix FP when cipher.init uses a non-final variable initialized to DECRYPT_MODE#6035
asya-vorobeva merged 1 commit into
masterfrom
asya/fix-s3329-fps

Conversation

@asya-vorobeva

Copy link
Copy Markdown
Contributor

The DECRYPT_MODE suppression in SecureInitializationFinder relied on asConstant() to resolve the operation mode, which only works for compile-time constants. A non-final variable initialized to Cipher.DECRYPT_MODE was not resolved, causing the suppression to silently fail and a FP to be raised.

Added resolveIntConstant() which falls back to inspecting the variable's declaration initializer when asConstant() returns empty.

…le initialized to DECRYPT_MODE

The DECRYPT_MODE suppression in SecureInitializationFinder relied on
asConstant() to resolve the operation mode, which only works for
compile-time constants. A non-final variable initialized to
Cipher.DECRYPT_MODE was not resolved, causing the suppression to
silently fail and a FP to be raised.

Added resolveIntConstant() which falls back to inspecting the variable's
declaration initializer when asConstant() returns empty.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

SONARJAVA-6853

@sonarqube-next

Copy link
Copy Markdown
Contributor

@asya-vorobeva
asya-vorobeva merged commit 2d160bb into master Aug 25, 2026
20 checks passed
@asya-vorobeva
asya-vorobeva deleted the asya/fix-s3329-fps branch August 25, 2026 15:16
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