summaryrefslogtreecommitdiff
path: root/tests/openpgpself.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2010-12-16 17:30:42 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2010-12-16 17:30:42 +0100
commit6eb6bbfe8e504a611145f454f4045e8f49fd5e44 (patch)
treebaba850cc86ee2d9d61de89da1cdfe408ad8694a /tests/openpgpself.c
parentbdcfdac13179eccee6294402f2654fece149f82b (diff)
downloadgnutls-6eb6bbfe8e504a611145f454f4045e8f49fd5e44.tar.gz
Indented code. Use same indentation but with -nut to avoid usage of tabs. In several editors tabs can be configured not to be 8 spaces and this produces artifacts with the current indentation that is a mixture of tabs and spaces.
Diffstat (limited to 'tests/openpgpself.c')
-rw-r--r--tests/openpgpself.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/tests/openpgpself.c b/tests/openpgpself.c
index 3732d3b39f..e3f2c9ffd2 100644
--- a/tests/openpgpself.c
+++ b/tests/openpgpself.c
@@ -124,7 +124,7 @@ client (void)
success ("Setting key files...\n");
ret = gnutls_certificate_set_openpgp_key_mem (xcred, &cert, &key,
- GNUTLS_OPENPGP_FMT_BASE64);
+ GNUTLS_OPENPGP_FMT_BASE64);
if (ret < 0)
{
fail ("Could not set key files...\n");
@@ -166,8 +166,8 @@ client (void)
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)));
/* see the Getting peer's information example */
if (debug)
@@ -179,7 +179,7 @@ client (void)
if (ret == 0)
{
if (debug)
- success ("client: Peer has closed the TLS connection\n");
+ success ("client: Peer has closed the TLS connection\n");
goto end;
}
else if (ret < 0)
@@ -192,9 +192,9 @@ client (void)
{
printf ("- Received %d bytes: ", ret);
for (ii = 0; ii < ret; ii++)
- {
- fputc (buffer[ii], stdout);
- }
+ {
+ fputc (buffer[ii], stdout);
+ }
fputs ("\n", stdout);
}
@@ -216,7 +216,7 @@ end:
#define SA struct sockaddr
#define MAX_BUF 1024
-#define PORT 5556 /* listen to 5556 port */
+#define PORT 5556 /* listen to 5556 port */
#define DH_BITS 1024
/* These are global */
@@ -361,10 +361,10 @@ server_start (void)
memset (&sa_serv, '\0', sizeof (sa_serv));
sa_serv.sin_family = AF_INET;
sa_serv.sin_addr.s_addr = INADDR_ANY;
- sa_serv.sin_port = htons (PORT); /* Server Port number */
+ sa_serv.sin_port = htons (PORT); /* Server Port number */
setsockopt (listen_sd, SOL_SOCKET, SO_REUSEADDR, (void *) &optval,
- sizeof (int));
+ sizeof (int));
err = bind (listen_sd, (SA *) & sa_serv, sizeof (sa_serv));
if (err == -1)
@@ -400,8 +400,8 @@ server (void)
gnutls_certificate_allocate_credentials (&pgp_cred);
ret = gnutls_certificate_set_openpgp_key_mem2 (pgp_cred, &server_crt,
- &server_key, "auto",
- GNUTLS_OPENPGP_FMT_BASE64);
+ &server_key, "auto",
+ GNUTLS_OPENPGP_FMT_BASE64);
if (err < 0)
{
fail ("Could not set server key files...\n");
@@ -422,8 +422,8 @@ server (void)
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));
+ 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);
@@ -439,8 +439,8 @@ server (void)
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 */
if (debug)
@@ -453,22 +453,22 @@ server (void)
ret = gnutls_record_recv (session, buffer, MAX_BUF);
if (ret == 0)
- {
- if (debug)
- success ("server: Peer has closed the GnuTLS connection\n");
- break;
- }
+ {
+ if (debug)
+ success ("server: Peer has closed the GnuTLS connection\n");
+ break;
+ }
else if (ret < 0)
- {
- fail ("server: Received corrupted data(%d). Closing...\n", ret);
- break;
- }
+ {
+ fail ("server: Received corrupted data(%d). Closing...\n", ret);
+ break;
+ }
else if (ret > 0)
- {
- /* echo data back to the client
- */
- gnutls_record_send (session, buffer, strlen (buffer));
- }
+ {
+ /* echo data back to the client
+ */
+ gnutls_record_send (session, buffer, strlen (buffer));
+ }
}
/* do not wait for the peer to close the connection.
*/