summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorschwarze <>2018-04-18 01:07:38 +0000
committerschwarze <>2018-04-18 01:07:38 +0000
commit3853161947bef78ac2c0d8634299a75cea982c4c (patch)
tree973ad8bc910e76d0653fd3a236b72173cd228808 /src
parent2fb49f4f518d023f648fcb1aa6d0c6a4dd10f80c (diff)
downloadopenbsd-3853161947bef78ac2c0d8634299a75cea982c4c.tar.gz
openbsd-3853161947bef78ac2c0d8634299a75cea982c4c.tar.bz2
openbsd-3853161947bef78ac2c0d8634299a75cea982c4c.zip
* Do not document the non-existent function RSA_null_method(3).
* Add three missing const qualifiers to function prototypes. * Correct the argument type of RSA_new_method(3). * Remove duplicate decsription of RSA_flags(3) and RSA_new_method(3). * Make the description of method selection simpler, more precise, and more concise. * Correct description of the return value of RSA_set_method(3). * Stop referencing engine(3).
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/man/RSA_set_method.3148
1 files changed, 43 insertions, 105 deletions
diff --git a/src/lib/libcrypto/man/RSA_set_method.3 b/src/lib/libcrypto/man/RSA_set_method.3
index 9c5314e6f2..b4724e3e6d 100644
--- a/src/lib/libcrypto/man/RSA_set_method.3
+++ b/src/lib/libcrypto/man/RSA_set_method.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: RSA_set_method.3,v 1.11 2018/03/27 17:35:50 schwarze Exp $ 1.\" $OpenBSD: RSA_set_method.3,v 1.12 2018/04/18 01:07:38 schwarze Exp $
2.\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 2.\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
3.\" 3.\"
4.\" This file was written by Ulf Moeller <ulf@openssl.org> 4.\" This file was written by Ulf Moeller <ulf@openssl.org>
@@ -50,7 +50,7 @@
50.\" 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
51.\" OF THE POSSIBILITY OF SUCH DAMAGE. 51.\" OF THE POSSIBILITY OF SUCH DAMAGE.
52.\" 52.\"
53.Dd $Mdocdate: March 27 2018 $ 53.Dd $Mdocdate: April 18 2018 $
54.Dt RSA_SET_METHOD 3 54.Dt RSA_SET_METHOD 3
55.Os 55.Os
56.Sh NAME 56.Sh NAME
@@ -59,7 +59,6 @@
59.Nm RSA_set_method , 59.Nm RSA_set_method ,
60.Nm RSA_get_method , 60.Nm RSA_get_method ,
61.Nm RSA_PKCS1_SSLeay , 61.Nm RSA_PKCS1_SSLeay ,
62.Nm RSA_null_method ,
63.Nm RSA_flags , 62.Nm RSA_flags ,
64.Nm RSA_new_method 63.Nm RSA_new_method
65.Nd select RSA method 64.Nd select RSA method
@@ -69,78 +68,65 @@
69.Fo RSA_set_default_method 68.Fo RSA_set_default_method
70.Fa "const RSA_METHOD *meth" 69.Fa "const RSA_METHOD *meth"
71.Fc 70.Fc
72.Ft RSA_METHOD * 71.Ft const RSA_METHOD *
73.Fn RSA_get_default_method void 72.Fn RSA_get_default_method void
74.Ft int 73.Ft int
75.Fo RSA_set_method 74.Fo RSA_set_method
76.Fa "RSA *rsa" 75.Fa "RSA *rsa"
77.Fa "const RSA_METHOD *meth" 76.Fa "const RSA_METHOD *meth"
78.Fc 77.Fc
79.Ft RSA_METHOD * 78.Ft const RSA_METHOD *
80.Fo RSA_get_method 79.Fo RSA_get_method
81.Fa "const RSA *rsa" 80.Fa "const RSA *rsa"
82.Fc 81.Fc
83.Ft RSA_METHOD * 82.Ft const RSA_METHOD *
84.Fn RSA_PKCS1_SSLeay void 83.Fn RSA_PKCS1_SSLeay void
85.Ft RSA_METHOD *
86.Fn RSA_null_method void
87.Ft int 84.Ft int
88.Fo RSA_flags 85.Fo RSA_flags
89.Fa "const RSA *rsa" 86.Fa "const RSA *rsa"
90.Fc 87.Fc
91.Ft RSA * 88.Ft RSA *
92.Fo RSA_new_method 89.Fo RSA_new_method
93.Fa "RSA_METHOD *meth" 90.Fa "ENGINE *engine"
94.Fc 91.Fc
95.Sh DESCRIPTION 92.Sh DESCRIPTION
96An 93An
97.Vt RSA_METHOD 94.Vt RSA_METHOD
98specifies the functions that OpenSSL uses for RSA operations. 95object contains pointers to the functions used for RSA operations.
99By modifying the method, alternative implementations such as hardware 96By default, the internal implementation returned by
100accelerators may be used. 97.Fn RSA_PKCS1_SSLeay
101See the 98is used.
102.Sx CAVEATS 99By selecting another method, alternative implementations
103section for how these RSA API functions are affected by the use of 100such as hardware accelerators may be used.
104.Xr engine 3
105API calls.
106.Pp
107Initially, the default
108.Vt RSA_METHOD
109is the OpenSSL internal implementation, as returned by
110.Fn RSA_PKCS1_SSLeay .
111.Pp 101.Pp
112.Fn RSA_set_default_method 102.Fn RSA_set_default_method
113makes 103selects
114.Fa meth 104.Fa meth
115the default method for all 105as the default method for all
116.Vt RSA 106.Vt RSA
117structures created later. 107structures created later.
118.Sy NB : 108If any
119This is true only whilst no
120.Vt ENGINE 109.Vt ENGINE
121has been set as a default for RSA, so this function is no longer 110was registered with
122recommended. 111.Xr ENGINE_register_RSA 3
112that can be successfully initialized, it overrides the default.
123.Pp 113.Pp
124.Fn RSA_get_default_method 114.Fn RSA_get_default_method
125returns a pointer to the current default 115returns a pointer to the current default method,
126.Vt RSA_METHOD . 116even if it is actually overridded by an
127However, the meaningfulness of this result is dependent on whether 117.Vt ENGINE .
128the
129.Xr engine 3
130API is being used, so this function is no longer recommended.
131.Pp 118.Pp
132.Fn RSA_set_method 119.Fn RSA_set_method
133selects 120selects
134.Fa meth 121.Fa meth
135to perform all operations using the key 122to perform all operations using the key
136.Fa rsa . 123.Fa rsa .
137This will replace the 124This replaces the
138.Vt RSA_METHOD 125.Vt RSA_METHOD
139used by the RSA key, and if the previous method was supplied by an 126used by the RSA key, and if the previous method was supplied by an
140.Vt ENGINE , 127.Vt ENGINE ,
141the handle to that 128.Xr ENGINE_finish 3
142.Vt ENGINE 129is called on it.
143will be released during the change.
144It is possible to have RSA keys that only work with certain 130It is possible to have RSA keys that only work with certain
145.Vt RSA_METHOD 131.Vt RSA_METHOD
146implementations (e.g. from an 132implementations (e.g. from an
@@ -175,34 +161,23 @@ section.
175allocates and initializes an 161allocates and initializes an
176.Vt RSA 162.Vt RSA
177structure so that 163structure so that
178.Fa meth 164.Fa engine
179will be used for the RSA operations. 165is used for the RSA operations.
180If 166If
181.Sy engine 167.Fa engine
182is NULL, the default ENGINE for RSA operations is used and, if no 168is
183default ENGINE is set, the RSA_METHOD controlled by 169.Dv NULL ,
170.Xr ENGINE_get_default_RSA 3
171is used.
172If that returns
173.Dv NULL ,
174the default method controlled by
184.Fn RSA_set_default_method 175.Fn RSA_set_default_method
185is used. 176is used.
186.Pp 177.Pp
187.Fn RSA_flags 178The
188returns the 179.Dv RSA_METHOD
189.Sy flags 180structure is defined as follows:
190that are set for
191.Fa rsa Ns 's
192current method.
193.Pp
194.Fn RSA_new_method
195allocates and initializes an
196.Vt RSA
197structure so that
198.Fa meth
199will be used for the RSA operations.
200If
201.Fa meth
202is
203.Dv NULL ,
204the default method is used.
205.Sh THE RSA_METHOD STRUCTURE
206.Bd -literal 181.Bd -literal
207typedef struct rsa_meth_st 182typedef struct rsa_meth_st
208{ 183{
@@ -265,30 +240,15 @@ typedef struct rsa_meth_st
265.Ed 240.Ed
266.Sh RETURN VALUES 241.Sh RETURN VALUES
267.Fn RSA_PKCS1_SSLeay , 242.Fn RSA_PKCS1_SSLeay ,
268.Fn RSA_null_method , 243.Fn RSA_get_default_method ,
269.Fn RSA_get_default_method
270and 244and
271.Fn RSA_get_method 245.Fn RSA_get_method
272return pointers to the respective 246return pointers to the respective
273.Vt RSA_METHOD . 247.Vt RSA_METHOD .
274.Pp 248.Pp
275.Fn RSA_set_method 249.Fn RSA_set_method
276returns a pointer to the old 250returns 1 on success or 0 on failure.
277.Vt RSA_METHOD 251Currently, it cannot fail.
278implementation that was replaced.
279However, this return value should probably be ignored because if it was
280supplied by an
281.Vt ENGINE ,
282the pointer could be invalidated at any time if the
283.Vt ENGINE
284is unloaded.
285In fact, it could be unloaded as a result of the
286.Fn RSA_set_method
287function releasing its handle to the
288.Vt ENGINE .
289For this reason, the return type may be replaced with a
290.Vt void
291declaration in a future release.
292.Pp 252.Pp
293.Fn RSA_new_method 253.Fn RSA_new_method
294returns 254returns
@@ -298,6 +258,9 @@ and sets an error code that can be obtained by
298if the allocation fails. 258if the allocation fails.
299Otherwise it returns a pointer to the newly allocated structure. 259Otherwise it returns a pointer to the newly allocated structure.
300.Sh SEE ALSO 260.Sh SEE ALSO
261.Xr ENGINE_get_default_RSA 3 ,
262.Xr ENGINE_register_RSA 3 ,
263.Xr ENGINE_set_default_RSA 3 ,
301.Xr RSA_meth_new 3 , 264.Xr RSA_meth_new 3 ,
302.Xr RSA_new 3 265.Xr RSA_new 3
303.Sh HISTORY 266.Sh HISTORY
@@ -323,31 +286,6 @@ components of
323.Vt RSA_METHOD 286.Vt RSA_METHOD
324first appeared in OpenSSL 0.9.4 and have been available since 287first appeared in OpenSSL 0.9.4 and have been available since
325.Ox 2.6 . 288.Ox 2.6 .
326.Pp
327.Fn RSA_null_method
328first appeared in OpenSSL 0.9.5 and has been available since
329.Ox 2.7 .
330.Sh CAVEATS
331As of version 0.9.7,
332.Vt RSA_METHOD
333implementations are grouped together with other algorithmic APIs (e.g.\&
334.Vt DSA_METHOD
335or
336.Vt EVP_CIPHER )
337into
338.Vt ENGINE
339modules.
340If a default
341.Vt ENGINE
342is specified for RSA functionality using an
343.Xr engine 3
344API function, that will override any RSA defaults set using the RSA
345API, i.e.\&
346.Fn RSA_set_default_method .
347For this reason, the
348.Xr engine 3
349API is the recommended way to control default implementations for
350use in RSA and other cryptographic algorithms.
351.Sh BUGS 289.Sh BUGS
352The behaviour of 290The behaviour of
353.Fn RSA_flags 291.Fn RSA_flags