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:
parent
2908dd141f
commit
53d2c7a84a
@ -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) {
|
static int DDoSCallback(const SSL_CLIENT_HELLO *client_hello) {
|
||||||
const TestConfig *config = GetTestConfig(client_hello->ssl);
|
const TestConfig *config = GetTestConfig(client_hello->ssl);
|
||||||
static int callback_num = 0;
|
return config->fail_ddos_callback ? 0 : 1;
|
||||||
|
|
||||||
callback_num++;
|
|
||||||
if (config->fail_ddos_callback ||
|
|
||||||
(config->fail_second_ddos_callback && callback_num == 2)) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void InfoCallback(const SSL *ssl, int type, int val) {
|
static void InfoCallback(const SSL *ssl, int type, int val) {
|
||||||
|
@ -5456,7 +5456,7 @@ func addDDoSCallbackTests() {
|
|||||||
|
|
||||||
failFlag := "-fail-ddos-callback"
|
failFlag := "-fail-ddos-callback"
|
||||||
if resume {
|
if resume {
|
||||||
failFlag = "-fail-second-ddos-callback"
|
failFlag = "-on-resume-fail-ddos-callback"
|
||||||
}
|
}
|
||||||
testCases = append(testCases, testCase{
|
testCases = append(testCases, testCase{
|
||||||
testType: serverTest,
|
testType: serverTest,
|
||||||
|
@ -74,7 +74,6 @@ const Flag<bool> kBoolFlags[] = {
|
|||||||
{ "-fail-early-callback", &TestConfig::fail_early_callback },
|
{ "-fail-early-callback", &TestConfig::fail_early_callback },
|
||||||
{ "-install-ddos-callback", &TestConfig::install_ddos_callback },
|
{ "-install-ddos-callback", &TestConfig::install_ddos_callback },
|
||||||
{ "-fail-ddos-callback", &TestConfig::fail_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 },
|
{ "-fail-cert-callback", &TestConfig::fail_cert_callback },
|
||||||
{ "-handshake-never-done", &TestConfig::handshake_never_done },
|
{ "-handshake-never-done", &TestConfig::handshake_never_done },
|
||||||
{ "-use-export-context", &TestConfig::use_export_context },
|
{ "-use-export-context", &TestConfig::use_export_context },
|
||||||
|
@ -79,7 +79,6 @@ struct TestConfig {
|
|||||||
bool fail_early_callback = false;
|
bool fail_early_callback = false;
|
||||||
bool install_ddos_callback = false;
|
bool install_ddos_callback = false;
|
||||||
bool fail_ddos_callback = false;
|
bool fail_ddos_callback = false;
|
||||||
bool fail_second_ddos_callback = false;
|
|
||||||
bool fail_cert_callback = false;
|
bool fail_cert_callback = false;
|
||||||
std::string cipher;
|
std::string cipher;
|
||||||
bool handshake_never_done = false;
|
bool handshake_never_done = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user