+const char *ssl_max_fragment_len_name(int MFL_mode)
+{
+ return enum_name(ssl_max_fragment_len_mode,
+ OSSL_NELEM(ssl_max_fragment_len_mode), MFL_mode);
+}
+
+
+/* Expected key and signature types */
+
+__owur static int parse_expected_key_type(int *ptype, const char *value)
+{
+ int nid;
+ const EVP_PKEY_ASN1_METHOD *ameth;
+
+ if (value == NULL)
+ return 0;
+ ameth = EVP_PKEY_asn1_find_str(NULL, value, -1);
+ if (ameth != NULL)
+ EVP_PKEY_asn1_get0_info(&nid, NULL, NULL, NULL, NULL, ameth);
+ else
+ nid = OBJ_sn2nid(value);
+ if (nid == NID_undef)
+ nid = OBJ_ln2nid(value);
+#ifndef OPENSSL_NO_EC
+ if (nid == NID_undef)
+ nid = EC_curve_nist2nid(value);
+#endif
+ if (nid == NID_undef)
+ return 0;
+ *ptype = nid;
+ return 1;
+}
+
+__owur static int parse_expected_tmp_key_type(SSL_TEST_CTX *test_ctx,
+ const char *value)
+{
+ return parse_expected_key_type(&test_ctx->expected_tmp_key_type, value);
+}
+
+__owur static int parse_expected_server_cert_type(SSL_TEST_CTX *test_ctx,
+ const char *value)
+{
+ return parse_expected_key_type(&test_ctx->expected_server_cert_type,
+ value);
+}
+
+__owur static int parse_expected_server_sign_type(SSL_TEST_CTX *test_ctx,
+ const char *value)
+{
+ return parse_expected_key_type(&test_ctx->expected_server_sign_type,
+ value);
+}
+
+__owur static int parse_expected_client_cert_type(SSL_TEST_CTX *test_ctx,
+ const char *value)
+{
+ return parse_expected_key_type(&test_ctx->expected_client_cert_type,
+ value);
+}
+
+__owur static int parse_expected_client_sign_type(SSL_TEST_CTX *test_ctx,
+ const char *value)
+{
+ return parse_expected_key_type(&test_ctx->expected_client_sign_type,
+ value);
+}
+
+
+/* Expected signing hash */
+
+__owur static int parse_expected_sign_hash(int *ptype, const char *value)
+{
+ int nid;
+
+ if (value == NULL)
+ return 0;
+ nid = OBJ_sn2nid(value);
+ if (nid == NID_undef)
+ nid = OBJ_ln2nid(value);
+ if (nid == NID_undef)
+ return 0;
+ *ptype = nid;
+ return 1;
+}
+
+__owur static int parse_expected_server_sign_hash(SSL_TEST_CTX *test_ctx,
+ const char *value)
+{
+ return parse_expected_sign_hash(&test_ctx->expected_server_sign_hash,
+ value);
+}
+
+__owur static int parse_expected_client_sign_hash(SSL_TEST_CTX *test_ctx,
+ const char *value)
+{
+ return parse_expected_sign_hash(&test_ctx->expected_client_sign_hash,
+ 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_server_ca_names(SSL_TEST_CTX *test_ctx,
+ const char *value)
+{
+ return parse_expected_ca_names(&test_ctx->expected_server_ca_names, value);
+}
+__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);
+}
+
+/* ExpectedCipher */
+
+IMPLEMENT_SSL_TEST_STRING_OPTION(SSL_TEST_CTX, test, expected_cipher)
+
+/* Client and Server PHA */
+
+IMPLEMENT_SSL_TEST_BOOL_OPTION(SSL_TEST_CLIENT_CONF, client, enable_pha)
+IMPLEMENT_SSL_TEST_BOOL_OPTION(SSL_TEST_SERVER_CONF, server, force_pha)