summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2013-11-22 22:55:32 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2013-11-22 22:55:44 +0100
commit77c2a440ebf7835af2445ed27a24d954d7d0a819 (patch)
tree9fed6350b409bd7a2eaf585249aeb9836154beb8
parenta5cb55e70f319aa337f50ed4d3c42f32d0a71b7b (diff)
downloadgnutls-77c2a440ebf7835af2445ed27a24d954d7d0a819.tar.gz
mini-deflate was combined with mini-record-2
-rw-r--r--tests/Makefile.am2
-rw-r--r--tests/mini-deflate.c138
-rw-r--r--tests/mini-record-2.c6
3 files changed, 7 insertions, 139 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 8b552a9d9b..ae0a45bd88 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -59,7 +59,7 @@ noinst_LTLIBRARIES = libutils.la
libutils_la_SOURCES = utils.h utils.c
libutils_la_LIBADD = ../gl/libgnu.la
-ctests = mini-deflate simple gc set_pkcs12_cred certder certuniqueid \
+ctests = simple gc set_pkcs12_cred certder certuniqueid \
mpi certificate_set_x509_crl dn parse_ca moredn record-sizes \
hostname-check cve-2008-4989 pkcs12_s2k chainverify record-sizes-range \
crq_key_id x509sign-verify cve-2009-1415 cve-2009-1416 \
diff --git a/tests/mini-deflate.c b/tests/mini-deflate.c
deleted file mode 100644
index 1307f100b1..0000000000
--- a/tests/mini-deflate.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (C) 2008-2012 Free Software Foundation, 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 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 <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <gnutls/gnutls.h>
-
-#ifdef HAVE_LIBZ
-
-#include "eagain-common.h"
-#include "utils.h"
-
-const char *side = "";
-
-static void tls_log_func(int level, const char *str)
-{
- fprintf(stderr, "%s|<%d>| %s", side, level, str);
-}
-
-#define MAX_BUF 6*1024
-#define MSG "Hello TLS, and Hello and Hello and Hello"
-
-void doit(void)
-{
- /* Server stuff. */
- gnutls_anon_server_credentials_t s_anoncred;
- const gnutls_datum_t p3 =
- { (unsigned char *) pkcs3, strlen(pkcs3) };
- static gnutls_dh_params_t dh_params;
- gnutls_session_t server;
- int sret = GNUTLS_E_AGAIN;
- /* Client stuff. */
- gnutls_anon_client_credentials_t c_anoncred;
- gnutls_session_t client;
- int cret = GNUTLS_E_AGAIN;
- /* Need to enable anonymous KX specifically. */
- char buffer[MAX_BUF + 1];
- ssize_t ns;
- int ret, transferred = 0, msglen;
- const char *str;
-
- /* General init. */
- global_init();
- gnutls_global_set_log_function(tls_log_func);
- if (debug)
- gnutls_global_set_log_level(4711);
-
- /* Init server */
- gnutls_anon_allocate_server_credentials(&s_anoncred);
- gnutls_dh_params_init(&dh_params);
- gnutls_dh_params_import_pkcs3(dh_params, &p3, GNUTLS_X509_FMT_PEM);
- gnutls_anon_set_server_dh_params(s_anoncred, dh_params);
- gnutls_init(&server, GNUTLS_SERVER);
- ret =
- gnutls_priority_set_direct(server,
- "NONE:+VERS-TLS-ALL:+AES-128-CBC:+MAC-ALL:+SIGN-ALL:+COMP-DEFLATE:+ANON-DH",
- &str);
- if (ret < 0) {
- fprintf(stderr, "error at: %s\n", str);
- exit(1);
- }
-
- gnutls_credentials_set(server, GNUTLS_CRD_ANON, s_anoncred);
- gnutls_transport_set_push_function(server, server_push);
- gnutls_transport_set_pull_function(server, server_pull);
- gnutls_transport_set_ptr(server, server);
-
- /* Init client */
- gnutls_anon_allocate_client_credentials(&c_anoncred);
- gnutls_init(&client, GNUTLS_CLIENT);
- ret =
- gnutls_priority_set_direct(client,
- "NONE:+VERS-TLS-ALL:+CIPHER-ALL:+MAC-ALL:+SIGN-ALL:+COMP-DEFLATE:+ANON-DH",
- &str);
- if (ret < 0) {
- fprintf(stderr, "error at: %s\n", str);
- exit(1);
- }
- gnutls_credentials_set(client, GNUTLS_CRD_ANON, c_anoncred);
- gnutls_transport_set_push_function(client, client_push);
- gnutls_transport_set_pull_function(client, client_pull);
- gnutls_transport_set_ptr(client, client);
-
- HANDSHAKE(client, server);
-
- if (debug)
- success("Handshake established\n");
-
- msglen = strlen(MSG);
- TRANSFER(client, server, MSG, msglen, buffer, MAX_BUF);
- if (debug)
- fputs("\n", stdout);
-
- gnutls_bye(client, GNUTLS_SHUT_RDWR);
- gnutls_bye(server, GNUTLS_SHUT_RDWR);
-
- gnutls_deinit(client);
- gnutls_deinit(server);
-
- gnutls_anon_free_client_credentials(c_anoncred);
- gnutls_anon_free_server_credentials(s_anoncred);
-
- gnutls_dh_params_deinit(dh_params);
-
- gnutls_global_deinit();
-}
-#else
-
-int main(int argc, char **argv)
-{
- return 77;
-}
-#endif
diff --git a/tests/mini-record-2.c b/tests/mini-record-2.c
index f531070baa..b6104b42fb 100644
--- a/tests/mini-record-2.c
+++ b/tests/mini-record-2.c
@@ -354,6 +354,9 @@ static void start(const char *prio, int ign)
#define NEW_AES_CBC_SHA256 "NONE:+VERS-TLS1.2:-CIPHER-ALL:+RSA:+AES-128-CBC:+AES-256-CBC:+SHA256:+SIGN-ALL:+COMP-NULL:+ANON-ECDH:+CURVE-ALL:%NEW_PADDING"
#define NEW_AES_GCM "NONE:+VERS-TLS1.2:-CIPHER-ALL:+RSA:+AES-128-GCM:+MAC-ALL:+SIGN-ALL:+COMP-NULL:+ANON-ECDH:+CURVE-ALL:%NEW_PADDING"
+#define ARCFOUR_SHA1_ZLIB "NONE:+VERS-TLS1.0:-CIPHER-ALL:+ARCFOUR-128:+SHA1:+SIGN-ALL:+COMP-DEFLATE:+ANON-ECDH:+CURVE-ALL"
+#define NEW_ARCFOUR_SHA1_ZLIB "NONE:+VERS-TLS1.0:-CIPHER-ALL:+ARCFOUR-128:+SHA1:+SIGN-ALL:+COMP-DEFLATE:+ANON-ECDH:+CURVE-ALL:%NEW_PADDING"
+
static void ch_handler(int sig)
{
int status;
@@ -387,6 +390,9 @@ void doit(void)
start(ARCFOUR_SHA1, 0);
start(ARCFOUR_MD5, 0);
+
+ start(ARCFOUR_SHA1_ZLIB, 0);
+ start(NEW_ARCFOUR_SHA1_ZLIB, 1);
}
#endif /* _WIN32 */