summaryrefslogtreecommitdiffstats
path: root/apps/ec.c
diff options
context:
space:
mode:
authorPaul Yang <paulyang.inf@gmail.com>2017-06-13 01:24:02 +0800
committerRich Salz <rsalz@openssl.org>2017-06-12 16:11:05 -0400
commit2234212c3dde887e0b7fa08277d035cd132e2cce (patch)
treeb786145f72f8938a11d4c6fc6ff815e0ae6c43a4 /apps/ec.c
parent71d8c138cf0a72663cd401d753564eecd8c23289 (diff)
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/ec.c')
-rw-r--r--apps/ec.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/apps/ec.c b/apps/ec.c
index 06f357d1dd..859623e2a3 100644
--- a/apps/ec.c
+++ b/apps/ec.c
@@ -244,20 +244,20 @@ int ec_main(int argc, char **argv)
BIO_printf(bio_err, "writing EC key\n");
if (outformat == FORMAT_ASN1) {
- if (param_out)
+ if (param_out) {
i = i2d_ECPKParameters_bio(out, group);
- else if (pubin || pubout)
+ } else if (pubin || pubout) {
i = i2d_EC_PUBKEY_bio(out, eckey);
- else {
+ } else {
assert(private);
i = i2d_ECPrivateKey_bio(out, eckey);
}
} else {
- if (param_out)
+ if (param_out) {
i = PEM_write_bio_ECPKParameters(out, group);
- else if (pubin || pubout)
+ } else if (pubin || pubout) {
i = PEM_write_bio_EC_PUBKEY(out, eckey);
- else {
+ } else {
assert(private);
i = PEM_write_bio_ECPrivateKey(out, eckey, enc,
NULL, 0, NULL, passout);
@@ -267,8 +267,9 @@ int ec_main(int argc, char **argv)
if (!i) {
BIO_printf(bio_err, "unable to write private key\n");
ERR_print_errors(bio_err);
- } else
+ } else {
ret = 0;
+ }
end:
BIO_free(in);
BIO_free_all(out);