diff options
Diffstat (limited to 'tests/tls-client-with-seccomp.c')
-rw-r--r-- | tests/tls-client-with-seccomp.c | 56 |
1 files changed, 26 insertions, 30 deletions
diff --git a/tests/tls-client-with-seccomp.c b/tests/tls-client-with-seccomp.c index a51df74c2f..0d04d71ba1 100644 --- a/tests/tls-client-with-seccomp.c +++ b/tests/tls-client-with-seccomp.c @@ -20,7 +20,7 @@ */ #ifdef HAVE_CONFIG_H -# include <config.h> +#include <config.h> #endif #include <stdio.h> @@ -35,19 +35,19 @@ int main(void) #else -# include <string.h> -# include <sys/types.h> -# include <netinet/in.h> -# include <sys/socket.h> -# include <sys/wait.h> -# include <arpa/inet.h> -# include <unistd.h> -# include <signal.h> -# include <gnutls/gnutls.h> -# include <gnutls/dtls.h> -# include <assert.h> -# include "cert-common.h" -# include "utils.h" +#include <string.h> +#include <sys/types.h> +#include <netinet/in.h> +#include <sys/socket.h> +#include <sys/wait.h> +#include <arpa/inet.h> +#include <unistd.h> +#include <signal.h> +#include <gnutls/gnutls.h> +#include <gnutls/dtls.h> +#include <assert.h> +#include "cert-common.h" +#include "utils.h" static void terminate(void); @@ -61,7 +61,7 @@ static void client_log_func(int level, const char *str) fprintf(stderr, "client|<%d>| %s", level, str); } -# define MAX_BUF 1024 +#define MAX_BUF 1024 static void client(int fd, const char *prio) { @@ -101,8 +101,7 @@ static void client(int fd, const char *prio) */ do { ret = gnutls_handshake(session); - } - while (ret < 0 && gnutls_error_is_fatal(ret) == 0); + } while (ret < 0 && gnutls_error_is_fatal(ret) == 0); if (ret < 0) { fail("client: Handshake failed\n"); @@ -115,8 +114,8 @@ static void client(int fd, const char *prio) if (debug) success("client: TLS version is: %s\n", - gnutls_protocol_get_name - (gnutls_protocol_get_version(session))); + gnutls_protocol_get_name( + gnutls_protocol_get_version(session))); do { ret = gnutls_record_recv(session, buffer, sizeof(buffer) - 1); @@ -137,7 +136,7 @@ static void client(int fd, const char *prio) gnutls_strerror(ret)); } - end: +end: close(fd); @@ -178,9 +177,8 @@ static void server(int fd, const char *prio) gnutls_certificate_allocate_credentials(&xcred); - ret = gnutls_certificate_set_x509_key_mem(xcred, - &server_cert, &server_key, - GNUTLS_X509_FMT_PEM); + ret = gnutls_certificate_set_x509_key_mem( + xcred, &server_cert, &server_key, GNUTLS_X509_FMT_PEM); if (ret < 0) exit(1); @@ -198,8 +196,7 @@ static void server(int fd, const char *prio) do { ret = gnutls_handshake(session); - } - while (ret < 0 && gnutls_error_is_fatal(ret) == 0); + } while (ret < 0 && gnutls_error_is_fatal(ret) == 0); if (ret < 0) { close(fd); gnutls_deinit(session); @@ -212,8 +209,8 @@ static void server(int fd, const char *prio) if (debug) success("server: TLS version is: %s\n", - gnutls_protocol_get_name - (gnutls_protocol_get_version(session))); + gnutls_protocol_get_name( + gnutls_protocol_get_version(session))); /* see the Getting peer's information example */ /* print_info(session); */ @@ -248,8 +245,7 @@ static void server(int fd, const char *prio) success("server: finished\n"); } -static -void run(const char *name, const char *prio) +static void run(const char *name, const char *prio) { int fd[2]; int ret; @@ -291,4 +287,4 @@ void doit(void) run("tls1.3", "NORMAL:-VERS-ALL:+VERS-TLS1.3"); run("default", "NORMAL"); } -#endif /* _WIN32 */ +#endif /* _WIN32 */ |