|
Packit Service |
4684c1 |
/*
|
|
Packit Service |
4684c1 |
* Copyright (C) 2017 Red Hat, Inc.
|
|
Packit Service |
4684c1 |
*
|
|
Packit Service |
4684c1 |
* Author: Nikos Mavrogiannopoulos
|
|
Packit Service |
4684c1 |
*
|
|
Packit Service |
4684c1 |
* This file is part of GnuTLS.
|
|
Packit Service |
4684c1 |
*
|
|
Packit Service |
4684c1 |
* GnuTLS is free software; you can redistribute it and/or modify it
|
|
Packit Service |
4684c1 |
* under the terms of the GNU General Public License as published by
|
|
Packit Service |
4684c1 |
* the Free Software Foundation; either version 3 of the License, or
|
|
Packit Service |
4684c1 |
* (at your option) any later version.
|
|
Packit Service |
4684c1 |
*
|
|
Packit Service |
4684c1 |
* GnuTLS is distributed in the hope that it will be useful, but
|
|
Packit Service |
4684c1 |
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
4684c1 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
4684c1 |
* General Public License for more details.
|
|
Packit Service |
4684c1 |
*
|
|
Packit Service |
4684c1 |
* You should have received a copy of the GNU Lesser General Public License
|
|
Packit Service |
4684c1 |
* along with this program. If not, see <https://www.gnu.org/licenses/>
|
|
Packit Service |
4684c1 |
*/
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
#ifdef HAVE_CONFIG_H
|
|
Packit Service |
4684c1 |
#include <config.h>
|
|
Packit Service |
4684c1 |
#endif
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
/* This program tests the ciphersuite negotiation for various key exchange
|
|
Packit Service |
4684c1 |
* methods and options. */
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
#include <stdio.h>
|
|
Packit Service |
4684c1 |
#include <stdlib.h>
|
|
Packit Service |
4684c1 |
#include <string.h>
|
|
Packit Service |
4684c1 |
#include <errno.h>
|
|
Packit Service |
4684c1 |
#include <gnutls/gnutls.h>
|
|
Packit Service |
4684c1 |
#include "utils.h"
|
|
Packit Service |
4684c1 |
#include "cert-common.h"
|
|
Packit Service |
4684c1 |
#include "eagain-common.h"
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
#include "cipher-neg-common.c"
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
test_case_st tests[] = {
|
|
Packit Service |
4684c1 |
{
|
|
Packit Service |
4684c1 |
.name = "server SSL 3.0: AES-128-CBC (server)",
|
|
Packit Service |
4684c1 |
.cipher = GNUTLS_CIPHER_AES_128_CBC,
|
|
Packit Service |
4684c1 |
.server_prio = "NORMAL:-CIPHER-ALL:+AES-128-CBC:+CIPHER-ALL:-VERS-ALL:+VERS-SSL3.0:%SERVER_PRECEDENCE",
|
|
Packit Service |
4684c1 |
.client_prio = "NORMAL:+VERS-SSL3.0:+AES-128-CBC"
|
|
Packit Service |
4684c1 |
},
|
|
Packit Service |
4684c1 |
{
|
|
Packit Service |
4684c1 |
.name = "both SSL 3.0: AES-128-CBC (server)",
|
|
Packit Service |
4684c1 |
.cipher = GNUTLS_CIPHER_AES_128_CBC,
|
|
Packit Service |
4684c1 |
.server_prio = "NORMAL:-CIPHER-ALL:+AES-128-CBC:+CIPHER-ALL:-VERS-ALL:+VERS-SSL3.0:%SERVER_PRECEDENCE",
|
|
Packit Service |
4684c1 |
.client_prio = "NORMAL:+AES-128-CBC:+VERS-SSL3.0"
|
|
Packit Service |
4684c1 |
},
|
|
Packit Service |
4684c1 |
{
|
|
Packit Service |
4684c1 |
.name = "client SSL 3.0: AES-128-CBC (client)",
|
|
Packit Service |
4684c1 |
.cipher = GNUTLS_CIPHER_AES_128_CBC,
|
|
Packit Service |
4684c1 |
.server_prio = "NORMAL:+VERS-SSL3.0:+AES-128-CBC",
|
|
Packit Service |
4684c1 |
.client_prio = "NORMAL:-CIPHER-ALL:+AES-128-CBC:+CIPHER-ALL:-VERS-ALL:+VERS-SSL3.0"
|
|
Packit Service |
4684c1 |
},
|
|
Packit Service |
4684c1 |
{
|
|
Packit Service |
4684c1 |
.name = "both SSL 3.0: AES-128-CBC (client)",
|
|
Packit Service |
4684c1 |
.cipher = GNUTLS_CIPHER_AES_128_CBC,
|
|
Packit Service |
4684c1 |
.server_prio = "NORMAL:+AES-128-CBC:+VERS-SSL3.0",
|
|
Packit Service |
4684c1 |
.client_prio = "NORMAL:-CIPHER-ALL:+AES-128-CBC:+CIPHER-ALL:-VERS-ALL:+VERS-SSL3.0"
|
|
Packit Service |
4684c1 |
},
|
|
Packit Service |
4684c1 |
{
|
|
Packit Service |
4684c1 |
.name = "server SSL 3.0: 3DES-CBC (server)",
|
|
Packit Service |
4684c1 |
.cipher = GNUTLS_CIPHER_3DES_CBC,
|
|
Packit Service |
4684c1 |
.server_prio = "NORMAL:-CIPHER-ALL:+3DES-CBC:+CIPHER-ALL:-VERS-ALL:+VERS-SSL3.0:%SERVER_PRECEDENCE",
|
|
Packit Service |
4684c1 |
.client_prio = "NORMAL:+VERS-SSL3.0:+3DES-CBC"
|
|
Packit Service |
4684c1 |
},
|
|
Packit Service |
4684c1 |
{
|
|
Packit Service |
4684c1 |
.name = "both SSL 3.0: 3DES-CBC (server)",
|
|
Packit Service |
4684c1 |
.cipher = GNUTLS_CIPHER_3DES_CBC,
|
|
Packit Service |
4684c1 |
.server_prio = "NORMAL:-CIPHER-ALL:+3DES-CBC:+CIPHER-ALL:-VERS-ALL:+VERS-SSL3.0:%SERVER_PRECEDENCE",
|
|
Packit Service |
4684c1 |
.client_prio = "NORMAL:+3DES-CBC:+VERS-SSL3.0"
|
|
Packit Service |
4684c1 |
},
|
|
Packit Service |
4684c1 |
{
|
|
Packit Service |
4684c1 |
.name = "client SSL 3.0: 3DES-CBC (client)",
|
|
Packit Service |
4684c1 |
.cipher = GNUTLS_CIPHER_3DES_CBC,
|
|
Packit Service |
4684c1 |
.server_prio = "NORMAL:+VERS-SSL3.0:+3DES-CBC",
|
|
Packit Service |
4684c1 |
.client_prio = "NORMAL:-CIPHER-ALL:+3DES-CBC:+CIPHER-ALL:-VERS-ALL:+VERS-SSL3.0"
|
|
Packit Service |
4684c1 |
},
|
|
Packit Service |
4684c1 |
{
|
|
Packit Service |
4684c1 |
.name = "both SSL 3.0: 3DES-CBC (client)",
|
|
Packit Service |
4684c1 |
.cipher = GNUTLS_CIPHER_3DES_CBC,
|
|
Packit Service |
4684c1 |
.server_prio = "NORMAL:+3DES-CBC:+VERS-SSL3.0",
|
|
Packit Service |
4684c1 |
.client_prio = "NORMAL:-CIPHER-ALL:+3DES-CBC:+CIPHER-ALL:-VERS-ALL:+VERS-SSL3.0"
|
|
Packit Service |
4684c1 |
},
|
|
Packit Service |
4684c1 |
{
|
|
Packit Service |
4684c1 |
.name = "server SSL 3.0: ARCFOUR-128 (server)",
|
|
Packit Service |
4684c1 |
.cipher = GNUTLS_CIPHER_ARCFOUR_128,
|
|
Packit Service |
4684c1 |
.not_on_fips = 1,
|
|
Packit Service |
4684c1 |
.server_prio = "NORMAL:-CIPHER-ALL:+ARCFOUR-128:+CIPHER-ALL:-VERS-ALL:+VERS-SSL3.0:%SERVER_PRECEDENCE",
|
|
Packit Service |
4684c1 |
.client_prio = "NORMAL:+VERS-SSL3.0:+ARCFOUR-128"
|
|
Packit Service |
4684c1 |
},
|
|
Packit Service |
4684c1 |
{
|
|
Packit Service |
4684c1 |
.name = "both SSL 3.0: ARCFOUR-128 (server)",
|
|
Packit Service |
4684c1 |
.cipher = GNUTLS_CIPHER_ARCFOUR_128,
|
|
Packit Service |
4684c1 |
.not_on_fips = 1,
|
|
Packit Service |
4684c1 |
.server_prio = "NORMAL:-CIPHER-ALL:+ARCFOUR-128:+CIPHER-ALL:-VERS-ALL:+VERS-SSL3.0:%SERVER_PRECEDENCE",
|
|
Packit Service |
4684c1 |
.client_prio = "NORMAL:+ARCFOUR-128:+VERS-SSL3.0"
|
|
Packit Service |
4684c1 |
},
|
|
Packit Service |
4684c1 |
{
|
|
Packit Service |
4684c1 |
.name = "client SSL 3.0: ARCFOUR-128 (client)",
|
|
Packit Service |
4684c1 |
.cipher = GNUTLS_CIPHER_ARCFOUR_128,
|
|
Packit Service |
4684c1 |
.not_on_fips = 1,
|
|
Packit Service |
4684c1 |
.server_prio = "NORMAL:+VERS-SSL3.0:+ARCFOUR-128",
|
|
Packit Service |
4684c1 |
.client_prio = "NORMAL:-CIPHER-ALL:+ARCFOUR-128:+CIPHER-ALL:-VERS-ALL:+VERS-SSL3.0"
|
|
Packit Service |
4684c1 |
},
|
|
Packit Service |
4684c1 |
{
|
|
Packit Service |
4684c1 |
.name = "both SSL 3.0: ARCFOUR-128 (client)",
|
|
Packit Service |
4684c1 |
.cipher = GNUTLS_CIPHER_ARCFOUR_128,
|
|
Packit Service |
4684c1 |
.not_on_fips = 1,
|
|
Packit Service |
4684c1 |
.server_prio = "NORMAL:+ARCFOUR-128:+VERS-SSL3.0",
|
|
Packit Service |
4684c1 |
.client_prio = "NORMAL:-CIPHER-ALL:+ARCFOUR-128:+CIPHER-ALL:-VERS-ALL:+VERS-SSL3.0"
|
|
Packit Service |
4684c1 |
}
|
|
Packit Service |
4684c1 |
};
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
void doit(void)
|
|
Packit Service |
4684c1 |
{
|
|
Packit Service |
4684c1 |
(void) try;
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
#ifdef ENABLE_SSL3
|
|
Packit Service |
4684c1 |
unsigned i;
|
|
Packit Service |
4684c1 |
global_init();
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
for (i=0;i
|
|
Packit Service |
4684c1 |
try(&tests[i]);
|
|
Packit Service |
4684c1 |
}
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
gnutls_global_deinit();
|
|
Packit Service |
4684c1 |
#else
|
|
Packit Service |
4684c1 |
exit(77);
|
|
Packit Service |
4684c1 |
#endif
|
|
Packit Service |
4684c1 |
}
|