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

Add negative test for legacy CBC decryption/authentication #3469

Closed
mpg opened this issue Jun 30, 2020 · 0 comments
Closed

Add negative test for legacy CBC decryption/authentication #3469

mpg opened this issue Jun 30, 2020 · 0 comments

Comments

@mpg
Copy link
Contributor

mpg commented Jun 30, 2020

Currently our record decryption routine ssl_decrypt_buf() has some unit tests in the development branch, in tests/suites/test_suite_ssl.{function,data}, using test functions ssl_crypt_record and ssl_crypt_record_small. Unfortunately all of those are positive tests. Before we modify the verification code for legacy CBC as part of Lucky 13 improvements, we need to have negative tests as well.

These tests could be created as an extended and specialized (with etm=0 and working only with CBC ciphers) variant of the existing test functions mentioned above, or in any other suitable way. They need to exercise at least the following modes of failure:

  • the announced padding length is invalid (larger than record size)
  • the padding bytes don't all have the expected value
  • the padding is correct but the HMAC is not

See RFC 5246 Section 6.2.3.2 for a description of legacy CBC. (By legacy, I mean, without the EtM extension.)

The tests do not need to be backported to the LTS branches, as they don't support any unit testing of SSL record protection yet, and supporting that would likely require refactorings that are too large for the LTS branches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant