diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2017-03-31 23:35:28 +0200 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2017-04-04 00:47:22 +0200 |
commit | f15b50c4cb6a5d36a3789863035d8b795378280c (patch) | |
tree | a447642f184a7e491daa14bd464673f3949b808b /test/ssl_test.c | |
parent | Constify SSL_dup_CA_list() (diff) | |
download | openssl-f15b50c4cb6a5d36a3789863035d8b795378280c.tar.xz openssl-f15b50c4cb6a5d36a3789863035d8b795378280c.zip |
Add ExpectedServerCANames
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3015)
Diffstat (limited to 'test/ssl_test.c')
-rw-r--r-- | test/ssl_test.c | 105 |
1 files changed, 57 insertions, 48 deletions
diff --git a/test/ssl_test.c b/test/ssl_test.c index 0cdec46d3e..9406f94280 100644 --- a/test/ssl_test.c +++ b/test/ssl_test.c @@ -195,54 +195,6 @@ static int check_nid(const char *name, int expected_nid, int nid) return 0; } -static int check_tmp_key(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) -{ - return check_nid("Tmp key", test_ctx->expected_tmp_key_type, - result->tmp_key_type); -} - -static int check_server_cert_type(HANDSHAKE_RESULT *result, - SSL_TEST_CTX *test_ctx) -{ - return check_nid("Server certificate", test_ctx->expected_server_cert_type, - result->server_cert_type); -} - -static int check_server_sign_hash(HANDSHAKE_RESULT *result, - SSL_TEST_CTX *test_ctx) -{ - return check_nid("Server signing hash", test_ctx->expected_server_sign_hash, - 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) -{ - return check_nid("Client certificate", test_ctx->expected_client_cert_type, - result->client_cert_type); -} - -static int check_client_sign_hash(HANDSHAKE_RESULT *result, - SSL_TEST_CTX *test_ctx) -{ - return check_nid("Client signing hash", test_ctx->expected_client_sign_hash, - 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); -} - static void print_ca_names(STACK_OF(X509_NAME) *names) { BIO *err; @@ -291,6 +243,62 @@ static int check_ca_names(const char *name, return 0; } +static int check_tmp_key(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) +{ + return check_nid("Tmp key", test_ctx->expected_tmp_key_type, + result->tmp_key_type); +} + +static int check_server_cert_type(HANDSHAKE_RESULT *result, + SSL_TEST_CTX *test_ctx) +{ + return check_nid("Server certificate", test_ctx->expected_server_cert_type, + result->server_cert_type); +} + +static int check_server_sign_hash(HANDSHAKE_RESULT *result, + SSL_TEST_CTX *test_ctx) +{ + return check_nid("Server signing hash", test_ctx->expected_server_sign_hash, + 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_server_ca_names(HANDSHAKE_RESULT *result, + SSL_TEST_CTX *test_ctx) +{ + return check_ca_names("Server CA names", + test_ctx->expected_server_ca_names, + result->server_ca_names); +} + +static int check_client_cert_type(HANDSHAKE_RESULT *result, + SSL_TEST_CTX *test_ctx) +{ + return check_nid("Client certificate", test_ctx->expected_client_cert_type, + result->client_cert_type); +} + +static int check_client_sign_hash(HANDSHAKE_RESULT *result, + SSL_TEST_CTX *test_ctx) +{ + return check_nid("Client signing hash", test_ctx->expected_client_sign_hash, + 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); +} + static int check_client_ca_names(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) { @@ -324,6 +332,7 @@ static int check_test(HANDSHAKE_RESULT *result, SSL_TEST_CTX *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_server_ca_names(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); |