CVSROOT:        /cvs
Module name:    src
Changes by:     js...@cvs.openbsd.org   2023/01/30 22:16:52

Modified files:
        lib/libcrypto/bn: bn_add.c 
        lib/libcrypto/man: BN_add.3 

Log message:
Correctly detect b < a in BN_usub().

BN_usub() requires that a >= b and should return an error in the case that
b < a. This is currently only detected by checking the number of words in
a versus b - if they have the same number of words, the top word is not
checked and b < a, which then succeeds and produces an incorrect result.

Fix this by checking for the case where a and b have an equal number of
words, yet there is a borrow returned from bn_sub_words().

ok miod@ tb@

Reply via email to