summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/BN_new.3
diff options
context:
space:
mode:
authorschwarze <>2022-11-20 22:23:43 +0000
committerschwarze <>2022-11-20 22:23:43 +0000
commit3585c6fd96623cbda97253ab2fb8f0742ceaef83 (patch)
tree3da6cf9f0e5d88161004d65ed1963d3bae1a150d /src/lib/libcrypto/man/BN_new.3
parent54fd9d3c1b8f12354e7c9e47c46baabffd7ae2dc (diff)
downloadopenbsd-3585c6fd96623cbda97253ab2fb8f0742ceaef83.tar.gz
openbsd-3585c6fd96623cbda97253ab2fb8f0742ceaef83.tar.bz2
openbsd-3585c6fd96623cbda97253ab2fb8f0742ceaef83.zip
Fix an off-by-one bug in BN_GF2m_poly2arr(3).
If the last argument, the size of the output array, is too small to contain all degrees present in the input polynomial plus one for the terminating -1, the function is documented to return the size of the output array that would be needed (in comments in the source code, in the new manual page, and by the way how the function is used by other functions in the same file). However, in case of overflow, the existing code failed to include the element needed for the terminating -1 in the return value, wrongly indicating success if everything but the -1 did fit and reporting failure with a size that was still too small otherwise. According to tb@, this is very unlikely to cause vulnerabilities in practical applications because there is no real reason to pick a reducing polynomial longer than a pentanomial, because all known callers use either fixed size arrays of size 6 or dynamic allocation, because use of GF(2^m) is rare in practice, and GF(2^m) with custom reducing polynomials even more so. OK tb@
Diffstat (limited to 'src/lib/libcrypto/man/BN_new.3')
0 files changed, 0 insertions, 0 deletions