Skip to content

fix: validate empty commonName in certificate generation#6015

Merged
vitormattos merged 1 commit intomainfrom
fix/validate-empty-common-name
Dec 6, 2025
Merged

fix: validate empty commonName in certificate generation#6015
vitormattos merged 1 commit intomainfrom
fix/validate-empty-common-name

Conversation

@vitormattos
Copy link
Copy Markdown
Member

  • Add validation to prevent empty Common Name (CN) in OpenSslHandler and CfsslHandler
  • Throw EmptyCertificateException with clear message when CN is empty
  • Fix JSignPdfHandlerTest to use valid commonName 'Test Root CA'
  • Add unit test to verify empty CN validation works correctly

The owner field in libresign_crl table is mandatory without default value. Previously, generateRootCert('') would fail at database level with unclear error. Now it fails early with proper validation message.

- Add validation to prevent empty Common Name (CN) in OpenSslHandler and CfsslHandler
- Throw EmptyCertificateException with clear message when CN is empty
- Fix JSignPdfHandlerTest to use valid commonName 'Test Root CA'
- Add unit test to verify empty CN validation works correctly

The owner field in libresign_crl table is mandatory without default value.
Previously, generateRootCert('') would fail at database level with unclear
error. Now it fails early with proper validation message.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos vitormattos added this to the Next Major (33) milestone Dec 6, 2025
@vitormattos vitormattos self-assigned this Dec 6, 2025
@github-project-automation github-project-automation Bot moved this to 0. Needs triage in Roadmap Dec 6, 2025
@vitormattos
Copy link
Copy Markdown
Member Author

/backport to stable32

@vitormattos
Copy link
Copy Markdown
Member Author

/backport to stable31

@vitormattos vitormattos merged commit a807423 into main Dec 6, 2025
46 of 54 checks passed
@vitormattos vitormattos deleted the fix/validate-empty-common-name branch December 6, 2025 20:52
@github-project-automation github-project-automation Bot moved this from 0. Needs triage to 4. to release in Roadmap Dec 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant