2 * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the OpenSSL license (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
12 #include <openssl/e_os2.h>
13 #include <openssl/crypto.h>
16 #include "ssl_test_ctx.h"
19 static const int default_app_data_size = 256;
20 /* Default set to be as small as possible to exercise fragmentation. */
21 static const int default_max_fragment_size = 512;
23 static int parse_boolean(const char *value, int *result)
25 if (strcasecmp(value, "Yes") == 0) {
29 else if (strcasecmp(value, "No") == 0) {
36 #define IMPLEMENT_SSL_TEST_BOOL_OPTION(struct_type, name, field) \
37 static int parse_##name##_##field(struct_type *ctx, const char *value) \
39 return parse_boolean(value, &ctx->field); \
42 #define IMPLEMENT_SSL_TEST_STRING_OPTION(struct_type, name, field) \
43 static int parse_##name##_##field(struct_type *ctx, const char *value) \
45 OPENSSL_free(ctx->field); \
46 ctx->field = OPENSSL_strdup(value); \
47 TEST_check(ctx->field != NULL); \
51 #define IMPLEMENT_SSL_TEST_INT_OPTION(struct_type, name, field) \
52 static int parse_##name##_##field(struct_type *ctx, const char *value) \
54 ctx->field = atoi(value); \
58 /* True enums and other test configuration values that map to an int. */
65 __owur static int parse_enum(const test_enum *enums, size_t num_enums,
66 int *value, const char *name)
69 for (i = 0; i < num_enums; i++) {
70 if (strcmp(enums[i].name, name) == 0) {
71 *value = enums[i].value;
78 static const char *enum_name(const test_enum *enums, size_t num_enums,
82 for (i = 0; i < num_enums; i++) {
83 if (enums[i].value == value) {
87 return "InvalidValue";
93 static const test_enum ssl_test_results[] = {
94 {"Success", SSL_TEST_SUCCESS},
95 {"ServerFail", SSL_TEST_SERVER_FAIL},
96 {"ClientFail", SSL_TEST_CLIENT_FAIL},
97 {"InternalError", SSL_TEST_INTERNAL_ERROR},
100 __owur static int parse_expected_result(SSL_TEST_CTX *test_ctx, const char *value)
103 if (!parse_enum(ssl_test_results, OSSL_NELEM(ssl_test_results),
104 &ret_value, value)) {
107 test_ctx->expected_result = ret_value;
111 const char *ssl_test_result_name(ssl_test_result_t result)
113 return enum_name(ssl_test_results, OSSL_NELEM(ssl_test_results), result);
116 /* ExpectedClientAlert / ExpectedServerAlert */
118 static const test_enum ssl_alerts[] = {
119 {"UnknownCA", SSL_AD_UNKNOWN_CA},
120 {"HandshakeFailure", SSL_AD_HANDSHAKE_FAILURE},
121 {"UnrecognizedName", SSL_AD_UNRECOGNIZED_NAME},
122 {"BadCertificate", SSL_AD_BAD_CERTIFICATE},
123 {"NoApplicationProtocol", SSL_AD_NO_APPLICATION_PROTOCOL},
126 __owur static int parse_alert(int *alert, const char *value)
128 return parse_enum(ssl_alerts, OSSL_NELEM(ssl_alerts), alert, value);
131 __owur static int parse_client_alert(SSL_TEST_CTX *test_ctx, const char *value)
133 return parse_alert(&test_ctx->expected_client_alert, value);
136 __owur static int parse_server_alert(SSL_TEST_CTX *test_ctx, const char *value)
138 return parse_alert(&test_ctx->expected_server_alert, value);
141 const char *ssl_alert_name(int alert)
143 return enum_name(ssl_alerts, OSSL_NELEM(ssl_alerts), alert);
146 /* ExpectedProtocol */
148 static const test_enum ssl_protocols[] = {
149 {"TLSv1.3", TLS1_3_VERSION},
150 {"TLSv1.2", TLS1_2_VERSION},
151 {"TLSv1.1", TLS1_1_VERSION},
152 {"TLSv1", TLS1_VERSION},
153 {"SSLv3", SSL3_VERSION},
154 {"DTLSv1", DTLS1_VERSION},
155 {"DTLSv1.2", DTLS1_2_VERSION},
158 __owur static int parse_protocol(SSL_TEST_CTX *test_ctx, const char *value)
160 return parse_enum(ssl_protocols, OSSL_NELEM(ssl_protocols),
161 &test_ctx->expected_protocol, value);
164 const char *ssl_protocol_name(int protocol)
166 return enum_name(ssl_protocols, OSSL_NELEM(ssl_protocols), protocol);
171 static const test_enum ssl_verify_callbacks[] = {
172 {"None", SSL_TEST_VERIFY_NONE},
173 {"AcceptAll", SSL_TEST_VERIFY_ACCEPT_ALL},
174 {"RejectAll", SSL_TEST_VERIFY_REJECT_ALL},
177 __owur static int parse_client_verify_callback(SSL_TEST_CLIENT_CONF *client_conf,
181 if (!parse_enum(ssl_verify_callbacks, OSSL_NELEM(ssl_verify_callbacks),
182 &ret_value, value)) {
185 client_conf->verify_callback = ret_value;
189 const char *ssl_verify_callback_name(ssl_verify_callback_t callback)
191 return enum_name(ssl_verify_callbacks, OSSL_NELEM(ssl_verify_callbacks),
197 static const test_enum ssl_servername[] = {
198 {"None", SSL_TEST_SERVERNAME_NONE},
199 {"server1", SSL_TEST_SERVERNAME_SERVER1},
200 {"server2", SSL_TEST_SERVERNAME_SERVER2},
201 {"invalid", SSL_TEST_SERVERNAME_INVALID},
204 __owur static int parse_servername(SSL_TEST_CLIENT_CONF *client_conf,
208 if (!parse_enum(ssl_servername, OSSL_NELEM(ssl_servername),
209 &ret_value, value)) {
212 client_conf->servername = ret_value;
216 __owur static int parse_expected_servername(SSL_TEST_CTX *test_ctx,
220 if (!parse_enum(ssl_servername, OSSL_NELEM(ssl_servername),
221 &ret_value, value)) {
224 test_ctx->expected_servername = ret_value;
228 const char *ssl_servername_name(ssl_servername_t server)
230 return enum_name(ssl_servername, OSSL_NELEM(ssl_servername),
234 /* ServerNameCallback */
236 static const test_enum ssl_servername_callbacks[] = {
237 {"None", SSL_TEST_SERVERNAME_CB_NONE},
238 {"IgnoreMismatch", SSL_TEST_SERVERNAME_IGNORE_MISMATCH},
239 {"RejectMismatch", SSL_TEST_SERVERNAME_REJECT_MISMATCH},
240 {"EarlyIgnoreMismatch", SSL_TEST_SERVERNAME_EARLY_IGNORE_MISMATCH},
241 {"EarlyRejectMismatch", SSL_TEST_SERVERNAME_EARLY_REJECT_MISMATCH},
242 {"EarlyNoV12", SSL_TEST_SERVERNAME_EARLY_NO_V12},
245 __owur static int parse_servername_callback(SSL_TEST_SERVER_CONF *server_conf,
249 if (!parse_enum(ssl_servername_callbacks,
250 OSSL_NELEM(ssl_servername_callbacks), &ret_value, value)) {
253 server_conf->servername_callback = ret_value;
257 const char *ssl_servername_callback_name(ssl_servername_callback_t callback)
259 return enum_name(ssl_servername_callbacks,
260 OSSL_NELEM(ssl_servername_callbacks), callback);
263 /* SessionTicketExpected */
265 static const test_enum ssl_session_ticket[] = {
266 {"Ignore", SSL_TEST_SESSION_TICKET_IGNORE},
267 {"Yes", SSL_TEST_SESSION_TICKET_YES},
268 {"No", SSL_TEST_SESSION_TICKET_NO},
271 __owur static int parse_session_ticket(SSL_TEST_CTX *test_ctx, const char *value)
274 if (!parse_enum(ssl_session_ticket, OSSL_NELEM(ssl_session_ticket),
275 &ret_value, value)) {
278 test_ctx->session_ticket_expected = ret_value;
282 const char *ssl_session_ticket_name(ssl_session_ticket_t server)
284 return enum_name(ssl_session_ticket,
285 OSSL_NELEM(ssl_session_ticket),
289 /* CompressionExpected */
291 IMPLEMENT_SSL_TEST_BOOL_OPTION(SSL_TEST_CTX, test, compression_expected)
295 static const test_enum ssl_test_methods[] = {
296 {"TLS", SSL_TEST_METHOD_TLS},
297 {"DTLS", SSL_TEST_METHOD_DTLS},
300 __owur static int parse_test_method(SSL_TEST_CTX *test_ctx, const char *value)
303 if (!parse_enum(ssl_test_methods, OSSL_NELEM(ssl_test_methods),
304 &ret_value, value)) {
307 test_ctx->method = ret_value;
311 const char *ssl_test_method_name(ssl_test_method_t method)
313 return enum_name(ssl_test_methods, OSSL_NELEM(ssl_test_methods), method);
316 /* NPN and ALPN options */
318 IMPLEMENT_SSL_TEST_STRING_OPTION(SSL_TEST_CLIENT_CONF, client, npn_protocols)
319 IMPLEMENT_SSL_TEST_STRING_OPTION(SSL_TEST_SERVER_CONF, server, npn_protocols)
320 IMPLEMENT_SSL_TEST_STRING_OPTION(SSL_TEST_CTX, test, expected_npn_protocol)
321 IMPLEMENT_SSL_TEST_STRING_OPTION(SSL_TEST_CLIENT_CONF, client, alpn_protocols)
322 IMPLEMENT_SSL_TEST_STRING_OPTION(SSL_TEST_SERVER_CONF, server, alpn_protocols)
323 IMPLEMENT_SSL_TEST_STRING_OPTION(SSL_TEST_CTX, test, expected_alpn_protocol)
326 IMPLEMENT_SSL_TEST_STRING_OPTION(SSL_TEST_CLIENT_CONF, client, srp_user)
327 IMPLEMENT_SSL_TEST_STRING_OPTION(SSL_TEST_SERVER_CONF, server, srp_user)
328 IMPLEMENT_SSL_TEST_STRING_OPTION(SSL_TEST_CLIENT_CONF, client, srp_password)
329 IMPLEMENT_SSL_TEST_STRING_OPTION(SSL_TEST_SERVER_CONF, server, srp_password)
333 static const test_enum ssl_handshake_modes[] = {
334 {"Simple", SSL_TEST_HANDSHAKE_SIMPLE},
335 {"Resume", SSL_TEST_HANDSHAKE_RESUME},
336 {"RenegotiateServer", SSL_TEST_HANDSHAKE_RENEG_SERVER},
337 {"RenegotiateClient", SSL_TEST_HANDSHAKE_RENEG_CLIENT},
338 {"KeyUpdateServer", SSL_TEST_HANDSHAKE_KEY_UPDATE_SERVER},
339 {"KeyUpdateClient", SSL_TEST_HANDSHAKE_KEY_UPDATE_CLIENT},
342 __owur static int parse_handshake_mode(SSL_TEST_CTX *test_ctx, const char *value)
345 if (!parse_enum(ssl_handshake_modes, OSSL_NELEM(ssl_handshake_modes),
346 &ret_value, value)) {
349 test_ctx->handshake_mode = ret_value;
353 const char *ssl_handshake_mode_name(ssl_handshake_mode_t mode)
355 return enum_name(ssl_handshake_modes, OSSL_NELEM(ssl_handshake_modes),
359 /* Renegotiation Ciphersuites */
361 IMPLEMENT_SSL_TEST_STRING_OPTION(SSL_TEST_CLIENT_CONF, client, reneg_ciphers)
365 static const test_enum ssl_key_update_types[] = {
366 {"KeyUpdateRequested", SSL_KEY_UPDATE_REQUESTED},
367 {"KeyUpdateNotRequested", SSL_KEY_UPDATE_NOT_REQUESTED},
370 __owur static int parse_key_update_type(SSL_TEST_CTX *test_ctx, const char *value)
373 if (!parse_enum(ssl_key_update_types, OSSL_NELEM(ssl_key_update_types),
374 &ret_value, value)) {
377 test_ctx->key_update_type = ret_value;
383 static const test_enum ssl_ct_validation_modes[] = {
384 {"None", SSL_TEST_CT_VALIDATION_NONE},
385 {"Permissive", SSL_TEST_CT_VALIDATION_PERMISSIVE},
386 {"Strict", SSL_TEST_CT_VALIDATION_STRICT},
389 __owur static int parse_ct_validation(SSL_TEST_CLIENT_CONF *client_conf,
393 if (!parse_enum(ssl_ct_validation_modes, OSSL_NELEM(ssl_ct_validation_modes),
394 &ret_value, value)) {
397 client_conf->ct_validation = ret_value;
401 const char *ssl_ct_validation_name(ssl_ct_validation_t mode)
403 return enum_name(ssl_ct_validation_modes, OSSL_NELEM(ssl_ct_validation_modes),
407 IMPLEMENT_SSL_TEST_BOOL_OPTION(SSL_TEST_CTX, test, resumption_expected)
408 IMPLEMENT_SSL_TEST_BOOL_OPTION(SSL_TEST_SERVER_CONF, server, broken_session_ticket)
409 IMPLEMENT_SSL_TEST_BOOL_OPTION(SSL_TEST_CTX, test, use_sctp)
413 static const test_enum ssl_certstatus[] = {
414 {"None", SSL_TEST_CERT_STATUS_NONE},
415 {"GoodResponse", SSL_TEST_CERT_STATUS_GOOD_RESPONSE},
416 {"BadResponse", SSL_TEST_CERT_STATUS_BAD_RESPONSE}
419 __owur static int parse_certstatus(SSL_TEST_SERVER_CONF *server_conf,
423 if (!parse_enum(ssl_certstatus, OSSL_NELEM(ssl_certstatus), &ret_value,
427 server_conf->cert_status = ret_value;
431 const char *ssl_certstatus_name(ssl_cert_status_t cert_status)
433 return enum_name(ssl_certstatus,
434 OSSL_NELEM(ssl_certstatus), cert_status);
437 /* ApplicationData */
439 IMPLEMENT_SSL_TEST_INT_OPTION(SSL_TEST_CTX, test, app_data_size)
442 /* MaxFragmentSize */
444 IMPLEMENT_SSL_TEST_INT_OPTION(SSL_TEST_CTX, test, max_fragment_size)
447 /* Expected key and signature types */
449 __owur static int parse_expected_key_type(int *ptype, const char *value)
452 const EVP_PKEY_ASN1_METHOD *ameth;
456 ameth = EVP_PKEY_asn1_find_str(NULL, value, -1);
458 EVP_PKEY_asn1_get0_info(&nid, NULL, NULL, NULL, NULL, ameth);
460 nid = OBJ_sn2nid(value);
461 if (nid == NID_undef)
462 nid = OBJ_ln2nid(value);
463 #ifndef OPENSSL_NO_EC
464 if (nid == NID_undef)
465 nid = EC_curve_nist2nid(value);
467 if (nid == NID_undef)
473 __owur static int parse_expected_tmp_key_type(SSL_TEST_CTX *test_ctx,
476 return parse_expected_key_type(&test_ctx->expected_tmp_key_type, value);
479 __owur static int parse_expected_server_cert_type(SSL_TEST_CTX *test_ctx,
482 return parse_expected_key_type(&test_ctx->expected_server_cert_type,
486 __owur static int parse_expected_server_sign_type(SSL_TEST_CTX *test_ctx,
489 return parse_expected_key_type(&test_ctx->expected_server_sign_type,
493 __owur static int parse_expected_client_cert_type(SSL_TEST_CTX *test_ctx,
496 return parse_expected_key_type(&test_ctx->expected_client_cert_type,
500 __owur static int parse_expected_client_sign_type(SSL_TEST_CTX *test_ctx,
503 return parse_expected_key_type(&test_ctx->expected_client_sign_type,
508 /* Expected signing hash */
510 __owur static int parse_expected_sign_hash(int *ptype, const char *value)
516 nid = OBJ_sn2nid(value);
517 if (nid == NID_undef)
518 nid = OBJ_ln2nid(value);
519 if (nid == NID_undef)
525 __owur static int parse_expected_server_sign_hash(SSL_TEST_CTX *test_ctx,
528 return parse_expected_sign_hash(&test_ctx->expected_server_sign_hash,
532 __owur static int parse_expected_client_sign_hash(SSL_TEST_CTX *test_ctx,
535 return parse_expected_sign_hash(&test_ctx->expected_client_sign_hash,
539 __owur static int parse_expected_ca_names(STACK_OF(X509_NAME) **pnames,
544 if (!strcmp(value, "empty"))
545 *pnames = sk_X509_NAME_new_null();
547 *pnames = SSL_load_client_CA_file(value);
548 return *pnames != NULL;
550 __owur static int parse_expected_server_ca_names(SSL_TEST_CTX *test_ctx,
553 return parse_expected_ca_names(&test_ctx->expected_server_ca_names, value);
555 __owur static int parse_expected_client_ca_names(SSL_TEST_CTX *test_ctx,
558 return parse_expected_ca_names(&test_ctx->expected_client_ca_names, value);
561 /* Known test options and their corresponding parse methods. */
563 /* Top-level options. */
566 int (*parse)(SSL_TEST_CTX *test_ctx, const char *value);
567 } ssl_test_ctx_option;
569 static const ssl_test_ctx_option ssl_test_ctx_options[] = {
570 { "ExpectedResult", &parse_expected_result },
571 { "ExpectedClientAlert", &parse_client_alert },
572 { "ExpectedServerAlert", &parse_server_alert },
573 { "ExpectedProtocol", &parse_protocol },
574 { "ExpectedServerName", &parse_expected_servername },
575 { "SessionTicketExpected", &parse_session_ticket },
576 { "CompressionExpected", &parse_test_compression_expected },
577 { "Method", &parse_test_method },
578 { "ExpectedNPNProtocol", &parse_test_expected_npn_protocol },
579 { "ExpectedALPNProtocol", &parse_test_expected_alpn_protocol },
580 { "HandshakeMode", &parse_handshake_mode },
581 { "KeyUpdateType", &parse_key_update_type },
582 { "ResumptionExpected", &parse_test_resumption_expected },
583 { "ApplicationData", &parse_test_app_data_size },
584 { "MaxFragmentSize", &parse_test_max_fragment_size },
585 { "ExpectedTmpKeyType", &parse_expected_tmp_key_type },
586 { "ExpectedServerCertType", &parse_expected_server_cert_type },
587 { "ExpectedServerSignHash", &parse_expected_server_sign_hash },
588 { "ExpectedServerSignType", &parse_expected_server_sign_type },
589 { "ExpectedServerCANames", &parse_expected_server_ca_names },
590 { "ExpectedClientCertType", &parse_expected_client_cert_type },
591 { "ExpectedClientSignHash", &parse_expected_client_sign_hash },
592 { "ExpectedClientSignType", &parse_expected_client_sign_type },
593 { "ExpectedClientCANames", &parse_expected_client_ca_names },
594 { "UseSCTP", &parse_test_use_sctp },
597 /* Nested client options. */
600 int (*parse)(SSL_TEST_CLIENT_CONF *conf, const char *value);
601 } ssl_test_client_option;
603 static const ssl_test_client_option ssl_test_client_options[] = {
604 { "VerifyCallback", &parse_client_verify_callback },
605 { "ServerName", &parse_servername },
606 { "NPNProtocols", &parse_client_npn_protocols },
607 { "ALPNProtocols", &parse_client_alpn_protocols },
608 { "CTValidation", &parse_ct_validation },
609 { "RenegotiateCiphers", &parse_client_reneg_ciphers},
610 { "SRPUser", &parse_client_srp_user },
611 { "SRPPassword", &parse_client_srp_password },
614 /* Nested server options. */
617 int (*parse)(SSL_TEST_SERVER_CONF *conf, const char *value);
618 } ssl_test_server_option;
620 static const ssl_test_server_option ssl_test_server_options[] = {
621 { "ServerNameCallback", &parse_servername_callback },
622 { "NPNProtocols", &parse_server_npn_protocols },
623 { "ALPNProtocols", &parse_server_alpn_protocols },
624 { "BrokenSessionTicket", &parse_server_broken_session_ticket },
625 { "CertStatus", &parse_certstatus },
626 { "SRPUser", &parse_server_srp_user },
627 { "SRPPassword", &parse_server_srp_password },
631 * Since these methods are used to create tests, we use TEST_check liberally
632 * for malloc failures and other internal errors.
634 SSL_TEST_CTX *SSL_TEST_CTX_new()
637 ret = OPENSSL_zalloc(sizeof(*ret));
638 TEST_check(ret != NULL);
639 ret->app_data_size = default_app_data_size;
640 ret->max_fragment_size = default_max_fragment_size;
644 static void ssl_test_extra_conf_free_data(SSL_TEST_EXTRA_CONF *conf)
646 OPENSSL_free(conf->client.npn_protocols);
647 OPENSSL_free(conf->server.npn_protocols);
648 OPENSSL_free(conf->server2.npn_protocols);
649 OPENSSL_free(conf->client.alpn_protocols);
650 OPENSSL_free(conf->server.alpn_protocols);
651 OPENSSL_free(conf->server2.alpn_protocols);
652 OPENSSL_free(conf->client.reneg_ciphers);
653 OPENSSL_free(conf->server.srp_user);
654 OPENSSL_free(conf->server.srp_password);
655 OPENSSL_free(conf->server2.srp_user);
656 OPENSSL_free(conf->server2.srp_password);
657 OPENSSL_free(conf->client.srp_user);
658 OPENSSL_free(conf->client.srp_password);
661 static void ssl_test_ctx_free_extra_data(SSL_TEST_CTX *ctx)
663 ssl_test_extra_conf_free_data(&ctx->extra);
664 ssl_test_extra_conf_free_data(&ctx->resume_extra);
667 void SSL_TEST_CTX_free(SSL_TEST_CTX *ctx)
669 ssl_test_ctx_free_extra_data(ctx);
670 OPENSSL_free(ctx->expected_npn_protocol);
671 OPENSSL_free(ctx->expected_alpn_protocol);
672 sk_X509_NAME_pop_free(ctx->expected_server_ca_names, X509_NAME_free);
673 sk_X509_NAME_pop_free(ctx->expected_client_ca_names, X509_NAME_free);
677 static int parse_client_options(SSL_TEST_CLIENT_CONF *client, const CONF *conf,
678 const char *client_section)
680 STACK_OF(CONF_VALUE) *sk_conf;
684 sk_conf = NCONF_get_section(conf, client_section);
685 TEST_check(sk_conf != NULL);
687 for (i = 0; i < sk_CONF_VALUE_num(sk_conf); i++) {
689 const CONF_VALUE *option = sk_CONF_VALUE_value(sk_conf, i);
690 for (j = 0; j < OSSL_NELEM(ssl_test_client_options); j++) {
691 if (strcmp(option->name, ssl_test_client_options[j].name) == 0) {
692 if (!ssl_test_client_options[j].parse(client, option->value)) {
693 fprintf(stderr, "Bad value %s for option %s\n",
694 option->value, option->name);
702 fprintf(stderr, "Unknown test option: %s\n", option->name);
710 static int parse_server_options(SSL_TEST_SERVER_CONF *server, const CONF *conf,
711 const char *server_section)
713 STACK_OF(CONF_VALUE) *sk_conf;
717 sk_conf = NCONF_get_section(conf, server_section);
718 TEST_check(sk_conf != NULL);
720 for (i = 0; i < sk_CONF_VALUE_num(sk_conf); i++) {
722 const CONF_VALUE *option = sk_CONF_VALUE_value(sk_conf, i);
723 for (j = 0; j < OSSL_NELEM(ssl_test_server_options); j++) {
724 if (strcmp(option->name, ssl_test_server_options[j].name) == 0) {
725 if (!ssl_test_server_options[j].parse(server, option->value)) {
726 fprintf(stderr, "Bad value %s for option %s\n",
727 option->value, option->name);
735 fprintf(stderr, "Unknown test option: %s\n", option->name);
743 SSL_TEST_CTX *SSL_TEST_CTX_create(const CONF *conf, const char *test_section)
745 STACK_OF(CONF_VALUE) *sk_conf;
750 sk_conf = NCONF_get_section(conf, test_section);
751 TEST_check(sk_conf != NULL);
753 ctx = SSL_TEST_CTX_new();
754 TEST_check(ctx != NULL);
756 for (i = 0; i < sk_CONF_VALUE_num(sk_conf); i++) {
758 const CONF_VALUE *option = sk_CONF_VALUE_value(sk_conf, i);
761 if (strcmp(option->name, "client") == 0) {
762 if (!parse_client_options(&ctx->extra.client, conf,
765 } else if (strcmp(option->name, "server") == 0) {
766 if (!parse_server_options(&ctx->extra.server, conf,
769 } else if (strcmp(option->name, "server2") == 0) {
770 if (!parse_server_options(&ctx->extra.server2, conf,
773 } else if (strcmp(option->name, "resume-client") == 0) {
774 if (!parse_client_options(&ctx->resume_extra.client, conf,
777 } else if (strcmp(option->name, "resume-server") == 0) {
778 if (!parse_server_options(&ctx->resume_extra.server, conf,
781 } else if (strcmp(option->name, "resume-server2") == 0) {
782 if (!parse_server_options(&ctx->resume_extra.server2, conf,
787 for (j = 0; j < OSSL_NELEM(ssl_test_ctx_options); j++) {
788 if (strcmp(option->name, ssl_test_ctx_options[j].name) == 0) {
789 if (!ssl_test_ctx_options[j].parse(ctx, option->value)) {
790 fprintf(stderr, "Bad value %s for option %s\n",
791 option->value, option->name);
799 fprintf(stderr, "Unknown test option: %s\n", option->name);
808 SSL_TEST_CTX_free(ctx);