]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
fuzzer: Move regression corpora from tests/ to fuzz/
authorTim Rühsen <tim.ruehsen@gmx.de>
Tue, 15 Aug 2017 10:34:25 +0000 (12:34 +0200)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Wed, 16 Aug 2017 07:52:12 +0000 (09:52 +0200)
See fuzz/README.md for the corresponding paths.

Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
21 files changed:
fuzz/gnutls_client_fuzzer.in/client-rsa-pss.raw [moved from tests/client-interesting/client-rsa-pss.raw with 100% similarity]
fuzz/gnutls_client_fuzzer.in/client1.raw [moved from tests/client-interesting/client1.raw with 100% similarity]
fuzz/gnutls_client_fuzzer.in/client2.raw [moved from tests/client-interesting/client2.raw with 100% similarity]
fuzz/gnutls_client_fuzzer.in/client3.disabled [moved from tests/client-interesting/client3.disabled with 100% similarity]
fuzz/gnutls_client_fuzzer.in/client3.raw [moved from tests/client-interesting/client3.raw with 100% similarity]
fuzz/gnutls_ocsp_resp_parser_fuzzer.in/1492.der [moved from tests/ocsp-resp-interesting/1492.der with 100% similarity]
fuzz/gnutls_pkcs7_parser_fuzzer.in/pkcs7-1.der [moved from tests/pkcs7-interesting/pkcs7-1.der with 100% similarity]
fuzz/gnutls_pkcs7_parser_fuzzer.in/pkcs7-1.der.err [moved from tests/pkcs7-interesting/pkcs7-1.der.err with 100% similarity]
fuzz/gnutls_pkcs7_parser_fuzzer.in/pkcs7-2.der [moved from tests/pkcs7-interesting/pkcs7-2.der with 100% similarity]
fuzz/gnutls_pkcs7_parser_fuzzer.in/pkcs7-2.der.err [moved from tests/pkcs7-interesting/pkcs7-2.der.err with 100% similarity]
fuzz/gnutls_psk_server_fuzzer.in/psk-server1.raw [moved from tests/psk-server-interesting/psk-server1.raw with 100% similarity]
fuzz/gnutls_server_fuzzer.in/server-interesting/server1.raw [moved from tests/server-interesting/server1.raw with 100% similarity]
fuzz/gnutls_srp_server_fuzzer.in/srp-server1.raw [moved from tests/srp-server-interesting/srp-server1.raw with 100% similarity]
tests/Makefile.am
tests/client.c [deleted file]
tests/ocsp-resp.c [deleted file]
tests/psk-client.c [deleted file]
tests/psk-server.c [deleted file]
tests/server.c [deleted file]
tests/srp-client.c [deleted file]
tests/srp-server.c [deleted file]

index e4e7097f16dad2eb5c9cd61a0007f4b8b3b3daf1..3e52cc5f041e6c488106ce2c6e1b68c0f7b0ceba 100644 (file)
@@ -43,20 +43,16 @@ EXTRA_DIST = suppressions.valgrind eagain-common.h cert-common.h test-chains.h \
        certs-interesting/cert3.der.err certs-interesting/cert4.der certs-interesting/cert5.der \
        certs-interesting/cert6.der certs-interesting/cert7.der certs-interesting/cert8.der \
        certs-interesting/cert9.der certs-interesting/cert5.der.err \
