You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Building s2n-tls with OpenSSL 3.0 shows that generating some randomness using RAND_bytes() before calling s2n_init() blocks s2n-tls from overriding the OpenSSL randomness backend using the s2n-tls rand engine. From s2nc, modified to exit from s2n's custom random function:
OpenSSL randomness backend is overwritten by s2n-tls:
$ ./bin/s2nc aws.amazon.com
Aborted (core dumped)
Generating randomness before s2n-tls init, means OpenSSL randomness backend is not overwritten by s2n-tls:
Maybe should not override when using OpenSSL +3 (randomness backend is OK) or create a provider and fetch the correct implementation.
Does this change what S2N sends over the wire? If yes, explain.
Does this change any public APIs? If yes, explain.
Which versions of TLS will this impact?
Requirements / Acceptance Criteria:
What must a solution address in order to solve the problem? How do we know the solution is complete?
RFC links: Links to relevant RFC(s)
Related Issues: Link any relevant issues
Will the Usage Guide or other documentation need to be updated?
Testing: How will this change be tested? Call out new integration tests, functional tests, or particularly interesting/important unit tests.
Will this change trigger SAW changes? Changes to the state machine, the s2n_handshake_io code that controls state transitions, the DRBG, or the corking/uncorking logic could trigger SAW failures.
Should this change be fuzz tested? Will it handle untrusted input? Create a separate issue to track the fuzzing work.
Out of scope:
Is there anything the solution will intentionally NOT address?
The text was updated successfully, but these errors were encountered:
Problem:
Issue first reported by @torben-hansen:
Building s2n-tls with OpenSSL 3.0 shows that generating some randomness using RAND_bytes() before calling s2n_init() blocks s2n-tls from overriding the OpenSSL randomness backend using the s2n-tls rand engine. From s2nc, modified to exit from s2n's custom random function:
OpenSSL randomness backend is overwritten by s2n-tls:
Generating randomness before s2n-tls init, means OpenSSL randomness backend is not overwritten by s2n-tls:
Patch to reproduce
The reason is probably that the default engine callback is globally cached: https://github.com/openssl/openssl/blob/openssl-3.0/crypto/rand/rand_lib.c#L184-L213
And therefore the rand engine backend is never used. In fact, totally ignored: https://github.com/openssl/openssl/blob/openssl-3.0/crypto/rand/rand_lib.c#L361
Solution:
Maybe should not override when using OpenSSL +3 (randomness backend is OK) or create a provider and fetch the correct implementation.
Requirements / Acceptance Criteria:
What must a solution address in order to solve the problem? How do we know the solution is complete?
Out of scope:
Is there anything the solution will intentionally NOT address?
The text was updated successfully, but these errors were encountered: