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

tests: add sslv2 client hello test #5011

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

Conversation

jmayclin
Copy link
Contributor

@jmayclin jmayclin commented Jan 9, 2025

Resolved issues:

Part of #4585

Description of changes:

s2n-tls doesn't currently have any integration tests that do a full handshake with an SSLv2 formatted client hello. This PR adds a test.

This is done using an in-process test that handshakes over shared memory. This allows the test to run quickly, and also allows a high degree of observability (assertions can be fine grained). This is also useful because we need access to very specific configuration that would be painful to specify through the command line.

Testing:

New test. We confirm that the ClientHello is actually an SSLv2 client hello in the ClientHello callback.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions github-actions bot added the s2n-core team label Jan 9, 2025
#include "tests/s2n_test.h"
#include "utils/s2n_safety.h"

#define SERVER_CHAIN "/home/ubuntu/workspace/s2n-tls/tests/pems/permutations/rsae_pkcs_2048_sha256/server-chain.pem"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Eww. Don't do this.

@@ -0,0 +1,145 @@
#include <openssl/err.h>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

copyright header

################# sslv2 formatted client hello test ###################
############################################################################

add_executable(s2n_sslv2_client_hello_handshake tests/integration_c/test_sslv2_handshake.c)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

gate logic behind OpenSSL root and interning


int main()
{
// Assert that we are pulling in the correct openssl header.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

fix comment style

SSL_load_error_strings();
EXPECT_SUCCESS(s2n_init());

/* s2n-tls client w/ openssl server */
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
/* s2n-tls client w/ openssl server */
/* openssl client w/ s2n-tls server */

@jmayclin jmayclin mentioned this pull request Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant