diff options
author | schwarze <> | 2018-02-13 02:39:29 +0000 |
---|---|---|
committer | schwarze <> | 2018-02-13 02:39:29 +0000 |
commit | 0fc470b585c54b396e7bd1205d8a79dcf2ee2278 (patch) | |
tree | 04fbe2a94d3e0650018523d4c768e1a24ddc4a53 | |
parent | cc406815739c39cd171c7d6215510e22ad080846 (diff) | |
download | openbsd-0fc470b585c54b396e7bd1205d8a79dcf2ee2278.tar.gz openbsd-0fc470b585c54b396e7bd1205d8a79dcf2ee2278.tar.bz2 openbsd-0fc470b585c54b396e7bd1205d8a79dcf2ee2278.zip |
Correctly describe BN_get_word(3) and BN_set_word(3).
These functions constitute an obvious portability nightmare,
but that's no excuse for incorrect documentation.
Pointed out by Nicolas Schodet
via OpenSSL commit b713c4ff Jan 22 14:41:09 2018 -0500.
-rw-r--r-- | src/lib/libcrypto/man/BN_zero.3 | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/src/lib/libcrypto/man/BN_zero.3 b/src/lib/libcrypto/man/BN_zero.3 index 49d08717e4..8343beebc4 100644 --- a/src/lib/libcrypto/man/BN_zero.3 +++ b/src/lib/libcrypto/man/BN_zero.3 | |||
@@ -1,8 +1,10 @@ | |||
1 | .\" $OpenBSD: BN_zero.3,v 1.6 2016/12/10 21:13:25 schwarze Exp $ | 1 | .\" $OpenBSD: BN_zero.3,v 1.7 2018/02/13 02:39:29 schwarze Exp $ |
2 | .\" OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400 | 2 | .\" full merge up to: OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400 |
3 | .\" selective merge up to: OpenSSL b713c4ff Jan 22 14:41:09 2018 -0500 | ||
3 | .\" | 4 | .\" |
4 | .\" This file was written by Ulf Moeller <ulf@openssl.org>. | 5 | .\" This file was written by Ulf Moeller <ulf@openssl.org>. |
5 | .\" Copyright (c) 2000, 2001, 2002 The OpenSSL Project. All rights reserved. | 6 | .\" Copyright (c) 2000, 2001, 2002, 2018 The OpenSSL Project. |
7 | .\" All rights reserved. | ||
6 | .\" | 8 | .\" |
7 | .\" Redistribution and use in source and binary forms, with or without | 9 | .\" Redistribution and use in source and binary forms, with or without |
8 | .\" modification, are permitted provided that the following conditions | 10 | .\" modification, are permitted provided that the following conditions |
@@ -48,7 +50,7 @@ | |||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 50 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 51 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
50 | .\" | 52 | .\" |
51 | .Dd $Mdocdate: December 10 2016 $ | 53 | .Dd $Mdocdate: February 13 2018 $ |
52 | .Dt BN_ZERO 3 | 54 | .Dt BN_ZERO 3 |
53 | .Os | 55 | .Os |
54 | .Sh NAME | 56 | .Sh NAME |
@@ -75,13 +77,17 @@ | |||
75 | .Ft int | 77 | .Ft int |
76 | .Fo BN_set_word | 78 | .Fo BN_set_word |
77 | .Fa "BIGNUM *a" | 79 | .Fa "BIGNUM *a" |
78 | .Fa "unsigned long w" | 80 | .Fa "BN_ULONG w" |
79 | .Fc | 81 | .Fc |
80 | .Ft unsigned long | 82 | .Ft BN_ULONG |
81 | .Fo BN_get_word | 83 | .Fo BN_get_word |
82 | .Fa "BIGNUM *a" | 84 | .Fa "BIGNUM *a" |
83 | .Fc | 85 | .Fc |
84 | .Sh DESCRIPTION | 86 | .Sh DESCRIPTION |
87 | .Vt BN_ULONG | ||
88 | is a macro that expands to an unsigned integral type optimized | ||
89 | for the most efficient implementation on the local platform. | ||
90 | .Pp | ||
85 | .Fn BN_zero , | 91 | .Fn BN_zero , |
86 | .Fn BN_one , | 92 | .Fn BN_one , |
87 | and | 93 | and |
@@ -100,21 +106,15 @@ are macros. | |||
100 | returns a | 106 | returns a |
101 | .Vt BIGNUM | 107 | .Vt BIGNUM |
102 | constant of value 1. | 108 | constant of value 1. |
103 | This constant is useful for use in comparisons and assignment. | 109 | This constant is useful for comparisons and assignments. |
104 | .Pp | ||
105 | .Fn BN_get_word | ||
106 | returns | ||
107 | .Fa a | ||
108 | if it can be represented as an | ||
109 | .Vt unsigned long . | ||
110 | .Sh RETURN VALUES | 110 | .Sh RETURN VALUES |
111 | .Fn BN_get_word | 111 | .Fn BN_get_word |
112 | returns the value | 112 | returns the value |
113 | .Fa a , | 113 | .Fa a , |
114 | or 0xffffffffL if | 114 | or a number with all bits set if |
115 | .Fa a | 115 | .Fa a |
116 | cannot be represented as an | 116 | cannot be represented as a |
117 | .Vt unsigned long . | 117 | .Vt BN_ULONG . |
118 | .Pp | 118 | .Pp |
119 | .Fn BN_zero , | 119 | .Fn BN_zero , |
120 | .Fn BN_one , | 120 | .Fn BN_one , |
@@ -146,8 +146,13 @@ in OpenSSL 0.9.7. | |||
146 | .Sh BUGS | 146 | .Sh BUGS |
147 | Someone might change the constant. | 147 | Someone might change the constant. |
148 | .Pp | 148 | .Pp |
149 | If a | 149 | If the value of a |
150 | .Vt BIGNUM | 150 | .Vt BIGNUM |
151 | is equal to 0xffffffffL; it can be represented as an | 151 | is equal to a |
152 | .Vt unsigned long | 152 | .Vt BN_ULONG |
153 | but this value is also returned on error. | 153 | with all bits set, the return value of |
154 | .Fn BN_get_word | ||
155 | collides with return value used to indicate errors. | ||
156 | .Pp | ||
157 | .Vt BN_ULONG | ||
158 | should probably be a typedef rather than a macro. | ||