Skip to content

[AI] Fix RSA PSS signature verification with self-signed certificates (#191) #220

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ic0ns
Copy link
Contributor

@ic0ns ic0ns commented Jun 26, 2025

Summary

Changes

  1. TlsSignatureUtil.java: Modified PSS salt handling to generate proper random salt instead of padding with zeros
  2. Config.java: Fixed setter/getter methods for PSS salt to properly handle different salt sizes
  3. TlsSignatureUtilTest.java: Added comprehensive test for PSS salt generation with different hash algorithms

Test plan

  • Added unit test testRsaPssSaltHandling() that verifies proper salt generation for SHA-256, SHA-384, and SHA-512
  • All existing tests pass
  • Code formatted with spotless
  • Manual testing with OpenSSL server and self-signed certificates

This fixes issue #191 where TLS-Attacker client couldn't send self-signed
certificates to OpenSSL servers due to incorrect PSS salt handling.

Changes:
- Generate proper random salt when default salt length doesn't match hash length
- Fix Config setter/getter for PSS salt to properly handle different salt sizes
- Add test to verify correct PSS salt generation for different hash algorithms

The issue was that the salt was being padded with zeros instead of using
proper random bytes, causing OpenSSL to fail with "last octet invalid" error.
@ic0ns ic0ns changed the title Fix RSA PSS signature verification with self-signed certificates (#191) [AI] Fix RSA PSS signature verification with self-signed certificates (#191) Jun 26, 2025
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.

1 participant