summaryrefslogtreecommitdiffstats
path: root/test/ssl_test.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2017-01-08 01:09:08 +0100
committerDr. Stephen Henson <steve@openssl.org>2017-01-08 20:36:59 +0100
commitb93ad05dba3e3d2ceb79799a883ae43d42ba16e2 (patch)
tree8c7c244aa9467a0c958906bc598083e6c2eaa090 /test/ssl_test.c
parentfix a few more style issues (diff)
downloadopenssl-b93ad05dba3e3d2ceb79799a883ae43d42ba16e2.tar.xz
openssl-b93ad05dba3e3d2ceb79799a883ae43d42ba16e2.zip
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)
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 2003fd70a3..61850eb9f6 100644
--- a/test/ssl_test.c
+++ b/test/ssl_test.c
@@ -187,6 +187,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
@@ -207,6 +218,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;
}