summaryrefslogtreecommitdiffstats
path: root/test/ssl_test.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2017-01-08 00:09:08 +0000
committerDr. Stephen Henson <steve@openssl.org>2017-01-08 19:39:33 +0000
commit75f12d7cbffcaa31cc8ff5c7fee02e614785632a (patch)
tree7e965bf40bd456b24cb000757e4611f47d7124e7 /test/ssl_test.c
parent1702df6ed6bb6fd494adfa74125b5948bfbc13a6 (diff)
Add new ssl_test option.
Add option ExpectedTmpKeyType to test the temporary key the server sends is of the correct type. Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2191) (cherry picked from commit b93ad05dba3e3d2ceb79799a883ae43d42ba16e2)
Diffstat (limited to 'test/ssl_test.c')
-rw-r--r--test/ssl_test.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ssl_test.c b/test/ssl_test.c
index 9f146180f3..60ccbe7f0f 100644
--- a/test/ssl_test.c
+++ b/test/ssl_test.c
@@ -198,6 +198,17 @@ static int check_resumption(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx)
return 1;
}
+static int check_tmp_key(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx)
+{
+ if (test_ctx->expected_tmp_key_type == 0
+ || test_ctx->expected_tmp_key_type == result->tmp_key_type)
+ return 1;
+ fprintf(stderr, "Tmp key type mismatch, %s vs %s\n",
+ OBJ_nid2ln(test_ctx->expected_tmp_key_type),
+ OBJ_nid2ln(result->tmp_key_type));
+ return 0;
+}
+
/*
* This could be further simplified by constructing an expected
* HANDSHAKE_RESULT, and implementing comparison methods for
@@ -218,6 +229,7 @@ static int check_test(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx)
#endif
ret &= check_alpn(result, test_ctx);
ret &= check_resumption(result, test_ctx);
+ ret &= check_tmp_key(result, test_ctx);
}
return ret;
}