summaryrefslogtreecommitdiff
path: root/apps/ecparam.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/ecparam.c
parent71d8c138cf0a72663cd401d753564eecd8c23289 (diff)
downloadopenssl-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/ecparam.c')
-rw-r--r--apps/ecparam.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/ecparam.c b/apps/ecparam.c
index 7d4cef1006..a3696c9d95 100644
--- a/apps/ecparam.c
+++ b/apps/ecparam.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2002-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
@@ -232,8 +232,9 @@ int ecparam_main(int argc, char **argv)
BIO_printf(bio_err, "using curve name prime256v1 "
"instead of secp256r1\n");
nid = NID_X9_62_prime256v1;
- } else
+ } else {
nid = OBJ_sn2nid(curve_name);
+ }
if (nid == 0)
nid = EC_curve_nist2nid(curve_name);
@@ -250,10 +251,11 @@ int ecparam_main(int argc, char **argv)
}
EC_GROUP_set_asn1_flag(group, asn1_flag);
EC_GROUP_set_point_conversion_form(group, form);
- } else if (informat == FORMAT_ASN1)
+ } else if (informat == FORMAT_ASN1) {
group = d2i_ECPKParameters_bio(in, NULL);
- else
+ } else {
group = PEM_read_bio_ECPKParameters(in, NULL, NULL, NULL);
+ }
if (group == NULL) {
BIO_printf(bio_err, "unable to load elliptic curve parameters\n");
ERR_print_errors(bio_err);