X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=test%2Fssl_test_ctx.c;h=7189777b78bcb83b5ea7ab49258edfab284d5f1e;hp=f9e74d11fda0f3701cb964f16508334c13f0214b;hb=2e21539b2b57df9926d165243efb60480f546ba7;hpb=80de0c5947cf29ef04227714f3cae5c615012449 diff --git a/test/ssl_test_ctx.c b/test/ssl_test_ctx.c index f9e74d11fd..7189777b78 100644 --- a/test/ssl_test_ctx.c +++ b/test/ssl_test_ctx.c @@ -286,6 +286,10 @@ const char *ssl_session_ticket_name(ssl_session_ticket_t server) server); } +/* CompressionExpected */ + +IMPLEMENT_SSL_TEST_BOOL_OPTION(SSL_TEST_CTX, test, compression_expected) + /* Method */ static const test_enum ssl_test_methods[] = { @@ -318,6 +322,12 @@ IMPLEMENT_SSL_TEST_STRING_OPTION(SSL_TEST_CLIENT_CONF, client, alpn_protocols) IMPLEMENT_SSL_TEST_STRING_OPTION(SSL_TEST_SERVER_CONF, server, alpn_protocols) IMPLEMENT_SSL_TEST_STRING_OPTION(SSL_TEST_CTX, test, expected_alpn_protocol) +/* SRP options */ +IMPLEMENT_SSL_TEST_STRING_OPTION(SSL_TEST_CLIENT_CONF, client, srp_user) +IMPLEMENT_SSL_TEST_STRING_OPTION(SSL_TEST_SERVER_CONF, server, srp_user) +IMPLEMENT_SSL_TEST_STRING_OPTION(SSL_TEST_CLIENT_CONF, client, srp_password) +IMPLEMENT_SSL_TEST_STRING_OPTION(SSL_TEST_SERVER_CONF, server, srp_password) + /* Handshake mode */ static const test_enum ssl_handshake_modes[] = { @@ -525,6 +535,22 @@ __owur static int parse_expected_client_sign_hash(SSL_TEST_CTX *test_ctx, value); } +__owur static int parse_expected_ca_names(STACK_OF(X509_NAME) **pnames, + const char *value) +{ + if (value == NULL) + return 0; + if (!strcmp(value, "empty")) + *pnames = sk_X509_NAME_new_null(); + else + *pnames = SSL_load_client_CA_file(value); + return *pnames != NULL; +} +__owur static int parse_expected_client_ca_names(SSL_TEST_CTX *test_ctx, + const char *value) +{ + return parse_expected_ca_names(&test_ctx->expected_client_ca_names, value); +} /* Known test options and their corresponding parse methods. */ @@ -541,6 +567,7 @@ static const ssl_test_ctx_option ssl_test_ctx_options[] = { { "ExpectedProtocol", &parse_protocol }, { "ExpectedServerName", &parse_expected_servername }, { "SessionTicketExpected", &parse_session_ticket }, + { "CompressionExpected", &parse_test_compression_expected }, { "Method", &parse_test_method }, { "ExpectedNPNProtocol", &parse_test_expected_npn_protocol }, { "ExpectedALPNProtocol", &parse_test_expected_alpn_protocol }, @@ -556,6 +583,7 @@ static const ssl_test_ctx_option ssl_test_ctx_options[] = { { "ExpectedClientCertType", &parse_expected_client_cert_type }, { "ExpectedClientSignHash", &parse_expected_client_sign_hash }, { "ExpectedClientSignType", &parse_expected_client_sign_type }, + { "ExpectedClientCANames", &parse_expected_client_ca_names }, }; /* Nested client options. */ @@ -571,6 +599,8 @@ static const ssl_test_client_option ssl_test_client_options[] = { { "ALPNProtocols", &parse_client_alpn_protocols }, { "CTValidation", &parse_ct_validation }, { "RenegotiateCiphers", &parse_client_reneg_ciphers}, + { "SRPUser", &parse_client_srp_user }, + { "SRPPassword", &parse_client_srp_password }, }; /* Nested server options. */ @@ -585,6 +615,8 @@ static const ssl_test_server_option ssl_test_server_options[] = { { "ALPNProtocols", &parse_server_alpn_protocols }, { "BrokenSessionTicket", &parse_server_broken_session_ticket }, { "CertStatus", &parse_certstatus }, + { "SRPUser", &parse_server_srp_user }, + { "SRPPassword", &parse_server_srp_password }, }; /* @@ -610,6 +642,12 @@ static void ssl_test_extra_conf_free_data(SSL_TEST_EXTRA_CONF *conf) OPENSSL_free(conf->server.alpn_protocols); OPENSSL_free(conf->server2.alpn_protocols); OPENSSL_free(conf->client.reneg_ciphers); + OPENSSL_free(conf->server.srp_user); + OPENSSL_free(conf->server.srp_password); + OPENSSL_free(conf->server2.srp_user); + OPENSSL_free(conf->server2.srp_password); + OPENSSL_free(conf->client.srp_user); + OPENSSL_free(conf->client.srp_password); } static void ssl_test_ctx_free_extra_data(SSL_TEST_CTX *ctx) @@ -623,6 +661,7 @@ void SSL_TEST_CTX_free(SSL_TEST_CTX *ctx) ssl_test_ctx_free_extra_data(ctx); OPENSSL_free(ctx->expected_npn_protocol); OPENSSL_free(ctx->expected_alpn_protocol); + sk_X509_NAME_pop_free(ctx->expected_client_ca_names, X509_NAME_free); OPENSSL_free(ctx); }