summaryrefslogtreecommitdiff
path: root/tests/dhepskself.c
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2010-04-14 14:51:01 +0200
committerSimon Josefsson <simon@josefsson.org>2010-04-14 14:51:01 +0200
commita23f37448755d89924f791999432b76f490cb2bf (patch)
tree188c331f124e69d62fc7e9be2d8d5cab90469b24 /tests/dhepskself.c
parent705aa8cd3da09abedd6eb5d0d55610b644e4f98d (diff)
downloadgnutls-a23f37448755d89924f791999432b76f490cb2bf.tar.gz
Indent code.
Diffstat (limited to 'tests/dhepskself.c')
-rw-r--r--tests/dhepskself.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/tests/dhepskself.c b/tests/dhepskself.c
index d3493f2d8a..5b65119174 100644
--- a/tests/dhepskself.c
+++ b/tests/dhepskself.c
@@ -102,7 +102,8 @@ client (void)
}
else
{
- if (debug) success ("client: Handshake was completed\n");
+ if (debug)
+ success ("client: Handshake was completed\n");
}
gnutls_record_send (session, MSG, strlen (MSG));
@@ -110,7 +111,8 @@ client (void)
ret = gnutls_record_recv (session, buffer, MAX_BUF);
if (ret == 0)
{
- if (debug) success ("client: Peer has closed the TLS connection\n");
+ if (debug)
+ success ("client: Peer has closed the TLS connection\n");
goto end;
}
else if (ret < 0)
@@ -123,7 +125,7 @@ client (void)
{
printf ("- Received %d bytes: ", ret);
for (ii = 0; ii < ret; ii++)
- fputc (buffer[ii], stdout);
+ fputc (buffer[ii], stdout);
fputs ("\n", stdout);
}
@@ -185,7 +187,8 @@ generate_dh_params (void)
static int
pskfunc (gnutls_session_t session, const char *username, gnutls_datum_t * key)
{
- if (debug) printf ("psk callback to get %s's password\n", username);
+ if (debug)
+ printf ("psk callback to get %s's password\n", username);
key->data = gnutls_malloc (4);
key->data[0] = 0xDE;
key->data[1] = 0xAD;
@@ -208,7 +211,8 @@ int optval = 1;
static void
server_start (void)
{
- if (debug) success ("Launched, generating DH parameters...\n");
+ if (debug)
+ success ("Launched, generating DH parameters...\n");
/* Socket operations
*/
@@ -244,7 +248,8 @@ server_start (void)
return;
}
- if (debug) success ("server: ready. Listening to port '%d'.\n", PORT);
+ if (debug)
+ success ("server: ready. Listening to port '%d'.\n", PORT);
}
static void
@@ -270,9 +275,10 @@ server (void)
sd = accept (listen_sd, (SA *) & sa_cli, &client_len);
- if (debug) success ("server: connection from %s, port %d\n",
- inet_ntop (AF_INET, &sa_cli.sin_addr, topbuf,
- sizeof (topbuf)), ntohs (sa_cli.sin_port));
+ if (debug)
+ success ("server: connection from %s, port %d\n",
+ inet_ntop (AF_INET, &sa_cli.sin_addr, topbuf,
+ sizeof (topbuf)), ntohs (sa_cli.sin_port));
gnutls_transport_set_ptr (session, (gnutls_transport_ptr_t) sd);
ret = gnutls_handshake (session);
@@ -283,7 +289,8 @@ server (void)
fail ("server: Handshake has failed (%s)\n\n", gnutls_strerror (ret));
return;
}
- if (debug) success ("server: Handshake was completed\n");
+ if (debug)
+ success ("server: Handshake was completed\n");
/* see the Getting peer's information example */
/* print_info(session); */
@@ -296,7 +303,8 @@ server (void)
if (ret == 0)
{
- if (debug) success ("server: Peer has closed the GNUTLS connection\n");
+ if (debug)
+ success ("server: Peer has closed the GNUTLS connection\n");
break;
}
else if (ret < 0)
@@ -326,7 +334,8 @@ server (void)
gnutls_global_deinit ();
- if (debug) success ("server: finished\n");
+ if (debug)
+ success ("server: finished\n");
}
void