-       certs-interesting/cert3.der.err certs-interesting/cert4.der pkcs7-interesting/pkcs7-1.der \
-       pkcs7-interesting/pkcs7-1.der.err pkcs7-interesting/pkcs7-2.der pkcs7-interesting/pkcs7-2.der.err \
-       client-interesting/client1.raw client-interesting/client2.raw client-interesting/client3.disabled \
-       server-interesting/server1.raw scripts/common.sh scripts/starttls-common.sh \
-       psk-server-interesting/psk-server1.raw \
-       srp-server-interesting/srp-server1.raw \
-       client-interesting/client3.raw rng-op.c x509sign-verify-common.h common-key-tests.h \
+       certs-interesting/cert3.der.err certs-interesting/cert4.der \
+       scripts/common.sh scripts/starttls-common.sh \
+       rng-op.c x509sign-verify-common.h common-key-tests.h \
        ocsp-tests/certs/ca.key ocsp-tests/certs/ca.pem ocsp-tests/certs/ocsp-server.key ocsp-tests/certs/ocsp-server.pem ocsp-tests/response1.der \
        ocsp-tests/response2.der ocsp-tests/certs/ocsp_index.txt ocsp-tests/certs/ocsp_index.txt.attr \
        ocsp-tests/certs/server_good.key ocsp-tests/certs/server_bad.key ocsp-tests/certs/server_good.template \
        ocsp-tests/certs/server_bad.template ocsp-tests/certs/ocsp-staple-unrelated.der ocsp-tests/suppressions.valgrind \
        data/listings-DTLS1.0 data/listings-SSL3.0 data/listings-TLS1.0 data/listings-TLS1.1 \
        data/listings-SSL3.0-TLS1.1 p11-kit-trust-data/Example_Root_CA.p11-kit server-kx-neg-common.c \
-       p11-kit-trust-data/Example_Root_CA.pem ocsp-resp-interesting/1492.der
+       p11-kit-trust-data/Example_Root_CA.pem
 
 
 AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
@@ -98,8 +94,7 @@ ctests = mini-record-2 simple gc set_pkcs12_cred cert certuniqueid tls-neg-ext-k
         tls10-server-kx-neg tls11-server-kx-neg tls12-server-kx-neg ssl30-server-kx-neg \
         tls12-cipher-neg tls11-cipher-neg tls10-cipher-neg ssl30-cipher-neg \
         crq_apis init_roundtrip pkcs12_s2k_pem dn2 mini-eagain tls-rehandshake-cert-3 \
-        psk-server psk-client srp-server srp-client \
-        nul-in-x509-names x509_altname pkcs12_encode mini-x509 ocsp-resp \
+        nul-in-x509-names x509_altname pkcs12_encode mini-x509 \
         tls-rehandshake-cert rng-fork mini-eagain-dtls resume-dtls \
         x509cert x509cert-tl infoaccess mini-dtls-hello-verify sign-verify-ed25519-rfc8080 \
         trustdb-tofu dtls-rehandshake-anon mini-alpn mini-dtls-large \
@@ -361,8 +356,5 @@ endif
 
 if WANT_TEST_SUITE
 
-# These require the devel/fuzz directory which is not available on releases
-ctests += client server
-
 LOG_COMPILER = $(VALGRIND)
 endif
