summaryrefslogtreecommitdiff
path: root/tests/long-session-id.c
diff options
context:
space:
mode:
authorZoltan Fridrich <zfridric@redhat.com>2023-01-27 15:03:53 +0100
committerZoltan Fridrich <zfridric@redhat.com>2023-01-27 15:11:28 +0100
commit50e0c39fc9b8e0ae493f42a3046db5e70f8ea044 (patch)
tree36d6eb0dde4d81527a07017d6df7d1dd4b7e436e /tests/long-session-id.c
parent21288eb0ce9d27f00c4f8ac8048b22f4003f65ac (diff)
downloadgnutls-50e0c39fc9b8e0ae493f42a3046db5e70f8ea044.tar.gz
Indent code
Co-authored-by: Simon Josefsson <simon@josefsson.org> Signed-off-by: Zoltan Fridrich <zfridric@redhat.com>
Diffstat (limited to 'tests/long-session-id.c')
-rw-r--r--tests/long-session-id.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/tests/long-session-id.c b/tests/long-session-id.c
index 01dea4de3e..86858bd780 100644
--- a/tests/long-session-id.c
+++ b/tests/long-session-id.c
@@ -20,7 +20,7 @@
*/
#ifdef HAVE_CONFIG_H
-#include <config.h>
+# include <config.h>
#endif
#include <stdio.h>
@@ -35,17 +35,17 @@ void doit(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 <gnutls/gnutls.h>
-#include <gnutls/dtls.h>
-#include <signal.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 <gnutls/gnutls.h>
+# include <gnutls/dtls.h>
+# include <signal.h>
+# include "utils.h"
/* This program tests the robustness of record
* decoding.
@@ -97,7 +97,6 @@ const gnutls_datum_t server_key = { server_key_pem,
sizeof(server_key_pem)
};
-
/* A very basic TLS client, with anonymous authentication.
*/
@@ -143,10 +142,13 @@ static void client(int fd, const char *prio)
}
if (ret == GNUTLS_E_RECEIVED_ILLEGAL_PARAMETER) {
- fprintf(stderr, "client: Handshake failed (expected): %s\n", gnutls_strerror(ret));
+ fprintf(stderr, "client: Handshake failed (expected): %s\n",
+ gnutls_strerror(ret));
goto cleanup;
} else {
- fprintf(stderr, "client: Handshake was completed or failed with unknown error code(%d): %s\n", ret, gnutls_strerror(ret));
+ fprintf(stderr,
+ "client: Handshake was completed or failed with unknown error code(%d): %s\n",
+ ret, gnutls_strerror(ret));
kill(getpid(), SIGSEGV);
}
@@ -160,7 +162,6 @@ static void client(int fd, const char *prio)
gnutls_global_deinit();
}
-
/* These are global */
pid_t child;
@@ -168,11 +169,10 @@ static void server(int fd, const char *prio)
{
int ret;
uint8_t id[255];
- uint8_t buffer[] = "\x16\x03\x01\x01\x25"
- "\x02\x00\x01\x21"
- "\x03\x01"/*Server Version */
- /*Random*/"\x00\x00\x00\x00\x01\x00\x00\x00\x00\x01\x00\x00\x00\x00\x01\x00\x00\x00\x00\x01\x00\x00\x00\x00\x01\x00\x00\x00\x00\x01\x00\x00"
- /*SessionID*/"\xfe";
+ uint8_t buffer[] = "\x16\x03\x01\x01\x25" "\x02\x00\x01\x21" "\x03\x01" /*Server Version */
+ /*Random */
+ "\x00\x00\x00\x00\x01\x00\x00\x00\x00\x01\x00\x00\x00\x00\x01\x00\x00\x00\x00\x01\x00\x00\x00\x00\x01\x00\x00\x00\x00\x01\x00\x00"
+ /*SessionID */ "\xfe";
ret = read(fd, id, sizeof(id));
if (ret < 0) {