}
-/*******************/
-/* ExpectedResult. */
-/*******************/
+/* ExpectedResult */
static const test_enum ssl_test_results[] = {
{"Success", SSL_TEST_SUCCESS},
return enum_name(ssl_test_results, OSSL_NELEM(ssl_test_results), result);
}
-/**********************************************/
-/* ExpectedClientAlert / ExpectedServerAlert. */
-/**********************************************/
+/* ExpectedClientAlert / ExpectedServerAlert */
static const test_enum ssl_alerts[] = {
{"UnknownCA", SSL_AD_UNKNOWN_CA},
return enum_name(ssl_alerts, OSSL_NELEM(ssl_alerts), alert);
}
-/********************/
/* ExpectedProtocol */
-/********************/
static const test_enum ssl_protocols[] = {
{"TLSv1.3", TLS1_3_VERSION},
return enum_name(ssl_protocols, OSSL_NELEM(ssl_protocols), protocol);
}
-/***********************/
-/* VerifyCallback. */
-/***********************/
+/* VerifyCallback */
static const test_enum ssl_verify_callbacks[] = {
{"None", SSL_TEST_VERIFY_NONE},
callback);
}
-/**************/
/* ServerName */
-/**************/
static const test_enum ssl_servername[] = {
{"None", SSL_TEST_SERVERNAME_NONE},
server);
}
-/**********************/
/* ServerNameCallback */
-/**********************/
static const test_enum ssl_servername_callbacks[] = {
{"None", SSL_TEST_SERVERNAME_CB_NONE},
{"IgnoreMismatch", SSL_TEST_SERVERNAME_IGNORE_MISMATCH},
{"RejectMismatch", SSL_TEST_SERVERNAME_REJECT_MISMATCH},
+ {"EarlyIgnoreMismatch", SSL_TEST_SERVERNAME_EARLY_IGNORE_MISMATCH},
+ {"EarlyRejectMismatch", SSL_TEST_SERVERNAME_EARLY_REJECT_MISMATCH},
+ {"EarlyNoV12", SSL_TEST_SERVERNAME_EARLY_NO_V12},
};
__owur static int parse_servername_callback(SSL_TEST_SERVER_CONF *server_conf,
OSSL_NELEM(ssl_servername_callbacks), callback);
}
-/*************************/
/* SessionTicketExpected */
-/*************************/
static const test_enum ssl_session_ticket[] = {
{"Ignore", SSL_TEST_SESSION_TICKET_IGNORE},
server);
}
-/***********************/
-/* Method */
-/***********************/
+/* Method */
static const test_enum ssl_test_methods[] = {
{"TLS", SSL_TEST_METHOD_TLS},
return enum_name(ssl_test_methods, OSSL_NELEM(ssl_test_methods), method);
}
-/************************************/
-/* NPN and ALPN options */
-/************************************/
+/* NPN and ALPN options */
IMPLEMENT_SSL_TEST_STRING_OPTION(SSL_TEST_CLIENT_CONF, client, npn_protocols)
IMPLEMENT_SSL_TEST_STRING_OPTION(SSL_TEST_SERVER_CONF, server, npn_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)
-/***********************/
-/* Handshake mode */
-/***********************/
+/* Handshake mode */
static const test_enum ssl_handshake_modes[] = {
{"Simple", SSL_TEST_HANDSHAKE_SIMPLE},
{"Resume", SSL_TEST_HANDSHAKE_RESUME},
{"RenegotiateServer", SSL_TEST_HANDSHAKE_RENEG_SERVER},
{"RenegotiateClient", SSL_TEST_HANDSHAKE_RENEG_CLIENT},
+ {"KeyUpdateServer", SSL_TEST_HANDSHAKE_KEY_UPDATE_SERVER},
+ {"KeyUpdateClient", SSL_TEST_HANDSHAKE_KEY_UPDATE_CLIENT},
};
__owur static int parse_handshake_mode(SSL_TEST_CTX *test_ctx, const char *value)
mode);
}
-/***********************/
-/* CT Validation */
-/***********************/
+/* Renegotiation Ciphersuites */
+
+IMPLEMENT_SSL_TEST_STRING_OPTION(SSL_TEST_CLIENT_CONF, client, reneg_ciphers)
+
+/* KeyUpdateType */
+
+static const test_enum ssl_key_update_types[] = {
+ {"KeyUpdateRequested", SSL_KEY_UPDATE_REQUESTED},
+ {"KeyUpdateNotRequested", SSL_KEY_UPDATE_NOT_REQUESTED},
+};
+
+__owur static int parse_key_update_type(SSL_TEST_CTX *test_ctx, const char *value)
+{
+ int ret_value;
+ if (!parse_enum(ssl_key_update_types, OSSL_NELEM(ssl_key_update_types),
+ &ret_value, value)) {
+ return 0;
+ }
+ test_ctx->key_update_type = ret_value;
+ return 1;
+}
+
+/* CT Validation */
static const test_enum ssl_ct_validation_modes[] = {
{"None", SSL_TEST_CT_VALIDATION_NONE},
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},
OSSL_NELEM(ssl_certstatus), cert_status);
}
-/***********************/
-/* ApplicationData */
-/***********************/
+/* ApplicationData */
IMPLEMENT_SSL_TEST_INT_OPTION(SSL_TEST_CTX, test, app_data_size)
-/***********************/
-/* MaxFragmentSize */
-/***********************/
+
+/* MaxFragmentSize */
IMPLEMENT_SSL_TEST_INT_OPTION(SSL_TEST_CTX, test, max_fragment_size)
-/***********************/
-/* ExpectedTmpKeyType */
-/***********************/
-__owur static int parse_expected_tmp_key_type(SSL_TEST_CTX *test_ctx,
- const char *value)
+/* 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;
- nid = OBJ_sn2nid(value);
+ 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
#endif
if (nid == NID_undef)
return 0;
- test_ctx->expected_tmp_key_type = nid;
+ *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);
+}
+
+
/* Known test options and their corresponding parse methods. */
-/*************************************************************/
/* Top-level options. */
typedef struct {
{ "ExpectedNPNProtocol", &parse_test_expected_npn_protocol },
{ "ExpectedALPNProtocol", &parse_test_expected_alpn_protocol },
{ "HandshakeMode", &parse_handshake_mode },
+ { "KeyUpdateType", &parse_key_update_type },
{ "ResumptionExpected", &parse_test_resumption_expected },
{ "ApplicationData", &parse_test_app_data_size },
{ "MaxFragmentSize", &parse_test_max_fragment_size },
{ "ExpectedTmpKeyType", &parse_expected_tmp_key_type },
+ { "ExpectedServerCertType", &parse_expected_server_cert_type },
+ { "ExpectedServerSignHash", &parse_expected_server_sign_hash },
+ { "ExpectedServerSignType", &parse_expected_server_sign_type },
+ { "ExpectedClientCertType", &parse_expected_client_cert_type },
+ { "ExpectedClientSignHash", &parse_expected_client_sign_hash },
+ { "ExpectedClientSignType", &parse_expected_client_sign_type },
};
/* Nested client options. */
{ "NPNProtocols", &parse_client_npn_protocols },
{ "ALPNProtocols", &parse_client_alpn_protocols },
{ "CTValidation", &parse_ct_validation },
+ { "RenegotiateCiphers", &parse_client_reneg_ciphers},
};
/* Nested server options. */
OPENSSL_free(conf->client.alpn_protocols);
OPENSSL_free(conf->server.alpn_protocols);
OPENSSL_free(conf->server2.alpn_protocols);
+ OPENSSL_free(conf->client.reneg_ciphers);
}
static void ssl_test_ctx_free_extra_data(SSL_TEST_CTX *ctx)