diff options
author | tb <> | 2023-06-02 17:15:30 +0000 |
---|---|---|
committer | tb <> | 2023-06-02 17:15:30 +0000 |
commit | 74b7c36772c9b29f9523bafec5ccaf81245d37ba (patch) | |
tree | f043b7261800ea529ad2ae4a8fdf8af2a680e927 /src/lib/libc/stdlib | |
parent | 2b97cf7e3d42610c403a60d91ae66bfa39bedd26 (diff) | |
download | openbsd-74b7c36772c9b29f9523bafec5ccaf81245d37ba.tar.gz openbsd-74b7c36772c9b29f9523bafec5ccaf81245d37ba.tar.bz2 openbsd-74b7c36772c9b29f9523bafec5ccaf81245d37ba.zip |
Fix variable reuse in BN_mod_inverse()
The somewhat strange calculation m = a^{-1} (mod m) can return 0. This
breaks because of BN_nnmod() having delicate semantics of which variable
can be reused. BN_nnmod(a, a, m, ctx) works and the library relies on that.
Here, the code ends up doing BN_nnmod(m, a, m, ctx) and this doesn't work.
If the result of the initial BN_mod() is negative, then BN_nnmod() will
return 0.
Problem reported by Guido Vranken in
https://github.com/openssl/openssl/issues/21110
This code is well covered by regress, but it does not currently have
explicit test coverage. Such will be added soon.
ok beck jsing
Diffstat (limited to 'src/lib/libc/stdlib')
0 files changed, 0 insertions, 0 deletions