summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man
diff options
context:
space:
mode:
authorschwarze <>2022-11-20 23:35:00 +0000
committerschwarze <>2022-11-20 23:35:00 +0000
commit24b92fa9d36633c9630c63433973fe680957c836 (patch)
tree77658a9ec93316a585244f95b6ac2df89c015491 /src/lib/libcrypto/man
parent3585c6fd96623cbda97253ab2fb8f0742ceaef83 (diff)
downloadopenbsd-24b92fa9d36633c9630c63433973fe680957c836.tar.gz
openbsd-24b92fa9d36633c9630c63433973fe680957c836.tar.bz2
openbsd-24b92fa9d36633c9630c63433973fe680957c836.zip
Fix a surprising quirk in BN_GF2m_mod(3).
All other wrappers in the same file that use a temporary array of degrees size that array dynamically, such that they are able to handle reducing polynomials of arbitrary lengths. BN_GF2m_mod(3) was the only one that used a static array of size 6 instead, limiting it to trinomials and pentanomials and causing it to fail for longer reducing polynomials. Make this more uniform and less surprising by using exactly the same code as in all the other wrappers, such that BN_GF2m_mod(3) works with reducing polynomials of arbitrary length, too, just like the others. Again, tb@ points out this quirk is very unlikely to cause vulnerabilities in practice because cryptographic applications do not use longer reducing polynomials. This patch is not expected to significantly impact performance because the relevant caller, BN_GF2m_mod_div(3), already uses dynamic allocation via BN_GF2m_mod_mul(3). OK tb@
Diffstat (limited to 'src/lib/libcrypto/man')
-rw-r--r--src/lib/libcrypto/man/BN_GF2m_add.314
1 files changed, 3 insertions, 11 deletions
diff --git a/src/lib/libcrypto/man/BN_GF2m_add.3 b/src/lib/libcrypto/man/BN_GF2m_add.3
index 170a7df18a..60a2a5eed4 100644
--- a/src/lib/libcrypto/man/BN_GF2m_add.3
+++ b/src/lib/libcrypto/man/BN_GF2m_add.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: BN_GF2m_add.3,v 1.3 2022/11/18 07:28:34 tb Exp $ 1.\" $OpenBSD: BN_GF2m_add.3,v 1.4 2022/11/20 23:35:00 schwarze Exp $
2.\" 2.\"
3.\" Copyright (c) 2022 Ingo Schwarze <schwarze@openbsd.org> 3.\" Copyright (c) 2022 Ingo Schwarze <schwarze@openbsd.org>
4.\" 4.\"
@@ -14,7 +14,7 @@
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\" 16.\"
17.Dd $Mdocdate: November 18 2022 $ 17.Dd $Mdocdate: November 20 2022 $
18.Dt BN_GF2M_ADD 3 18.Dt BN_GF2M_ADD 3
19.Os 19.Os
20.Sh NAME 20.Sh NAME
@@ -480,9 +480,7 @@ In one of the functions wrapping an
480.Fn *_arr 480.Fn *_arr
481variant, the 481variant, the
482.Fa "BIGNUM *p" 482.Fa "BIGNUM *p"
483argument had a value of zero, or in 483argument had a value of zero.
484.Fn BN_GF2m_mod ,
485it contained more than five non-zero coefficients.
486.El 484.El
487.Sh SEE ALSO 485.Sh SEE ALSO
488.Xr BN_add 3 , 486.Xr BN_add 3 ,
@@ -514,9 +512,3 @@ it contained more than five non-zero coefficients.
514 exponentiation algorithm A.4.1 for square roots, and\ 512 exponentiation algorithm A.4.1 for square roots, and\
515 algorithms A.4.7 and A.4.6 for the quadratic equation 513 algorithms A.4.7 and A.4.6 for the quadratic equation
516.Re 514.Re
517.Sh BUGS
518.Fn BN_GF2m_mod
519is arbitrarily limited to reducing polynomials containing at most five
520non-zero coefficients and returns failure if
521.Fa p
522contains six or more non-zero coefficients.