diff --git a/tests/client.c b/tests/client.c
deleted file mode 100644 (file)
index e284beb..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (C) 2016 Red Hat, Inc.
- * Copyright 2016 Alex Gaynor, Google Inc.
- *
- * Author: Nikos Mavrogiannopoulos, Alex Gaynor
- *
- * This file is part of GnuTLS.
- *
- * GnuTLS is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * GnuTLS is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GnuTLS; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <gnutls/gnutls.h>
-#include <gnutls/x509.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <limits.h>
-#include <dirent.h>
-
-#include "utils.h"
-
-#define true 1
-
-/* This program will load certificates from CERT_DIR and try to print
- * them. If CERT_DIR/certname.err is available, it should contain the
- * error code that gnutls_x509_crt_import() should return.
- */
-
-#define CERT_DIR "client-interesting"
-
-int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
-
-static int getnext(DIR **dirp, gnutls_datum_t *der)
-{
-       struct dirent *d;
-       char path[256];
-       char cert_dir[256];
-       const char *src;
-       int ret;
-
-       src = getenv("srcdir");
-       if (src == NULL)
-               src = ".";
-
-       snprintf(cert_dir, sizeof(cert_dir), "%s/%s", src, CERT_DIR);
-
-       if (*dirp == NULL) {
-               *dirp = opendir(cert_dir);
-               if (*dirp == NULL)
-                       return -1;
-       }
-
-       do {
-               d = readdir(*dirp);
-               if (d != NULL
-#ifdef _DIRENT_HAVE_D_TYPE
-                       && d->d_type == DT_REG
-#endif
-                       ) {
-                       if (strstr(d->d_name, ".raw") == 0)
-                               continue;
-                       snprintf(path, sizeof(path), "%s/%s", cert_dir, d->d_name);
-
-                       success("Loading %s\n", path);
-                       ret = gnutls_load_file(path, der);
-                       if (ret < 0) {
-                               return -1;
-                       }
-
-                       return 0;
-               }
-       } while(d != NULL);
-
-       closedir(*dirp);
-       return -1; /* finished */
-}
-
-#include "../devel/fuzz/gnutls_client_fuzzer.cc"
-
-void doit(void)
-{
-       int ret;
-       gnutls_datum_t raw;
-       DIR *dirp = NULL;
-
-       ret = global_init();
-       if (ret < 0)
-               fail("init %d\n", ret);
-
-       while (getnext(&dirp, &raw)==0) {
-               LLVMFuzzerTestOneInput(raw.data, raw.size);
-               gnutls_free(raw.data);
-               raw.data = NULL;
-               raw.size = 0;
-       }
-
-       gnutls_global_deinit();
-}
diff --git a/tests/ocsp-resp.c b/tests/ocsp-resp.c
deleted file mode 100644 (file)
index a5d3a06..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (C) 2017 Red Hat, Inc.
- *
- * Author: Nikos Mavrogiannopoulos
- *
- * This file is part of GnuTLS.
- *
- * GnuTLS is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * GnuTLS is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <gnutls/gnutls.h>
-#include <gnutls/ocsp.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <limits.h>
-#include <dirent.h>
-
-#include "utils.h"
-
-/* This program will load certificates from CERT_DIR and try to print
- * them. If CERT_DIR/certname.err is available, it should contain the
- * error code that gnutls_x509_crt_import() should return.
- */
-
-#define CERT_DIR "ocsp-resp-interesting"
-
-int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
-
-static int getnext(DIR **dirp, gnutls_datum_t *der)
-{
-       struct dirent *d;
-       char path[256];
-       char cert_dir[256];
-       const char *src;
-       int ret;
-
-       src = getenv("srcdir");
-       if (src == NULL)
-               src = ".";
-
-       snprintf(cert_dir, sizeof(cert_dir), "%s/%s", src, CERT_DIR);
-
-       if (*dirp == NULL) {
-               *dirp = opendir(cert_dir);
-               if (*dirp == NULL)
-                       return -1;
-       }
-
-       do {
-               d = readdir(*dirp);
-               if (d != NULL
-#ifdef _DIRENT_HAVE_D_TYPE
-                       && d->d_type == DT_REG
-#endif
-                       ) {
-                       if (strstr(d->d_name, ".der") == 0)
-                               continue;
-                       snprintf(path, sizeof(path), "%s/%s", cert_dir, d->d_name);
-
-                       success("Loading %s\n", path);
-                       ret = gnutls_load_file(path, der);
-                       if (ret < 0) {
-                               return -1;
-                       }
-
-                       return 0;
-               }
-       } while(d != NULL);
-
-       closedir(*dirp);
-       return -1; /* finished */
-}
-
-#include "../devel/fuzz/gnutls_ocsp_resp_parser_fuzzer.cc"
-
-void doit(void)
-{
-       int ret;
-       gnutls_datum_t raw;
-       DIR *dirp = NULL;
-
-       ret = global_init();
-       if (ret < 0)
-               fail("init %d\n", ret);
-
-       while (getnext(&dirp, &raw)==0) {
-               LLVMFuzzerTestOneInput(raw.data, raw.size);
-               gnutls_free(raw.data);
-               raw.data = NULL;
-               raw.size = 0;
-       }
-
-       gnutls_global_deinit();
-}
diff --git a/tests/psk-client.c b/tests/psk-client.c
deleted file mode 100644 (file)
index 3622f72..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (C) 2016 Red Hat, Inc.
- * Copyright 2016 Alex Gaynor, Google Inc.
- *
- * Author: Nikos Mavrogiannopoulos, Alex Gaynor
- *
- * This file is part of GnuTLS.
- *
- * GnuTLS is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * GnuTLS is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GnuTLS; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <gnutls/gnutls.h>
-#include <gnutls/x509.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <limits.h>
-#include <dirent.h>
-
-#include "utils.h"
-
-#define true 1
-
-/* This program will load certificates from CERT_DIR and try to print
- * them. If CERT_DIR/certname.err is available, it should contain the
- * error code that gnutls_x509_crt_import() should return.
- */
-
-#define CERT_DIR "psk-client-interesting"
-
-int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
-
-static int getnext(DIR **dirp, gnutls_datum_t *der)
-{
-       struct dirent *d;
-       char path[256];
-       char cert_dir[256];
-       const char *src;
-       int ret;
-
-       src = getenv("srcdir");
-       if (src == NULL)
-               src = ".";
-
-       snprintf(cert_dir, sizeof(cert_dir), "%s/%s", src, CERT_DIR);
-
-       if (*dirp == NULL) {
-               *dirp = opendir(cert_dir);
-               if (*dirp == NULL)
-                       return -1;
-       }
-
-       do {
-               d = readdir(*dirp);
-               if (d != NULL
-#ifdef _DIRENT_HAVE_D_TYPE
-                       && d->d_type == DT_REG
-#endif
-                       ) {
-                       if (strstr(d->d_name, ".raw") == 0)
-                               continue;
-                       snprintf(path, sizeof(path), "%s/%s", cert_dir, d->d_name);
-
-                       success("Loading %s\n", path);
-                       ret = gnutls_load_file(path, der);
-                       if (ret < 0) {
-                               return -1;
-                       }
-
-                       return 0;
-               }
-       } while(d != NULL);
-
-       closedir(*dirp);
-       return -1; /* finished */
-}
-
-#include "../devel/fuzz/gnutls_psk_client_fuzzer.cc"
-
-void doit(void)
-{
-       int ret;
-       gnutls_datum_t raw;
-       DIR *dirp = NULL;
-
-       ret = global_init();
-       if (ret < 0)
-               fail("init %d\n", ret);
-
-       while (getnext(&dirp, &raw)==0) {
-               LLVMFuzzerTestOneInput(raw.data, raw.size);
-               gnutls_free(raw.data);
-               raw.data = NULL;
-               raw.size = 0;
-       }
-
-       gnutls_global_deinit();
-}
diff --git a/tests/psk-server.c b/tests/psk-server.c
deleted file mode 100644 (file)
index 375a629..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (C) 2016 Red Hat, Inc.
- * Copyright 2016 Alex Gaynor, Google Inc.
- *
- * Author: Nikos Mavrogiannopoulos, Alex Gaynor
- *
- * This file is part of GnuTLS.
- *
- * GnuTLS is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * GnuTLS is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GnuTLS; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <gnutls/gnutls.h>
-#include <gnutls/x509.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <limits.h>
-#include <dirent.h>
-
-#include "utils.h"
-
-#define true 1
-
-/* This program will load certificates from CERT_DIR and try to print
- * them. If CERT_DIR/certname.err is available, it should contain the
- * error code that gnutls_x509_crt_import() should return.
- */
-
-#define CERT_DIR "psk-server-interesting"
-
-int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
-
-static int getnext(DIR **dirp, gnutls_datum_t *der)
-{
-       struct dirent *d;
-       char path[256];
-       char cert_dir[256];
-       const char *src;
-       int ret;
-
-       src = getenv("srcdir");
-       if (src == NULL)
-               src = ".";
-
-       snprintf(cert_dir, sizeof(cert_dir), "%s/%s", src, CERT_DIR);
-
-       if (*dirp == NULL) {
-               *dirp = opendir(cert_dir);
-               if (*dirp == NULL)
-                       return -1;
-       }
-
-       do {
-               d = readdir(*dirp);
-               if (d != NULL
-#ifdef _DIRENT_HAVE_D_TYPE
-                       && d->d_type == DT_REG
-#endif
-                       ) {
-                       if (strstr(d->d_name, ".raw") == 0)
-                               continue;
-                       snprintf(path, sizeof(path), "%s/%s", cert_dir, d->d_name);
-
-                       success("Loading %s\n", path);
-                       ret = gnutls_load_file(path, der);
-                       if (ret < 0) {
-                               return -1;
-                       }
-
-                       return 0;
-               }
-       } while(d != NULL);
-
-       closedir(*dirp);
-       return -1; /* finished */
-}
-
-#include "../devel/fuzz/gnutls_psk_server_fuzzer.cc"
-
-void doit(void)
-{
-       int ret;
-       gnutls_datum_t raw;
-       DIR *dirp = NULL;
-
-       ret = global_init();
-       if (ret < 0)
-               fail("init %d\n", ret);
-
-       while (getnext(&dirp, &raw)==0) {
-               LLVMFuzzerTestOneInput(raw.data, raw.size);
-               gnutls_free(raw.data);
-               raw.data = NULL;
-               raw.size = 0;
-       }
-
-       gnutls_global_deinit();
-}
diff --git a/tests/server.c b/tests/server.c
deleted file mode 100644 (file)
index 4067bb8..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (C) 2016 Red Hat, Inc.
- * Copyright 2016 Alex Gaynor, Google Inc.
- *
- * Author: Nikos Mavrogiannopoulos, Alex Gaynor
- *
- * This file is part of GnuTLS.
- *
- * GnuTLS is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * GnuTLS is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GnuTLS; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <gnutls/gnutls.h>
-#include <gnutls/x509.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <limits.h>
-#include <dirent.h>
-
-#include "utils.h"
-
-#define true 1
-
-/* This program will load certificates from CERT_DIR and try to print
- * them. If CERT_DIR/certname.err is available, it should contain the
- * error code that gnutls_x509_crt_import() should return.
- */
-
-#define CERT_DIR "server-interesting"
-
-int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
-
-static int getnext(DIR **dirp, gnutls_datum_t *der)
-{
-       struct dirent *d;
-       char path[256];
-       char cert_dir[256];
-       const char *src;
-       int ret;
-
-       src = getenv("srcdir");
-       if (src == NULL)
-               src = ".";
-
-       snprintf(cert_dir, sizeof(cert_dir), "%s/%s", src, CERT_DIR);
-
-       if (*dirp == NULL) {
-               *dirp = opendir(cert_dir);
-               if (*dirp == NULL)
-                       return -1;
-       }
-
-       do {
-               d = readdir(*dirp);
-               if (d != NULL
-#ifdef _DIRENT_HAVE_D_TYPE
-                       && d->d_type == DT_REG
-#endif
-                       ) {
-                       if (strstr(d->d_name, ".raw") == 0)
-                               continue;
-                       snprintf(path, sizeof(path), "%s/%s", cert_dir, d->d_name);
-
-                       success("Loading %s\n", path);
-                       ret = gnutls_load_file(path, der);
-                       if (ret < 0) {
-                               return -1;
-                       }
-
-                       return 0;
-               }
-       } while(d != NULL);
-
-       closedir(*dirp);
-       return -1; /* finished */
-}
-
-#include "../devel/fuzz/gnutls_server_fuzzer.cc"
-
-void doit(void)
-{
-       int ret;
-       gnutls_datum_t raw;
-       DIR *dirp = NULL;
-
-       ret = global_init();
-       if (ret < 0)
-               fail("init %d\n", ret);
-
-       while (getnext(&dirp, &raw)==0) {
-               LLVMFuzzerTestOneInput(raw.data, raw.size);
-               gnutls_free(raw.data);
-               raw.data = NULL;
-               raw.size = 0;
-       }
-
-       gnutls_global_deinit();
-}
diff --git a/tests/srp-client.c b/tests/srp-client.c
deleted file mode 100644 (file)
index d4a3f6c..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (C) 2016 Red Hat, Inc.
- * Copyright 2016 Alex Gaynor, Google Inc.
- *
- * Author: Nikos Mavrogiannopoulos, Alex Gaynor
- *
- * This file is part of GnuTLS.
- *
- * GnuTLS is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * GnuTLS is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GnuTLS; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <gnutls/gnutls.h>
-#include <gnutls/x509.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <limits.h>
-#include <dirent.h>
-
-#include "utils.h"
-
-#define true 1
-
-/* This program will load certificates from CERT_DIR and try to print
- * them. If CERT_DIR/certname.err is available, it should contain the
- * error code that gnutls_x509_crt_import() should return.
- */
-
-#define CERT_DIR "srp-client-interesting"
-
-int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
-
-static int getnext(DIR **dirp, gnutls_datum_t *der)
-{
-       struct dirent *d;
-       char path[256];
-       char cert_dir[256];
-       const char *src;
-       int ret;
-
-       src = getenv("srcdir");
-       if (src == NULL)
-               src = ".";
-
-       snprintf(cert_dir, sizeof(cert_dir), "%s/%s", src, CERT_DIR);
-
-       if (*dirp == NULL) {
-               *dirp = opendir(cert_dir);
-               if (*dirp == NULL)
-                       return -1;
-       }
-
-       do {
-               d = readdir(*dirp);
-               if (d != NULL
-#ifdef _DIRENT_HAVE_D_TYPE
-                       && d->d_type == DT_REG
-#endif
-                       ) {
-                       if (strstr(d->d_name, ".raw") == 0)
-                               continue;
-                       snprintf(path, sizeof(path), "%s/%s", cert_dir, d->d_name);
-
-                       success("Loading %s\n", path);
-                       ret = gnutls_load_file(path, der);
-                       if (ret < 0) {
-                               return -1;
-                       }
-
-                       return 0;
-               }
-       } while(d != NULL);
-
-       closedir(*dirp);
-       return -1; /* finished */
-}
-
-#include "../devel/fuzz/gnutls_srp_client_fuzzer.cc"
-
-void doit(void)
-{
-       int ret;
-       gnutls_datum_t raw;
-       DIR *dirp = NULL;
-
-       ret = global_init();
-       if (ret < 0)
-               fail("init %d\n", ret);
-
-       while (getnext(&dirp, &raw)==0) {
-               LLVMFuzzerTestOneInput(raw.data, raw.size);
-               gnutls_free(raw.data);
-               raw.data = NULL;
-               raw.size = 0;
-       }
-
-       gnutls_global_deinit();
-}
diff --git a/tests/srp-server.c b/tests/srp-server.c
deleted file mode 100644 (file)
index 90dbce4..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (C) 2016 Red Hat, Inc.
- * Copyright 2016 Alex Gaynor, Google Inc.
- *
- * Author: Nikos Mavrogiannopoulos, Alex Gaynor
- *
- * This file is part of GnuTLS.
- *
- * GnuTLS is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * GnuTLS is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GnuTLS; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <gnutls/gnutls.h>
-#include <gnutls/x509.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <limits.h>
-#include <dirent.h>
-
-#include "utils.h"
-
-#define true 1
-
-/* This program will load certificates from CERT_DIR and try to print
- * them. If CERT_DIR/certname.err is available, it should contain the
- * error code that gnutls_x509_crt_import() should return.
- */
-
-#define CERT_DIR "srp-server-interesting"
-
-int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
-
-static int getnext(DIR **dirp, gnutls_datum_t *der)
-{
-       struct dirent *d;
-       char path[256];
-       char cert_dir[256];
-       const char *src;
-       int ret;
-
-       src = getenv("srcdir");
-       if (src == NULL)
-               src = ".";
-
-       snprintf(cert_dir, sizeof(cert_dir), "%s/%s", src, CERT_DIR);
-
-       if (*dirp == NULL) {
-               *dirp = opendir(cert_dir);
-               if (*dirp == NULL)
-                       return -1;
-       }
-
-       do {
-               d = readdir(*dirp);
-               if (d != NULL
-#ifdef _DIRENT_HAVE_D_TYPE
-                       && d->d_type == DT_REG
-#endif
-                       ) {
-                       if (strstr(d->d_name, ".raw") == 0)
-                               continue;
-                       snprintf(path, sizeof(path), "%s/%s", cert_dir, d->d_name);
-
-                       success("Loading %s\n", path);
-                       ret = gnutls_load_file(path, der);
-                       if (ret < 0) {
-                               return -1;
-                       }
-
-                       return 0;
-               }
-       } while(d != NULL);
-
-       closedir(*dirp);
-       return -1; /* finished */
-}
-
-#include "../devel/fuzz/gnutls_srp_server_fuzzer.cc"
-
-void doit(void)
-{
-       int ret;
-       gnutls_datum_t raw;
-       DIR *dirp = NULL;
-
-       ret = global_init();
-       if (ret < 0)
-               fail("init %d\n", ret);
-
-       while (getnext(&dirp, &raw)==0) {
-               LLVMFuzzerTestOneInput(raw.data, raw.size);
-               gnutls_free(raw.data);
-               raw.data = NULL;
-               raw.size = 0;
-       }
-
-       gnutls_global_deinit();
-}