summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib
diff options
context:
space:
mode:
authortb <>2023-06-02 17:15:30 +0000
committertb <>2023-06-02 17:15:30 +0000
commit74b7c36772c9b29f9523bafec5ccaf81245d37ba (patch)
treef043b7261800ea529ad2ae4a8fdf8af2a680e927 /src/lib/libc/stdlib
parent2b97cf7e3d42610c403a60d91ae66bfa39bedd26 (diff)
downloadopenbsd-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