maskit opened a new pull request, #14130:
URL: https://github.com/apache/trafficserver/pull/14130
Loading a certificate read its private key and set it on the TLS context in
one function, `SSLPrivateKeyHandler`. This splits it in two:
- `TLSReadPrivateKey` reads the key with the context's password callback and
sets nothing on the context. It is declared in `P_SSLUtils.h` so that a key can
also be given to something other than the context, such as a BoringSSL
`SSL_CREDENTIAL`, and so that it can be unit tested.
- `TLSUsePrivateKey` (file-static) sets the key on the context and checks
that it matches the certificate.
`load_certs` calls both, so certificate loading behaves as before, including
its error and debug messages.
## Testing
- New `unit_tests/test_TLSReadPrivateKey.cc`: reads a plain key, a key that
follows the certificate in one PEM, and an encrypted key through the context's
password callback; does not read with the wrong passphrase, from unparseable
input, or from a certificate without a key. Each case also checks that nothing
was set on the context. It uses a fixed key and certificate, so it builds with
every TLS library; the existing key loading tests in `test_SSLDHParams.cc`
(renamed from `SSLPrivateKeyHandler:` to `load_certs:`) build only with OpenSSL
3 and later.
- `test_net` passes with BoringSSL, OpenSSL 3 and OpenSSL 4.
- The Uranium tests selected with `-k "tls or cert_update"` pass with
BoringSSL and OpenSSL 4, apart from two failures unrelated to this change:
- `test_tls_signature_algorithms` on BoringSSL expects no negotiated
signature algorithm in the log, but BoringSSL builds that have
`SSL_get_signature_algorithm_used` report one.
- `test_tls_resume_cert_partition[1.3-proxy6-cross-False]` on OpenSSL 4
fails the same way on master.
- The new tests fail if reading also sets the key on the context, or if it
ignores the password callback.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]