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_ctx.c | |
parent | f33f9ddefbb34584acb73c51e286f9913af96534 (diff) |
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_ctx.c')
-rw-r--r-- | test/ssl_test_ctx.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/ssl_test_ctx.c b/test/ssl_test_ctx.c index f9e74d11fd..e746dbd942 100644 --- a/test/ssl_test_ctx.c +++ b/test/ssl_test_ctx.c @@ -286,6 +286,29 @@ const char *ssl_session_ticket_name(ssl_session_ticket_t server) server); } +/* CompressionExpected */ + +static const test_enum ssl_compression[] = { + {"Yes", SSL_TEST_COMPRESSION_YES}, + {"No", SSL_TEST_COMPRESSION_NO}, +}; + +__owur static int parse_compression(SSL_TEST_CTX *test_ctx, const char *value) +{ + int ret_value; + if (!parse_enum(ssl_compression, OSSL_NELEM(ssl_compression), + &ret_value, value)) { + return 0; + } + test_ctx->compression_expected = ret_value; + return 1; +} + +const char *ssl_compression_name(ssl_compression_t comp) +{ + return enum_name(ssl_compression, OSSL_NELEM(ssl_compression), comp); +} + /* Method */ static const test_enum ssl_test_methods[] = { @@ -541,6 +564,7 @@ static const ssl_test_ctx_option ssl_test_ctx_options[] = { { "ExpectedProtocol", &parse_protocol }, { "ExpectedServerName", &parse_expected_servername }, { "SessionTicketExpected", &parse_session_ticket }, + { "CompressionExpected", &parse_compression }, { "Method", &parse_test_method }, { "ExpectedNPNProtocol", &parse_test_expected_npn_protocol }, { "ExpectedALPNProtocol", &parse_test_expected_alpn_protocol }, |