diff options
author | David Benjamin <davidben@chromium.org> | 2015-02-11 09:17:18 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2015-02-12 02:14:04 +0300 |
commit | 9ab14e00d5f9a1c9847137f1d6f776e18f59048b (patch) | |
tree | 964acd8953118a55c0ef4e7e8a879844fb5a4f6f /crypto/ec/oct.c | |
parent | 3673be7cb6611b373b9b1200999827a9b8df37a1 (diff) |
Add in missing curly braces part 2.
ECC code.
Change-Id: I1a960620edbb30e10dcbab0e8053a1deb9db3262
Reviewed-on: https://boringssl-review.googlesource.com/3402
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/ec/oct.c')
-rw-r--r-- | crypto/ec/oct.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/crypto/ec/oct.c b/crypto/ec/oct.c index c4729efc..1cb7c2f0 100644 --- a/crypto/ec/oct.c +++ b/crypto/ec/oct.c @@ -227,40 +227,46 @@ static int ec_GFp_simple_oct2point(const EC_GROUP *group, EC_POINT *point, if (ctx == NULL) { ctx = new_ctx = BN_CTX_new(); - if (ctx == NULL) + if (ctx == NULL) { return 0; + } } BN_CTX_start(ctx); x = BN_CTX_get(ctx); y = BN_CTX_get(ctx); - if (y == NULL) + if (y == NULL) { goto err; + } - if (!BN_bin2bn(buf + 1, field_len, x)) + if (!BN_bin2bn(buf + 1, field_len, x)) { goto err; + } if (BN_ucmp(x, &group->field) >= 0) { OPENSSL_PUT_ERROR(EC, ec_GFp_simple_oct2point, EC_R_INVALID_ENCODING); goto err; } if (form == POINT_CONVERSION_COMPRESSED) { - if (!EC_POINT_set_compressed_coordinates_GFp(group, point, x, y_bit, ctx)) + if (!EC_POINT_set_compressed_coordinates_GFp(group, point, x, y_bit, ctx)) { goto err; + } } else { - if (!BN_bin2bn(buf + 1 + field_len, field_len, y)) + if (!BN_bin2bn(buf + 1 + field_len, field_len, y)) { goto err; + } if (BN_ucmp(y, &group->field) >= 0) { OPENSSL_PUT_ERROR(EC, ec_GFp_simple_oct2point, EC_R_INVALID_ENCODING); goto err; } - if (!EC_POINT_set_affine_coordinates_GFp(group, point, x, y, ctx)) + if (!EC_POINT_set_affine_coordinates_GFp(group, point, x, y, ctx)) { goto err; + } } - if (!EC_POINT_is_on_curve(group, point, ctx)) /* test required by X9.62 */ - { + /* test required by X9.62 */ + if (!EC_POINT_is_on_curve(group, point, ctx)) { OPENSSL_PUT_ERROR(EC, ec_GFp_simple_oct2point, EC_R_POINT_IS_NOT_ON_CURVE); goto err; } @@ -269,8 +275,9 @@ static int ec_GFp_simple_oct2point(const EC_GROUP *group, EC_POINT *point, err: BN_CTX_end(ctx); - if (new_ctx != NULL) + if (new_ctx != NULL) { BN_CTX_free(new_ctx); + } return ret; } @@ -441,15 +448,17 @@ int ec_GFp_simple_set_compressed_coordinates(const EC_GROUP *group, goto err; } - if (!EC_POINT_set_affine_coordinates_GFp(group, point, x, y, ctx)) + if (!EC_POINT_set_affine_coordinates_GFp(group, point, x, y, ctx)) { goto err; + } ret = 1; err: BN_CTX_end(ctx); - if (new_ctx != NULL) + if (new_ctx != NULL) { BN_CTX_free(new_ctx); + } return ret; } |