diff options
author | jsing <> | 2023-02-13 04:25:37 +0000 |
---|---|---|
committer | jsing <> | 2023-02-13 04:25:37 +0000 |
commit | 59402a8926d023550549cfdb576bcecdb23bb2bc (patch) | |
tree | 3f4664b9d6259b538a970687b222189d9d59afb5 /src/regress | |
parent | b0f0ff7e648539633669f7fb4530b8d5fc901052 (diff) | |
download | openbsd-59402a8926d023550549cfdb576bcecdb23bb2bc.tar.gz openbsd-59402a8926d023550549cfdb576bcecdb23bb2bc.tar.bz2 openbsd-59402a8926d023550549cfdb576bcecdb23bb2bc.zip |
Avoid negative zero.
Whenever setting negative to one (or when it could potentially be one),
always use BN_set_negative() since it checks for a zero valued bignum and
will not permit negative to be set in this case. Since BN_is_zero()
currently relies on top == 0, call BN_set_negative() after top has been
set (or bn_correct_top() has been called).
This fixes a long standing issue where -0 and +0 have been permitted,
however multiple code paths (such as BN_cmp()) fail to treat these as
equivalent.
Prompted by Guido Vranken who is adding negative zero fuzzing to oss-fuzz.
ok tb@
Diffstat (limited to 'src/regress')
0 files changed, 0 insertions, 0 deletions