summaryrefslogtreecommitdiff
path: root/devel
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2017-01-04 09:42:25 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2017-01-04 13:41:48 +0100
commit438ceeb5dde7339d077cd232407c072f20f4d83d (patch)
tree33c6d7c6837fc0f69cb56dfc223abdf74489fed6 /devel
parentc9c189038d8a80b4e676479465ab75a3efd9a7ea (diff)
downloadgnutls-438ceeb5dde7339d077cd232407c072f20f4d83d.tar.gz
tests: added reproducer for server issues
This allows to reproduce issues found on server side, by adding a transcript in server-interesting. Currently it contains values found using oss-fuzz. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Diffstat (limited to 'devel')
-rw-r--r--devel/fuzz/README.md2
-rw-r--r--devel/fuzz/gnutls_server_fuzzer.cc6
2 files changed, 6 insertions, 2 deletions
diff --git a/devel/fuzz/README.md b/devel/fuzz/README.md
index 5471255e71..476fca09da 100644
--- a/devel/fuzz/README.md
+++ b/devel/fuzz/README.md
@@ -37,6 +37,7 @@ sufficient:
|---------------------------|-------------------------|
|gnutls_client_fuzzer | tests/client-interesting|
+|gnutls_server_fuzzer | tests/server-interesting|
|gnutls_pkcs7_parser_fuzzer | tests/pkcs7-interesting |
|gnutls_x509_parser_fuzzer | tests/certs-interesting |
|---------------------------|-------------------------|
@@ -49,5 +50,4 @@ table below.
|gnutls_openpgp_cert_parser_fuzzer|tests/cert-tests/openpgp-cert-parser |
|gnutls_pkcs8_key_parser_fuzzer |tests/key-tests/pkcs8-invalid,tests/key-tests/pkcs8-decode|
|gnutls_private_key_parser_fuzzer |tests/key-tests/key-invalid |
-|gnutls_server_fuzzer |none atm (should duplicate the client fuzzer) |
|---------------------------------|----------------------------------------------------------|
diff --git a/devel/fuzz/gnutls_server_fuzzer.cc b/devel/fuzz/gnutls_server_fuzzer.cc
index e864f10354..1d1f87d195 100644
--- a/devel/fuzz/gnutls_server_fuzzer.cc
+++ b/devel/fuzz/gnutls_server_fuzzer.cc
@@ -194,7 +194,11 @@ static const uint8_t kRSAPrivateKeyDER[] = {
0x98, 0x46, 0x89, 0x82, 0x40,
};
-extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
+#ifdef __cplusplus
+extern "C"
+#endif
+int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
+{
int res;
gnutls_datum_t cert, key;
gnutls_session_t session;