summaryrefslogtreecommitdiff
path: root/test/crypt-kat.c
diff options
context:
space:
mode:
authorBjörn Esser <besser82@fedoraproject.org>2019-05-04 21:48:49 +0200
committerBjörn Esser <besser82@fedoraproject.org>2019-05-04 21:48:49 +0200
commit398943774c5ff38baf1bc5ee088855fd8983bb05 (patch)
treeb4348e64df3d5c174c0580b5b2e7b70a76b41a71 /test/crypt-kat.c
parent0ef346147f8a6b35eca164341ce64e7dc7f5ac99 (diff)
downloadlibxcrypt-398943774c5ff38baf1bc5ee088855fd8983bb05.tar.gz
libxcrypt-398943774c5ff38baf1bc5ee088855fd8983bb05.tar.bz2
libxcrypt-398943774c5ff38baf1bc5ee088855fd8983bb05.zip
Apply proper GNU-style code formatting.
Diffstat (limited to 'test/crypt-kat.c')
-rw-r--r--test/crypt-kat.c57
1 files changed, 33 insertions, 24 deletions
diff --git a/test/crypt-kat.c b/test/crypt-kat.c
index 19a79b1..66a1fa2 100644
--- a/test/crypt-kat.c
+++ b/test/crypt-kat.c
@@ -152,7 +152,7 @@ report_result (const char *tag, const char *hash, int errnm,
printf (", errno not set");
/* Should the API used have generated a NULL or a failure token? */
- if (hash == 0 && expect_failure_tokens)
+ if (hash == 0 && expect_failure_tokens)
printf (", failure token not generated");
if (hash != 0 && !expect_failure_tokens)
printf (", failure token wrongly generated");
@@ -200,9 +200,10 @@ static void *
calc_hashes_crypt_r_rn (ARG_UNUSED (void *unused))
{
char *hash;
- union {
- char pass[CRYPT_MAX_PASSPHRASE_SIZE + 1];
- int aligned;
+ union
+ {
+ char pass[CRYPT_MAX_PASSPHRASE_SIZE + 1];
+ int aligned;
} u;
size_t i;
struct crypt_data data;
@@ -270,32 +271,40 @@ main (void)
int err;
void *xstatus;
err = pthread_create (&t1, 0, calc_hashes_crypt_r_rn, 0);
- if (err) {
- fprintf (stderr, "pthread_create (crypt_r): %s\n", strerror (err));
- return 1;
- }
+ if (err)
+ {
+ fprintf (stderr, "pthread_create (crypt_r): %s\n", strerror (err));
+ return 1;
+ }
err = pthread_create (&t2, 0, calc_hashes_crypt_ra_recrypt, 0);
- if (err) {
- fprintf (stderr, "pthread_create (crypt_ra): %s\n", strerror (err));
- return 1;
- }
+ if (err)
+ {
+ fprintf (stderr, "pthread_create (crypt_ra): %s\n", strerror (err));
+ return 1;
+ }
status |= !!calc_hashes_crypt_fcrypt (0);
err = pthread_join (t1, &xstatus);
- if (err) {
- fprintf (stderr, "pthread_join (crypt_r): %s\n", strerror (err));
- status = 1;
- } else {
- status |= !!xstatus;
- }
+ if (err)
+ {
+ fprintf (stderr, "pthread_join (crypt_r): %s\n", strerror (err));
+ status = 1;
+ }
+ else
+ {
+ status |= !!xstatus;
+ }
err = pthread_join (t2, &xstatus);
- if (err) {
- fprintf (stderr, "pthread_join (crypt_rn): %s\n", strerror (err));
- status = 1;
- } else {
- status |= !!xstatus;
- }
+ if (err)
+ {
+ fprintf (stderr, "pthread_join (crypt_rn): %s\n", strerror (err));
+ status = 1;
+ }
+ else
+ {
+ status |= !!xstatus;
+ }
}
#else
status |= !!calc_hashes_crypt_fcrypt (results);