Skip to content
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

Extend tlsfuzzer coverage #488

Merged
merged 2 commits into from
Dec 19, 2024
Merged

Extend tlsfuzzer coverage #488

merged 2 commits into from
Dec 19, 2024

Conversation

Jakuje
Copy link
Contributor

@Jakuje Jakuje commented Dec 17, 2024

Description

This mostly extends the test coverage for TLS 1.2 and ECDSA and EdDSA keys. I did not touch the RSA-PSS coverage, as it needs to use the special RSA-PSS keys and certificates to work correctly and pkcs11-provider can not use them. This will likely be handled in some follow-up PR.

Checklist

  • Test suite updated with functionality tests
  • Test suite updated with negative tests

Reviewer's checklist:

  • Any issues marked for closing are addressed
  • There is a test suite reasonably covering new functionality or modifications
  • This feature/change has adequate documentation added
  • Code conform to coding style that today cannot yet be enforced via the check style test
  • Commits have short titles and sensible commit messages
  • Coverity Scan has run if needed (code PR) and no new defects were found

@simo5 simo5 added the covscan-ok Coverity scan passed label Dec 17, 2024
simo5
simo5 previously approved these changes Dec 17, 2024
Copy link
Member

@simo5 simo5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Covscan not needed.

Copy link

@tomato42 tomato42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are multiple scripts missing compared to instructions from openssl/openssl#25724

also, I think it would be nice to check that PKCS#11 can be used to delegate verification of signatures too...?

tests/cert.json.ecdsa.in Outdated Show resolved Hide resolved
tests/cert.json.ecdsa.in Outdated Show resolved Hide resolved
tests/cert.json.ecdsa.in Show resolved Hide resolved
tests/cert.json.eddsa.in Outdated Show resolved Hide resolved
tests/cert.json.rsa.in Outdated Show resolved Hide resolved
@Jakuje
Copy link
Contributor Author

Jakuje commented Dec 17, 2024

also, I think it would be nice to check that PKCS#11 can be used to delegate verification of signatures too...?

AFAIK this is implicitly tested by adding the propquery to the openssl cli in the second invocation of the tests:

https://github.com/latchset/pkcs11-provider/blob/6be8f7aedc119d5ceb7b9e4db5c4df8b73ee46af/tests/ttlsfuzzer#L81C1-L81C6

This should force the OpenSSL to import even public keys to the pkcs11 provider and do the operations on them. This already caught us some architectural issues in the past that have been fixed.

@Jakuje
Copy link
Contributor Author

Jakuje commented Dec 17, 2024

there are multiple scripts missing compared to instructions from openssl/openssl#25724

For RSA, I added test-dhe-rsa-key-exchange-signatures.py, but again, the SHA1 signatures are failing per default c-p so I can add that, but will have to skip these:

test-dhe-rsa-key-exchange-signatures.py:stdout: 'TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 sha1 signature'
test-dhe-rsa-key-exchange-signatures.py:stdout: 'TLS_DHE_RSA_WITH_AES_128_CBC_SHA sha1 signature'
test-dhe-rsa-key-exchange-signatures.py:stdout: 'TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 sha1 signature'
test-dhe-rsa-key-exchange-signatures.py:stdout: 'TLS_DHE_RSA_WITH_AES_256_CBC_SHA sha1 signature'

The test test-signature-algorithms.py again talks about SHA-1 signatures. Is there any point in keeping it or ok to skip altogether?

@tomato42
Copy link

The test test-signature-algorithms.py again talks about SHA-1 signatures. Is there any point in keeping it or ok to skip altogether?

if there are other cases that do pass, yes, modifying it with -x ... -X ... to expect failures is completely valid way to use those scripts

tests/cert.json.rsa.in Outdated Show resolved Hide resolved
@tomato42
Copy link

also, I think it would be nice to check that PKCS#11 can be used to delegate verification of signatures too...?

AFAIK this is implicitly tested by adding the propquery to the openssl cli in the second invocation of the tests:

https://github.com/latchset/pkcs11-provider/blob/6be8f7aedc119d5ceb7b9e4db5c4df8b73ee46af/tests/ttlsfuzzer#L81C1-L81C6

This should force the OpenSSL to import even public keys to the pkcs11 provider and do the operations on them. This already caught us some architectural issues in the past that have been fixed.

ok, but isn't the point of those tests to ensure end-to-end support for that, in the TLS context specifically?

tests/cert.json.ecdsa.in Show resolved Hide resolved
tests/cert.json.ecdsa.in Show resolved Hide resolved
Copy link
Member

@simo5 simo5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: Jakub Jelen <[email protected]>
Based on the OpenSSL coverage done in the following issue:

openssl/openssl#25724

Signed-off-by: Jakub Jelen <[email protected]>
@simo5 simo5 added covscan-ok Coverity scan passed and removed covscan-ok Coverity scan passed labels Dec 19, 2024
@simo5 simo5 merged commit d7b1339 into latchset:main Dec 19, 2024
41 of 42 checks passed
Jakuje added a commit to Jakuje/pkcs11-provider that referenced this pull request Dec 20, 2024
Jakuje added a commit to Jakuje/pkcs11-provider that referenced this pull request Dec 20, 2024
Jakuje added a commit to Jakuje/pkcs11-provider that referenced this pull request Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
covscan-ok Coverity scan passed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants