* ExpectedServerCertType, ExpectedClientCertType - the expected algorithm or
curve of server or client certificate
-* ExpectedServerSignatureHash, ExpectedClientSignatureHash - the expected
+* ExpectedServerSignHash, ExpectedClientSignHash - the expected
signing hash used by server or client certificate
+* ExpectedServerSignType, ExpectedClientSignType - the expected
+ signature type used by server or client when signing messages
+
## Configuring the client and server
The client and server configurations can be any valid `SSL_CTX`
SSL_get_peer_signature_nid(client.ssl, &ret->server_sign_hash);
SSL_get_peer_signature_nid(server.ssl, &ret->client_sign_hash);
+ SSL_get_peer_signature_type_nid(client.ssl, &ret->server_sign_type);
+ SSL_get_peer_signature_type_nid(server.ssl, &ret->client_sign_type);
+
ret->server_cert_type = peer_pkey_type(client.ssl);
ret->client_cert_type = peer_pkey_type(server.ssl);
int server_cert_type;
/* server signing hash */
int server_sign_hash;
+ /* server signature type */
+ int server_sign_type;
/* client certificate key type */
int client_cert_type;
/* client signing hash */
int client_sign_hash;
+ /* client signature type */
+ int client_sign_type;
} HANDSHAKE_RESULT;
HANDSHAKE_RESULT *HANDSHAKE_RESULT_new(void);
result->server_sign_hash);
}
+static int check_server_sign_type(HANDSHAKE_RESULT *result,
+ SSL_TEST_CTX *test_ctx)
+{
+ return check_nid("Server signing", test_ctx->expected_server_sign_type,
+ result->server_sign_type);
+}
+
static int check_client_cert_type(HANDSHAKE_RESULT *result,
SSL_TEST_CTX *test_ctx)
{
result->client_sign_hash);
}
+static int check_client_sign_type(HANDSHAKE_RESULT *result,
+ SSL_TEST_CTX *test_ctx)
+{
+ return check_nid("Client signing", test_ctx->expected_client_sign_type,
+ result->client_sign_type);
+}
+
/*
* This could be further simplified by constructing an expected
* HANDSHAKE_RESULT, and implementing comparison methods for
ret &= check_tmp_key(result, test_ctx);
ret &= check_server_cert_type(result, test_ctx);
ret &= check_server_sign_hash(result, test_ctx);
+ ret &= check_server_sign_type(result, test_ctx);
ret &= check_client_cert_type(result, test_ctx);
ret &= check_client_sign_hash(result, test_ctx);
+ ret &= check_client_sign_type(result, test_ctx);
}
return ret;
}
IMPLEMENT_SSL_TEST_INT_OPTION(SSL_TEST_CTX, test, max_fragment_size)
-/***********************/
-/* Expected key types */
-/***********************/
+/*************************************/
+/* Expected key and signature types */
+/*************************************/
__owur static int parse_expected_key_type(int *ptype, const char *value)
{
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)
{
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 */
/*************************/
{ "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. */
int expected_server_cert_type;
/* Expected server signing hash */
int expected_server_sign_hash;
+ /* Expected server signature type */
+ int expected_server_sign_type;
/* Expected client certificate key type */
int expected_client_cert_type;
/* Expected client signing hash */
int expected_client_sign_hash;
+ /* Expected client signature type */
+ int expected_client_sign_type;
} SSL_TEST_CTX;
const char *ssl_test_result_name(ssl_test_result_t result);