Remove fail_second_ddos_callback.

We have generic -on-resume prefixes now. This avoids the global counter.

Change-Id: I7596ed3273e826b744d8545f7ed2bdd5e9190958
Reviewed-on: https://boringssl-review.googlesource.com/29594
Commit-Queue: David Benjamin <davidben@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
Reviewed-by: Matt Braithwaite <mab@google.com>
This commit is contained in:
David Benjamin 2018-07-03 18:08:26 -04:00 committed by CQ bot account: commit-bot@chromium.org
parent 2908dd141f
commit 53d2c7a84a
4 changed files with 2 additions and 11 deletions

View File

@ -843,14 +843,7 @@ static SSL_SESSION *GetSessionCallback(SSL *ssl, const uint8_t *data, int len,
static int DDoSCallback(const SSL_CLIENT_HELLO *client_hello) {
const TestConfig *config = GetTestConfig(client_hello->ssl);
static int callback_num = 0;
callback_num++;
if (config->fail_ddos_callback ||
(config->fail_second_ddos_callback && callback_num == 2)) {
return 0;
}
return 1;
return config->fail_ddos_callback ? 0 : 1;
}
static void InfoCallback(const SSL *ssl, int type, int val) {

View File

@ -5456,7 +5456,7 @@ func addDDoSCallbackTests() {
failFlag := "-fail-ddos-callback"
if resume {
failFlag = "-fail-second-ddos-callback"
failFlag = "-on-resume-fail-ddos-callback"
}
testCases = append(testCases, testCase{
testType: serverTest,

View File

@ -74,7 +74,6 @@ const Flag<bool> kBoolFlags[] = {
{ "-fail-early-callback", &TestConfig::fail_early_callback },
{ "-install-ddos-callback", &TestConfig::install_ddos_callback },
{ "-fail-ddos-callback", &TestConfig::fail_ddos_callback },
{ "-fail-second-ddos-callback", &TestConfig::fail_second_ddos_callback },
{ "-fail-cert-callback", &TestConfig::fail_cert_callback },
{ "-handshake-never-done", &TestConfig::handshake_never_done },
{ "-use-export-context", &TestConfig::use_export_context },

View File

@ -79,7 +79,6 @@ struct TestConfig {
bool fail_early_callback = false;
bool install_ddos_callback = false;
bool fail_ddos_callback = false;
bool fail_second_ddos_callback = false;
bool fail_cert_callback = false;
std::string cipher;
bool handshake_never_done = false;