Adding a fuzzer for Sessions
Change-Id: I69cbb0679e1dbb6292a8f4737851736e58c17508 Reviewed-on: https://boringssl-review.googlesource.com/12481 Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
This commit is contained in:
parent
a4ee74dadf
commit
15073af5b7
@ -37,6 +37,7 @@ The recommended values of `max_len` for each test are:
|
||||
| `pkcs8` | 2048 |
|
||||
| `privkey` | 2048 |
|
||||
| `server` | 4096 |
|
||||
| `session` | 8192 |
|
||||
| `spki` | 1024 |
|
||||
| `read_pem` | 512 |
|
||||
| `ssl_ctx_api` | 256 |
|
||||
|
@ -74,3 +74,15 @@ add_executable(
|
||||
target_link_libraries(ssl_ctx_api Fuzzer)
|
||||
target_link_libraries(ssl_ctx_api crypto)
|
||||
target_link_libraries(ssl_ctx_api ssl)
|
||||
|
||||
add_executable(
|
||||
session
|
||||
|
||||
session.cc
|
||||
|
||||
$<TARGET_OBJECTS:test_support>
|
||||
)
|
||||
|
||||
target_link_libraries(session Fuzzer)
|
||||
target_link_libraries(session crypto)
|
||||
target_link_libraries(session ssl)
|
||||
|
39
fuzz/session.cc
Normal file
39
fuzz/session.cc
Normal file
@ -0,0 +1,39 @@
|
||||
/* Copyright (c) 2016, Google Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <openssl/mem.h>
|
||||
#include <openssl/ssl.h>
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(uint8_t *buf, size_t len) {
|
||||
// Parse in our session.
|
||||
bssl::UniquePtr<SSL_SESSION> session(SSL_SESSION_from_bytes(buf, len));
|
||||
|
||||
// If the format was invalid, just return.
|
||||
if (!session) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Stress the encoder.
|
||||
size_t encoded_len;
|
||||
uint8_t *encoded;
|
||||
if (!SSL_SESSION_to_bytes(session.get(), &encoded, &encoded_len)) {
|
||||
fprintf(stderr, "SSL_SESSION_to_bytes failed.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
OPENSSL_free(encoded);
|
||||
return 0;
|
||||
}
|
BIN
fuzz/session_corpus/00bff688b187a70181ffbc2f3e4b8bfad5a2fa67
Normal file
BIN
fuzz/session_corpus/00bff688b187a70181ffbc2f3e4b8bfad5a2fa67
Normal file
Binary file not shown.
BIN
fuzz/session_corpus/177ed9c6a351c40e51c711a9d741446818135ba5
Normal file
BIN
fuzz/session_corpus/177ed9c6a351c40e51c711a9d741446818135ba5
Normal file
Binary file not shown.
BIN
fuzz/session_corpus/30d9e05c398a2b4f4e365c9d1ab9ecccb14b45c5
Normal file
BIN
fuzz/session_corpus/30d9e05c398a2b4f4e365c9d1ab9ecccb14b45c5
Normal file
Binary file not shown.
BIN
fuzz/session_corpus/3d979305bea736b3dad84be50f560c728e3a8261
Normal file
BIN
fuzz/session_corpus/3d979305bea736b3dad84be50f560c728e3a8261
Normal file
Binary file not shown.
BIN
fuzz/session_corpus/4f83848f049b10901df130a626bd138f83dbd147
Normal file
BIN
fuzz/session_corpus/4f83848f049b10901df130a626bd138f83dbd147
Normal file
Binary file not shown.
BIN
fuzz/session_corpus/511d42a381c86e2543cf60338be40237784a9f7f
Normal file
BIN
fuzz/session_corpus/511d42a381c86e2543cf60338be40237784a9f7f
Normal file
Binary file not shown.
BIN
fuzz/session_corpus/5539a165114947f10a1c321994b9dffc7fe70196
Normal file
BIN
fuzz/session_corpus/5539a165114947f10a1c321994b9dffc7fe70196
Normal file
Binary file not shown.
BIN
fuzz/session_corpus/61840ff5532ebe2ba4a75384390df3c084c338c4
Normal file
BIN
fuzz/session_corpus/61840ff5532ebe2ba4a75384390df3c084c338c4
Normal file
Binary file not shown.
BIN
fuzz/session_corpus/678f562f93ab09a2502a9857f3b05b5a840c2c18
Normal file
BIN
fuzz/session_corpus/678f562f93ab09a2502a9857f3b05b5a840c2c18
Normal file
Binary file not shown.
BIN
fuzz/session_corpus/7c05fbbe2bcfb9293bf862b76c600d971cc656ce
Normal file
BIN
fuzz/session_corpus/7c05fbbe2bcfb9293bf862b76c600d971cc656ce
Normal file
Binary file not shown.
BIN
fuzz/session_corpus/7f4f3e0d908bd50e1d7d24385dfd84c884de5b90
Normal file
BIN
fuzz/session_corpus/7f4f3e0d908bd50e1d7d24385dfd84c884de5b90
Normal file
Binary file not shown.
BIN
fuzz/session_corpus/85148da46a55127eceb9d5b685660f235561ba18
Normal file
BIN
fuzz/session_corpus/85148da46a55127eceb9d5b685660f235561ba18
Normal file
Binary file not shown.
BIN
fuzz/session_corpus/91fc38244f91d59cee8d704ec12a1adb0ea21f72
Normal file
BIN
fuzz/session_corpus/91fc38244f91d59cee8d704ec12a1adb0ea21f72
Normal file
Binary file not shown.
BIN
fuzz/session_corpus/9a86a2adec5181b4f82bc38a65490717ebc8e0fe
Normal file
BIN
fuzz/session_corpus/9a86a2adec5181b4f82bc38a65490717ebc8e0fe
Normal file
Binary file not shown.
BIN
fuzz/session_corpus/9f7d1b28f7924e39dce343b92e9f29eaf1098c97
Normal file
BIN
fuzz/session_corpus/9f7d1b28f7924e39dce343b92e9f29eaf1098c97
Normal file
Binary file not shown.
BIN
fuzz/session_corpus/a9124782234bbe9d6e9e3ee7b1a76cc432c68ee0
Normal file
BIN
fuzz/session_corpus/a9124782234bbe9d6e9e3ee7b1a76cc432c68ee0
Normal file
Binary file not shown.
BIN
fuzz/session_corpus/ded78b6ea86efd8bf76e734212765812d93b382f
Normal file
BIN
fuzz/session_corpus/ded78b6ea86efd8bf76e734212765812d93b382f
Normal file
Binary file not shown.
BIN
fuzz/session_corpus/e0c7b00c5a8bded3c2e5e086c0fb3450a5801323
Normal file
BIN
fuzz/session_corpus/e0c7b00c5a8bded3c2e5e086c0fb3450a5801323
Normal file
Binary file not shown.
BIN
fuzz/session_corpus/ec1581705424e60415f9e35f9ed2260a08260052
Normal file
BIN
fuzz/session_corpus/ec1581705424e60415f9e35f9ed2260a08260052
Normal file
Binary file not shown.
BIN
fuzz/session_corpus/f81709f8352c89b0151dd7f14f3e113d42e737c9
Normal file
BIN
fuzz/session_corpus/f81709f8352c89b0151dd7f14f3e113d42e737c9
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user