|
|
|
@ -40,9 +40,9 @@ |
|
|
|
|
|
|
|
|
|
static void verifier(grpc_server *server, grpc_completion_queue *cq) { |
|
|
|
|
while (grpc_server_has_open_connections(server)) { |
|
|
|
|
GPR_ASSERT(grpc_completion_queue_next( |
|
|
|
|
cq, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(20), NULL) |
|
|
|
|
.type == GRPC_QUEUE_TIMEOUT); |
|
|
|
|
GPR_ASSERT(grpc_completion_queue_next(cq, |
|
|
|
|
GRPC_TIMEOUT_MILLIS_TO_DEADLINE(20), |
|
|
|
|
NULL).type == GRPC_QUEUE_TIMEOUT); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -126,24 +126,29 @@ int main(int argc, char **argv) { |
|
|
|
|
0); |
|
|
|
|
GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR |
|
|
|
|
"\x00\x00\x04\x01\x04\x00\x00\x00\x01" |
|
|
|
|
"\x7f\x7f\x01""a", |
|
|
|
|
"\x7f\x7f\x01" |
|
|
|
|
"a", |
|
|
|
|
0); |
|
|
|
|
GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR |
|
|
|
|
"\x00\x00\x04\x01\x04\x00\x00\x00\x01" |
|
|
|
|
"\x0f\x7f\x01""a", |
|
|
|
|
"\x0f\x7f\x01" |
|
|
|
|
"a", |
|
|
|
|
0); |
|
|
|
|
GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR |
|
|
|
|
"\x00\x00\x04\x01\x04\x00\x00\x00\x01" |
|
|
|
|
"\x1f\x7f\x01""a", |
|
|
|
|
"\x1f\x7f\x01" |
|
|
|
|
"a", |
|
|
|
|
0); |
|
|
|
|
/* test nvr, not indexed in static table */ |
|
|
|
|
GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR |
|
|
|
|
"\x00\x00\x03\x01\x04\x00\x00\x00\x01" |
|
|
|
|
"\x01\x01""a", |
|
|
|
|
"\x01\x01" |
|
|
|
|
"a", |
|
|
|
|
GRPC_BAD_CLIENT_DISCONNECT); |
|
|
|
|
GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR |
|
|
|
|
"\x00\x00\x03\x01\x04\x00\x00\x00\x01" |
|
|
|
|
"\x11\x01""a", |
|
|
|
|
"\x11\x01" |
|
|
|
|
"a", |
|
|
|
|
GRPC_BAD_CLIENT_DISCONNECT); |
|
|
|
|
/* illegal op code */ |
|
|
|
|
GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR |
|
|
|
@ -228,14 +233,12 @@ int main(int argc, char **argv) { |
|
|
|
|
GRPC_BAD_CLIENT_DISCONNECT); |
|
|
|
|
|
|
|
|
|
/* dynamic table size update: set to default */ |
|
|
|
|
GRPC_RUN_BAD_CLIENT_TEST(verifier, |
|
|
|
|
PFX_STR
|
|
|
|
|
GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR |
|
|
|
|
"\x00\x00\x03\x01\x04\x00\x00\x00\x01" |
|
|
|
|
"\x3f\xe1\x1f", |
|
|
|
|
GRPC_BAD_CLIENT_DISCONNECT); |
|
|
|
|
/* dynamic table size update: set too large */ |
|
|
|
|
GRPC_RUN_BAD_CLIENT_TEST(verifier, |
|
|
|
|
PFX_STR
|
|
|
|
|
GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR |
|
|
|
|
"\x00\x00\x03\x01\x04\x00\x00\x00\x01" |
|
|
|
|
"\x3f\xf1\x1f", |
|
|
|
|
0); |
|
|
|
@ -251,42 +254,35 @@ int main(int argc, char **argv) { |
|
|
|
|
0); |
|
|
|
|
|
|
|
|
|
/* non-ending header followed by continuation frame */ |
|
|
|
|
GRPC_RUN_BAD_CLIENT_TEST(verifier, |
|
|
|
|
PFX_STR
|
|
|
|
|
GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR |
|
|
|
|
"\x00\x00\x00\x01\x00\x00\x00\x00\x01" |
|
|
|
|
"\x00\x00\x00\x09\x04\x00\x00\x00\x01", |
|
|
|
|
GRPC_BAD_CLIENT_DISCONNECT); |
|
|
|
|
/* non-ending header followed by non-continuation frame */ |
|
|
|
|
GRPC_RUN_BAD_CLIENT_TEST(verifier, |
|
|
|
|
PFX_STR
|
|
|
|
|
GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR |
|
|
|
|
"\x00\x00\x00\x01\x00\x00\x00\x00\x01" |
|
|
|
|
"\x00\x00\x00\x00\x04\x00\x00\x00\x01", |
|
|
|
|
0); |
|
|
|
|
/* non-ending header followed by a continuation frame for a different stream */ |
|
|
|
|
GRPC_RUN_BAD_CLIENT_TEST(verifier, |
|
|
|
|
PFX_STR
|
|
|
|
|
/* non-ending header followed by a continuation frame for a different stream
|
|
|
|
|
*/ |
|
|
|
|
GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR |
|
|
|
|
"\x00\x00\x00\x01\x04\x00\x00\x00\x01" |
|
|
|
|
"\x00\x00\x00\x01\x00\x00\x00\x00\x03" |
|
|
|
|
"\x00\x00\x00\x09\x04\x00\x00\x00\x01", |
|
|
|
|
0); |
|
|
|
|
/* opening with a continuation frame */ |
|
|
|
|
GRPC_RUN_BAD_CLIENT_TEST(verifier, |
|
|
|
|
PFX_STR
|
|
|
|
|
"\x00\x00\x00\x09\x04\x00\x00\x00\x01", |
|
|
|
|
0); |
|
|
|
|
PFX_STR "\x00\x00\x00\x09\x04\x00\x00\x00\x01", 0); |
|
|
|
|
/* three header frames */ |
|
|
|
|
GRPC_RUN_BAD_CLIENT_TEST(verifier, |
|
|
|
|
PFX_STR
|
|
|
|
|
GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR |
|
|
|
|
"\x00\x00\x00\x01\x04\x00\x00\x00\x01" |
|
|
|
|
"\x00\x00\x00\x01\x04\x00\x00\x00\x01" |
|
|
|
|
"\x00\x00\x00\x01\x04\x00\x00\x00\x01", |
|
|
|
|
GRPC_BAD_CLIENT_DISCONNECT); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* an invalid header found with fuzzing */ |
|
|
|
|
GRPC_RUN_BAD_CLIENT_TEST(verifier, |
|
|
|
|
PFX_STR
|
|
|
|
|
"\x00\x00\x00\x01\x39\x67\xed\x1d\x64", |
|
|
|
|
PFX_STR "\x00\x00\x00\x01\x39\x67\xed\x1d\x64", |
|
|
|
|
GRPC_BAD_CLIENT_DISCONNECT); |
|
|
|
|
|
|
|
|
|
/* a badly encoded timeout value */ |
|
|
|
|