diff options
author | Paul Yang <paulyang.inf@gmail.com> | 2017-06-13 01:24:02 +0800 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2017-06-12 16:11:05 -0400 |
commit | 2234212c3dde887e0b7fa08277d035cd132e2cce (patch) | |
tree | b786145f72f8938a11d4c6fc6ff815e0ae6c43a4 /apps/pkey.c | |
parent | 71d8c138cf0a72663cd401d753564eecd8c23289 (diff) | |
download | openssl-new-2234212c3dde887e0b7fa08277d035cd132e2cce.tar.gz |
Clean up a bundle of codingstyle stuff in apps directory
Mostly braces and NULL pointer check and also copyright year bump
Signed-off-by: Paul Yang <paulyang.inf@gmail.com>
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3657)
Diffstat (limited to 'apps/pkey.c')
-rw-r--r-- | apps/pkey.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/apps/pkey.c b/apps/pkey.c index 14896d3e46..e8e32bacda 100644 --- a/apps/pkey.c +++ b/apps/pkey.c @@ -1,5 +1,5 @@ /* - * Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2006-2017 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -136,14 +136,14 @@ int pkey_main(int argc, char **argv) pkey = load_pubkey(infile, informat, 1, passin, e, "Public Key"); else pkey = load_key(infile, informat, 1, passin, e, "key"); - if (!pkey) + if (pkey == NULL) goto end; if (!noout) { if (outformat == FORMAT_PEM) { - if (pubout) + if (pubout) { PEM_write_bio_PUBKEY(out, pkey); - else { + } else { assert(private); if (traditional) PEM_write_bio_PrivateKey_traditional(out, pkey, cipher, @@ -154,9 +154,9 @@ int pkey_main(int argc, char **argv) NULL, 0, NULL, passout); } } else if (outformat == FORMAT_ASN1) { - if (pubout) + if (pubout) { i2d_PUBKEY_bio(out, pkey); - else { + } else { assert(private); i2d_PrivateKey_bio(out, pkey); } @@ -164,13 +164,12 @@ int pkey_main(int argc, char **argv) BIO_printf(bio_err, "Bad format specified for key\n"); goto end; } - } if (text) { - if (pubtext) + if (pubtext) { EVP_PKEY_print_public(out, pkey, 0, NULL); - else { + } else { assert(private); EVP_PKEY_print_private(out, pkey, 0, NULL); } |