diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2019-06-07 16:39:53 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2019-07-03 20:58:45 +0200 |
commit | 5f160198adad3c5b2f2c50a42f4643138945f264 (patch) | |
tree | d5b1dcac0827befcf97054d17d976786ad3c726b | |
parent | 3bc136c2cc99236cc91394ac4aed7b3e5087d284 (diff) | |
download | gnutls-5f160198adad3c5b2f2c50a42f4643138945f264.tar.gz |
status-request-ext: run under all TLS versions
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rw-r--r-- | tests/status-request-ext.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/tests/status-request-ext.c b/tests/status-request-ext.c index d5d7b9922f..495e08a197 100644 --- a/tests/status-request-ext.c +++ b/tests/status-request-ext.c @@ -155,7 +155,7 @@ static int handshake_callback(gnutls_session_t session, unsigned int htype, #define MAX_BUF 1024 -static void client(int fd) +static void client(int fd, const char *prio) { int ret; gnutls_certificate_credentials_t x509_cred; @@ -176,7 +176,7 @@ static void client(int fd) gnutls_init(&session, GNUTLS_CLIENT); /* Use default priorities */ - gnutls_priority_set_direct(session, "NORMAL:-KX-ALL:+ECDHE-RSA", NULL); + gnutls_priority_set_direct(session, prio, NULL); /* put the anonymous credentials to the current session */ @@ -222,7 +222,7 @@ static void client(int fd) } -static void server(int fd) +static void server(int fd, const char *prio) { int ret; char buffer[MAX_BUF + 1]; @@ -253,7 +253,7 @@ static void server(int fd) /* avoid calling all the priority functions, since the defaults * are adequate. */ - gnutls_priority_set_direct(session, "NORMAL", NULL); + gnutls_priority_set_direct(session, prio, NULL); gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, x509_cred); @@ -297,7 +297,7 @@ static void ch_handler(int sig) return; } -void doit(void) +static void start(const char *name, const char *prio) { pid_t child; int fd[2]; @@ -306,6 +306,8 @@ void doit(void) signal(SIGCHLD, ch_handler); signal(SIGPIPE, SIG_IGN); + success("running: %s\n", name); + ret = socketpair(AF_UNIX, SOCK_STREAM, 0, fd); if (ret < 0) { perror("socketpair"); @@ -322,14 +324,21 @@ void doit(void) if (child) { /* parent */ close(fd[1]); - server(fd[0]); + server(fd[0], prio); waitpid(child, &status, 0); check_wait_status(status); } else { close(fd[0]); - client(fd[1]); + client(fd[1], prio); exit(0); } } +void doit(void) +{ + start("tls1.2", "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2"); + start("tls1.3", "NORMAL:-VERS-TLS-ALL:+VERS-TLS1.3"); + start("default", "NORMAL"); +} + #endif /* _WIN32 */ |