Run TestOneSidedShutdown at all versions.

Change-Id: I3a5d949eec9241ea43da40ce23e0e7f2a25e30e5
Reviewed-on: https://boringssl-review.googlesource.com/12381
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
Reviewed-by: Steven Valdez <svaldez@google.com>
Reviewed-by: David Benjamin <davidben@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
This commit is contained in:
David Benjamin 2016-11-18 15:14:42 +09:00 committed by CQ bot account: commit-bot@chromium.org
parent 0fef3056eb
commit 68f37b7a3f

View File

@ -1378,16 +1378,22 @@ static bool TestSequenceNumber(bool is_dtls, const SSL_METHOD *method,
return true; return true;
} }
static bool TestOneSidedShutdown() { static bool TestOneSidedShutdown(bool is_dtls, const SSL_METHOD *method,
bssl::UniquePtr<SSL_CTX> client_ctx(SSL_CTX_new(TLS_method())); uint16_t version) {
bssl::UniquePtr<SSL_CTX> server_ctx(SSL_CTX_new(TLS_method())); // SSL_shutdown is a no-op in DTLS.
if (!client_ctx || !server_ctx) { if (is_dtls) {
return false; return true;
} }
bssl::UniquePtr<SSL_CTX> client_ctx(SSL_CTX_new(method));
bssl::UniquePtr<SSL_CTX> server_ctx(SSL_CTX_new(method));
bssl::UniquePtr<X509> cert = GetTestCertificate(); bssl::UniquePtr<X509> cert = GetTestCertificate();
bssl::UniquePtr<EVP_PKEY> key = GetTestKey(); bssl::UniquePtr<EVP_PKEY> key = GetTestKey();
if (!cert || !key || if (!client_ctx || !server_ctx || !cert || !key ||
!SSL_CTX_set_min_proto_version(server_ctx.get(), version) ||
!SSL_CTX_set_max_proto_version(server_ctx.get(), version) ||
!SSL_CTX_set_min_proto_version(client_ctx.get(), version) ||
!SSL_CTX_set_max_proto_version(client_ctx.get(), version) ||
!SSL_CTX_use_certificate(server_ctx.get(), cert.get()) || !SSL_CTX_use_certificate(server_ctx.get(), cert.get()) ||
!SSL_CTX_use_PrivateKey(server_ctx.get(), key.get())) { !SSL_CTX_use_PrivateKey(server_ctx.get(), key.get())) {
return false; return false;
@ -1433,6 +1439,7 @@ static bool TestOneSidedShutdown() {
return true; return true;
} }
static bool TestSessionDuplication() { static bool TestSessionDuplication() {
bssl::UniquePtr<SSL_CTX> client_ctx(SSL_CTX_new(TLS_method())); bssl::UniquePtr<SSL_CTX> client_ctx(SSL_CTX_new(TLS_method()));
bssl::UniquePtr<SSL_CTX> server_ctx(SSL_CTX_new(TLS_method())); bssl::UniquePtr<SSL_CTX> server_ctx(SSL_CTX_new(TLS_method()));
@ -2648,7 +2655,7 @@ int main() {
!TestClientCAList() || !TestClientCAList() ||
!TestInternalSessionCache() || !TestInternalSessionCache() ||
!ForEachVersion(TestSequenceNumber) || !ForEachVersion(TestSequenceNumber) ||
!TestOneSidedShutdown() || !ForEachVersion(TestOneSidedShutdown) ||
!TestSessionDuplication() || !TestSessionDuplication() ||
!TestSetFD() || !TestSetFD() ||
!TestSetBIO() || !TestSetBIO() ||