diff options
author | 2014-04-17 15:17:22 +0000 | |
---|---|---|
committer | 2014-04-17 15:17:22 +0000 | |
commit | d13752d4c3893f12d90c75171b83a65e24978172 (patch) | |
tree | 79fae2b963d252010f272b8b160ff55d5405751e /lib/libssl/src/apps | |
parent | More KNF. (diff) | |
download | wireguard-openbsd-d13752d4c3893f12d90c75171b83a65e24978172.tar.xz wireguard-openbsd-d13752d4c3893f12d90c75171b83a65e24978172.zip |
More KNF.
Diffstat (limited to 'lib/libssl/src/apps')
-rw-r--r-- | lib/libssl/src/apps/dgst.c | 20 | ||||
-rw-r--r-- | lib/libssl/src/apps/dhparam.c | 7 |
2 files changed, 16 insertions, 11 deletions
diff --git a/lib/libssl/src/apps/dgst.c b/lib/libssl/src/apps/dgst.c index 7336023b30e..c024229c58b 100644 --- a/lib/libssl/src/apps/dgst.c +++ b/lib/libssl/src/apps/dgst.c @@ -74,7 +74,8 @@ #undef PROG #define PROG dgst_main -int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout, +int +do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout, EVP_PKEY *key, unsigned char *sigin, int siglen, const char *sig_name, const char *md_name, const char *file, BIO *bmd); @@ -361,7 +362,7 @@ MAIN(int argc, char **argv) goto mac_end; } r = 1; - mac_end: +mac_end: if (mac_ctx) EVP_PKEY_CTX_free(mac_ctx); if (r == 0) @@ -475,10 +476,11 @@ MAIN(int argc, char **argv) perror(argv[i]); err++; continue; - } else + } else { r = do_fp(out, buf, inp, separator, out_bin, sigkey, sigbuf, siglen, sig_name, md_name, argv[i], bmd); + } if (r) err = r; (void)BIO_reset(bmd); @@ -500,9 +502,10 @@ end: sk_OPENSSL_STRING_free(sigopts); if (macopts) sk_OPENSSL_STRING_free(macopts); - if (sigbuf) free(sigbuf); - if (bmd != NULL) - BIO_free(bmd); + if (sigbuf) + free(sigbuf); + if (bmd != NULL) + BIO_free(bmd); apps_shutdown(); OPENSSL_EXIT(err); } @@ -559,8 +562,9 @@ do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout, } } - if (binout) BIO_write(out, buf, len); - else if (sep == 2) { + if (binout) + BIO_write(out, buf, len); + else if (sep == 2) { for (i = 0; i < (int)len; i++) BIO_printf(out, "%02x", buf[i]); BIO_printf(out, " *%s\n", file); diff --git a/lib/libssl/src/apps/dhparam.c b/lib/libssl/src/apps/dhparam.c index d8fb930cb32..9e1b2144584 100644 --- a/lib/libssl/src/apps/dhparam.c +++ b/lib/libssl/src/apps/dhparam.c @@ -300,9 +300,10 @@ bad: BIO_printf(bio_err, "Generating DSA parameters, %d bit long prime\n", num); if (!dsa || !DSA_generate_parameters_ex(dsa, num, - NULL, 0, NULL, NULL, &cb)) { - if (dsa) DSA_free(dsa); - ERR_print_errors(bio_err); + NULL, 0, NULL, NULL, &cb)) { + if (dsa) + DSA_free(dsa); + ERR_print_errors(bio_err); goto end; } |