boringssl/crypto/fipsmodule/ec
Adam Langley 2044181e01 Set output point to the generator when not on the curve.
Processing off-curve points is sufficiently dangerous to worry about
code that doesn't check the return value of
|EC_POINT_set_affine_coordinates| and |EC_POINT_oct2point|. While we
have integrated on-curve checks into these functions, code that ignores
the return value will still be able to work with an invalid point
because it's already been installed in the output by the time the check
is done.

Instead, in the event of an off-curve point, set the output point to the
generator, which is certainly on the curve and hopefully safe.

Change-Id: Ibc73dceb2d8d21920e07c4f6def2c8249cb78ca0
Reviewed-on: https://boringssl-review.googlesource.com/25724
Commit-Queue: David Benjamin <davidben@google.com>
Reviewed-by: David Benjamin <davidben@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2018-02-05 02:03:29 +00:00
..
asm Revert ADX due to build issues. 2017-08-15 18:56:09 +00:00
ec_key.c Simplify EC_KEY_set_public_key_affine_coordinates. 2018-01-08 19:50:42 +00:00
ec_montgomery.c Add a function which folds BN_MONT_CTX_{new,set} together. 2018-02-02 20:23:25 +00:00
ec_test.cc Set output point to the generator when not on the curve. 2018-02-05 02:03:29 +00:00
ec.c Set output point to the generator when not on the curve. 2018-02-05 02:03:29 +00:00
internal.h Fold away ec_point_set_Jprojective_coordinates_GFp. 2018-01-08 19:48:37 +00:00
oct.c Make EC_POINT_set_compressed_coordinates_GFp use BIGNUM directly. 2018-01-08 19:40:21 +00:00
p224-64.c Align various point_get_affine_coordinates implementations. 2018-01-08 20:03:42 +00:00
p256-x86_64_test.cc Add a function which folds BN_MONT_CTX_{new,set} together. 2018-02-02 20:23:25 +00:00
p256-x86_64_tests.txt
p256-x86_64-table.h Run the comment converter on libcrypto. 2017-08-18 21:49:04 +00:00
p256-x86_64.c Add bn_copy_words. 2018-02-02 18:24:39 +00:00
p256-x86_64.h Run the comment converter on libcrypto. 2017-08-18 21:49:04 +00:00
simple.c Fold away ec_point_set_Jprojective_coordinates_GFp. 2018-01-08 19:48:37 +00:00
util.c ec/p256.c: fiat-crypto field arithmetic (64, 32) 2017-12-11 17:55:46 +00:00
wnaf.c Unwind total_num from wNAF_mul. 2018-01-23 22:04:58 +00:00