summaryrefslogtreecommitdiff
path: root/doc/examples/ex-client-x509-3.1.c
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2023-04-24 12:39:42 +0900
committerDaiki Ueno <ueno@gnu.org>2023-04-24 12:45:46 +0900
commitaa5950abab56b011331ad4331409b6ff8efb8aeb (patch)
treead363fb38e8b65c942876641cda9c76caa13b498 /doc/examples/ex-client-x509-3.1.c
parent0fe9cb6842d63761718046cc7dd7eb437e6c5163 (diff)
downloadgnutls-aa5950abab56b011331ad4331409b6ff8efb8aeb.tar.gz
build: re-indent code
Signed-off-by: Daiki Ueno <ueno@gnu.org>
Diffstat (limited to 'doc/examples/ex-client-x509-3.1.c')
-rw-r--r--doc/examples/ex-client-x509-3.1.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/doc/examples/ex-client-x509-3.1.c b/doc/examples/ex-client-x509-3.1.c
index 891efb9c54..5a4501323e 100644
--- a/doc/examples/ex-client-x509-3.1.c
+++ b/doc/examples/ex-client-x509-3.1.c
@@ -1,7 +1,7 @@
/* This example code is placed in the public domain. */
#ifdef HAVE_CONFIG_H
-# include <config.h>
+#include <config.h>
#endif
#include <stdio.h>
@@ -17,12 +17,12 @@
* Note that error recovery is minimal for simplicity.
*/
-#define CHECK(x) assert((x)>=0)
-#define LOOP_CHECK(rval, cmd) \
- do { \
- rval = cmd; \
- } while(rval == GNUTLS_E_AGAIN || rval == GNUTLS_E_INTERRUPTED); \
- assert(rval >= 0)
+#define CHECK(x) assert((x) >= 0)
+#define LOOP_CHECK(rval, cmd) \
+ do { \
+ rval = cmd; \
+ } while (rval == GNUTLS_E_AGAIN || rval == GNUTLS_E_INTERRUPTED); \
+ assert(rval >= 0)
#define MAX_BUF 1024
#define CAFILE "/etc/ssl/certs/ca-certificates.crt"
@@ -101,8 +101,7 @@ int main(void)
*/
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) {
fprintf(stderr, "*** Handshake failed\n");
@@ -139,7 +138,7 @@ int main(void)
CHECK(gnutls_bye(session, GNUTLS_SHUT_RDWR));
- end:
+end:
tcp_close(sd);
@@ -173,14 +172,14 @@ static int _verify_certificate_callback(gnutls_session_t session)
type = gnutls_certificate_type_get(session);
- CHECK(gnutls_certificate_verification_status_print(status, type,
- &out, 0));
+ CHECK(gnutls_certificate_verification_status_print(status, type, &out,
+ 0));
printf("%s", out.data);
gnutls_free(out.data);
- if (status != 0) /* Certificate is not trusted */
+ if (status != 0) /* Certificate is not trusted */
return GNUTLS_E_CERTIFICATE_ERROR;
/* notify gnutls to continue handshake normally */