diff options
author | Matt Caswell <matt@openssl.org> | 2016-08-30 14:20:18 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-08-30 14:49:10 +0100 |
commit | 767ccc3b77cde82c46ab4af541663f6c80e538d3 (patch) | |
tree | 1ef22091fd32466f6f6f9fd6df84a5f99079513f /test/ssl_test_ctx.c | |
parent | f046afb0663fc4514f7fc5d1724439caa6858932 (diff) | |
download | openssl-767ccc3b77cde82c46ab4af541663f6c80e538d3.tar.gz |
Add some CertStatus tests
The previous commit revealed a long standing problem where CertStatus
processing was broken in DTLS. This would have been revealed by better
testing - so add some!
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'test/ssl_test_ctx.c')
-rw-r--r-- | test/ssl_test_ctx.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/ssl_test_ctx.c b/test/ssl_test_ctx.c index ac90f199b2..ee2e8a1088 100644 --- a/test/ssl_test_ctx.c +++ b/test/ssl_test_ctx.c @@ -390,6 +390,34 @@ const char *ssl_ct_validation_name(ssl_ct_validation_t mode) IMPLEMENT_SSL_TEST_BOOL_OPTION(SSL_TEST_CTX, test, resumption_expected) IMPLEMENT_SSL_TEST_BOOL_OPTION(SSL_TEST_SERVER_CONF, server, broken_session_ticket) +/**************/ +/* CertStatus */ +/**************/ + +static const test_enum ssl_certstatus[] = { + {"None", SSL_TEST_CERT_STATUS_NONE}, + {"GoodResponse", SSL_TEST_CERT_STATUS_GOOD_RESPONSE}, + {"BadResponse", SSL_TEST_CERT_STATUS_BAD_RESPONSE} +}; + +__owur static int parse_certstatus(SSL_TEST_SERVER_CONF *server_conf, + const char *value) +{ + int ret_value; + if (!parse_enum(ssl_certstatus, OSSL_NELEM(ssl_certstatus), &ret_value, + value)) { + return 0; + } + server_conf->cert_status = ret_value; + return 1; +} + +const char *ssl_certstatus_name(ssl_cert_status_t cert_status) +{ + return enum_name(ssl_certstatus, + OSSL_NELEM(ssl_certstatus), cert_status); +} + /***********************/ /* ApplicationData */ /***********************/ @@ -453,6 +481,7 @@ static const ssl_test_server_option ssl_test_server_options[] = { { "NPNProtocols", &parse_server_npn_protocols }, { "ALPNProtocols", &parse_server_alpn_protocols }, { "BrokenSessionTicket", &parse_server_broken_session_ticket }, + { "CertStatus", &parse_certstatus }, }; /* |