瀏覽代碼

Enable renegotiation in the client fuzzer and read app data.

As long as the HTTP/1.1 client auth hack forces use to support renego, having
it on seems much more useful than having it off for fuzzing purposes. Also read
app data to exercise that code and, on the client, trigger renegotiations as
needed.

Change-Id: I1941ded6ec9bd764abd199d1518420a1075ed1b2
Reviewed-on: https://boringssl-review.googlesource.com/7291
Reviewed-by: Adam Langley <agl@google.com>
kris/onging/CECPQ3_patch15
David Benjamin 8 年之前
committed by Adam Langley
父節點
當前提交
d86c8a400b
共有 2 個文件被更改,包括 19 次插入2 次删除
  1. +10
    -1
      fuzz/client.cc
  2. +9
    -1
      fuzz/server.cc

+ 10
- 1
fuzz/client.cc 查看文件

@@ -24,9 +24,18 @@ extern "C" int LLVMFuzzerTestOneInput(uint8_t *buf, size_t len) {
BIO *out = BIO_new(BIO_s_mem());
SSL_set_bio(client, in, out);
SSL_set_connect_state(client);
SSL_set_renegotiate_mode(client, ssl_renegotiate_freely);

BIO_write(in, buf, len);
SSL_do_handshake(client);
if (SSL_do_handshake(client) == 1) {
// Keep reading application data until error or EOF.
uint8_t tmp[1024];
for (;;) {
if (SSL_read(client, tmp, sizeof(tmp)) <= 0) {
break;
}
}
}
SSL_free(client);

return 0;


+ 9
- 1
fuzz/server.cc 查看文件

@@ -215,7 +215,15 @@ extern "C" int LLVMFuzzerTestOneInput(uint8_t *buf, size_t len) {
SSL_set_accept_state(server);

BIO_write(in, buf, len);
SSL_do_handshake(server);
if (SSL_do_handshake(server) == 1) {
// Keep reading application data until error or EOF.
uint8_t tmp[1024];
for (;;) {
if (SSL_read(server, tmp, sizeof(tmp)) <= 0) {
break;
}
}
}
SSL_free(server);

return 0;


Loading…
取消
儲存