diff options
author | Matt Caswell <matt@openssl.org> | 2017-03-01 12:11:51 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2017-03-02 16:49:28 +0000 |
commit | 439db0c97bd50cae008e876c6c8ed5e5011bf6eb (patch) | |
tree | 13a9464ccb5b9b0eb978c9b8dfec46794b939c58 /test/ssl_test.c | |
parent | f33f9ddefbb34584acb73c51e286f9913af96534 (diff) | |
download | openssl-439db0c97bd50cae008e876c6c8ed5e5011bf6eb.tar.gz |
Add compression tests
Check whether we negotiate compression in various scenarios.
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2814)
Diffstat (limited to 'test/ssl_test.c')
-rw-r--r-- | test/ssl_test.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ssl_test.c b/test/ssl_test.c index 752de6396b..f5dfa97090 100644 --- a/test/ssl_test.c +++ b/test/ssl_test.c @@ -146,6 +146,16 @@ static int check_session_ticket(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx return 1; } +static int check_compression(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) +{ + if (result->compression != test_ctx->compression_expected) { + fprintf(stderr, "Client CompressionExpected mismatch, expected %s, got %s\n.", + ssl_compression_name(test_ctx->compression_expected), + ssl_compression_name(result->compression)); + return 0; + } + return 1; +} #ifndef OPENSSL_NO_NEXTPROTONEG static int check_npn(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) { @@ -259,6 +269,7 @@ static int check_test(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) ret &= check_protocol(result, test_ctx); ret &= check_servername(result, test_ctx); ret &= check_session_ticket(result, test_ctx); + ret &= check_compression(result, test_ctx); ret &= (result->session_ticket_do_not_call == 0); #ifndef OPENSSL_NO_NEXTPROTONEG ret &= check_npn(result, test_ctx); |