summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/BN_mod_mul_reciprocal.3
diff options
context:
space:
mode:
authorschwarze <>2017-01-29 23:41:49 +0000
committerschwarze <>2017-01-29 23:41:49 +0000
commitcdcc8ff92546c28c6052f507ba6ff8b82340b5e3 (patch)
tree83b0e7ffbb25488021b344d6b87cca01b6781a0b /src/lib/libcrypto/man/BN_mod_mul_reciprocal.3
parent349c6add6442fbf91283c7ec35808acbec836f29 (diff)
downloadopenbsd-cdcc8ff92546c28c6052f507ba6ff8b82340b5e3.tar.gz
openbsd-cdcc8ff92546c28c6052f507ba6ff8b82340b5e3.tar.bz2
openbsd-cdcc8ff92546c28c6052f507ba6ff8b82340b5e3.zip
Seriously warn against calling BN_init(3), BN_MONT_CTX_init(3),
and BN_RECP_CTX_init(3). They are not only deprecated but so dangerous that they are almost unusable. I found these scary traps while reading the code in order to document BN_set_flags(3). While here, delete ERR_get_error(3) from SEE ALSO.
Diffstat (limited to 'src/lib/libcrypto/man/BN_mod_mul_reciprocal.3')
-rw-r--r--src/lib/libcrypto/man/BN_mod_mul_reciprocal.327
1 files changed, 23 insertions, 4 deletions
diff --git a/src/lib/libcrypto/man/BN_mod_mul_reciprocal.3 b/src/lib/libcrypto/man/BN_mod_mul_reciprocal.3
index 74783b2f55..a24917bef9 100644
--- a/src/lib/libcrypto/man/BN_mod_mul_reciprocal.3
+++ b/src/lib/libcrypto/man/BN_mod_mul_reciprocal.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: BN_mod_mul_reciprocal.3,v 1.5 2016/12/10 21:13:25 schwarze Exp $ 1.\" $OpenBSD: BN_mod_mul_reciprocal.3,v 1.6 2017/01/29 23:41:49 schwarze Exp $
2.\" OpenSSL 6859cf74 Sep 25 13:33:28 2002 +0000 2.\" OpenSSL 6859cf74 Sep 25 13:33:28 2002 +0000
3.\" 3.\"
4.\" This file was written by Ulf Moeller <ulf@openssl.org>. 4.\" This file was written by Ulf Moeller <ulf@openssl.org>.
@@ -48,7 +48,7 @@
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE. 49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\" 50.\"
51.Dd $Mdocdate: December 10 2016 $ 51.Dd $Mdocdate: January 29 2017 $
52.Dt BN_MOD_MUL_RECIPROCAL 3 52.Dt BN_MOD_MUL_RECIPROCAL 3
53.Os 53.Os
54.Sh NAME 54.Sh NAME
@@ -115,9 +115,12 @@ used for temporary variables.
115allocates and initializes a 115allocates and initializes a
116.Vt BN_RECP_CTX 116.Vt BN_RECP_CTX
117structure. 117structure.
118.Pp
118.Fn BN_RECP_CTX_init 119.Fn BN_RECP_CTX_init
119initializes an existing uninitialized 120initializes an existing uninitialized
120.Vt BN_RECP_CTX . 121.Vt BN_RECP_CTX .
122It is deprecated and dangerous, see
123.Sx CAVEATS .
121.Pp 124.Pp
122.Fn BN_RECP_CTX_free 125.Fn BN_RECP_CTX_free
123frees the components of the 126frees the components of the
@@ -185,8 +188,7 @@ The error codes can be obtained by
185.Sh SEE ALSO 188.Sh SEE ALSO
186.Xr BN_add 3 , 189.Xr BN_add 3 ,
187.Xr BN_CTX_new 3 , 190.Xr BN_CTX_new 3 ,
188.Xr BN_new 3 , 191.Xr BN_new 3
189.Xr ERR_get_error 3
190.Sh HISTORY 192.Sh HISTORY
191.Vt BN_RECP_CTX 193.Vt BN_RECP_CTX
192was added in SSLeay 0.9.0. 194was added in SSLeay 0.9.0.
@@ -195,3 +197,20 @@ Before that, a function
195was used instead, and the 197was used instead, and the
196.Fn BN_mod_mul_reciprocal 198.Fn BN_mod_mul_reciprocal
197arguments were different. 199arguments were different.
200.Sh CAVEATS
201.Fn BN_RECP_CTX_init
202must not be called on a context that was used previously, or
203memory used by the embedded
204.Vt BIGNUM
205structures is leaked immediately.
206Besides, it must not be called on a context created with
207.Fn BN_RECP_CTX_new ,
208or the context itself will likely be leaked later.
209It can only be used on a static
210.Vt BN_RECP_CTX
211structure, on one located on the stack, or on one
212.Xr malloc 3 Ap ed
213manually, but all these options are discouraged because they
214will no longer work once
215.Vt BN_RECP_CTX
216will be made opaque.