summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschwarze <>2017-08-12 12:21:55 +0000
committerschwarze <>2017-08-12 12:21:55 +0000
commit1b502abd0159118e6e27e2b923f4962a5f41100b (patch)
treea70bb3543eae2ed940b51211f8e387a003fed199
parentc35a44085e856f5a17ea4c73404cd9315d5f3db0 (diff)
downloadopenbsd-1b502abd0159118e6e27e2b923f4962a5f41100b.tar.gz
openbsd-1b502abd0159118e6e27e2b923f4962a5f41100b.tar.bz2
openbsd-1b502abd0159118e6e27e2b923f4962a5f41100b.zip
Remove lots of outdated information found by jsing@.
OK jsing.
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3206
1 files changed, 14 insertions, 192 deletions
diff --git a/src/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3 b/src/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3
index e24a04992e..8a3c5fa413 100644
--- a/src/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3
+++ b/src/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: SSL_CTX_set_tmp_rsa_callback.3,v 1.3 2016/12/06 22:55:35 schwarze Exp $ 1.\" $OpenBSD: SSL_CTX_set_tmp_rsa_callback.3,v 1.4 2017/08/12 12:21:55 schwarze Exp $
2.\" OpenSSL 0b30fc90 Dec 19 15:23:05 2013 -0500 2.\" OpenSSL 0b30fc90 Dec 19 15:23:05 2013 -0500
3.\" 3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>. 4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
@@ -48,8 +48,8 @@
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 6 2016 $ 51.Dd $Mdocdate: August 12 2017 $
52.Dt SSL_CTX_SET_TMP_RSA_CALLBACK.POD 3 52.Dt SSL_CTX_SET_TMP_RSA_CALLBACK 3
53.Os 53.Os
54.Sh NAME 54.Sh NAME
55.Nm SSL_CTX_set_tmp_rsa_callback , 55.Nm SSL_CTX_set_tmp_rsa_callback ,
@@ -79,200 +79,22 @@
79.Fn SSL_set_tmp_rsa "SSL *ssl" "RSA *rsa" 79.Fn SSL_set_tmp_rsa "SSL *ssl" "RSA *rsa"
80.Ft long 80.Ft long
81.Fn SSL_need_tmp_rsa "SSL *ssl" 81.Fn SSL_need_tmp_rsa "SSL *ssl"
82.Ft RSA *
83.Fn "(*tmp_rsa_callback)" "SSL *ssl" "int is_export" "int keylength"
84.Sh DESCRIPTION 82.Sh DESCRIPTION
85.Fn SSL_CTX_set_tmp_rsa_callback 83Since they mattered only for deliberately insecure RSA authentication
86sets the callback function for 84mandated by historical U.S. export restrictions, these functions
87.Fa ctx 85are all deprecated and have no effect except that
88to be used when a temporary/ephemeral RSA key is required to 86.Fn SSL_CTX_set_tmp_rsa_callback ,
89.Fa tmp_rsa_callback . 87.Fn SSL_CTX_set_tmp_rsa ,
90The callback is inherited by all 88.Fn SSL_set_tmp_rsa_callback ,
91.Vt SSL
92objects newly created from
93.Fa ctx
94with
95.Xr SSL_new 3 .
96Already created SSL objects are not affected.
97.Pp
98.Fn SSL_CTX_set_tmp_rsa
99sets the temporary/ephemeral RSA key to be used to be
100.Fa rsa .
101The key is inherited by all
102.Vt SSL
103objects newly created from
104.Fa ctx
105with
106.Xr SSL_new 3 .
107Already created SSL objects are not affected.
108.Pp
109.Fn SSL_CTX_need_tmp_RSA
110returns 1,
111if a temporary/ephemeral RSA key is needed for RSA-based strength-limited
112.Sq exportable
113ciphersuites because a RSA key with a keysize larger than 512 bits is installed.
114.Pp
115.Fn SSL_set_tmp_rsa_callback
116sets the callback only for
117.Fa ssl .
118.Pp
119.Fn SSL_set_tmp_rsa
120sets the key only for
121.Fa ssl .
122.Pp
123.Fn SSL_need_tmp_rsa
124returns 1,
125if a temporary/ephemeral RSA key is needed for RSA-based strength-limited
126.Sq exportable
127ciphersuites because a RSA key with a keysize larger than 512 bits is installed.
128.Pp
129These functions apply to SSL/TLS servers only.
130.Sh NOTES
131When using a cipher with RSA authentication,
132an ephemeral RSA key exchange can take place.
133In this case the session data are negotiated using the ephemeral/temporary RSA
134key and the RSA key supplied and certified by the certificate chain is only
135used for signing.
136.Pp
137Under previous export restrictions, ciphers with RSA keys shorter (512 bits)
138than the usual key length of 1024 bits were created.
139To use these ciphers with RSA keys of usual length, an ephemeral key exchange
140must be performed, as the normal (certified) key cannot be directly used.
141.Pp
142Using ephemeral RSA key exchange yields forward secrecy,
143as the connection can only be decrypted when the RSA key is known.
144By generating a temporary RSA key inside the server application that is lost
145when the application is left, it becomes impossible for an attacker to decrypt
146past sessions, even if he gets hold of the normal (certified) RSA key,
147as this key was used for signing only.
148The downside is that creating a RSA key is computationally expensive.
149.Pp
150Additionally, the use of ephemeral RSA key exchange is only allowed in the TLS
151standard when the RSA key can be used for signing only, that is,
152for export ciphers.
153Using ephemeral RSA key exchange for other purposes violates the standard and
154can break interoperability with clients.
155It is therefore strongly recommended to not use ephemeral RSA key exchange and
156use DHE (Ephemeral Diffie-Hellman) key exchange instead in order to achieve
157forward secrecy (see
158.Xr SSL_CTX_set_tmp_dh_callback 3 ) .
159.Pp
160On OpenSSL servers ephemeral RSA key exchange is therefore disabled by default
161and must be explicitly enabled using the
162.Dv SSL_OP_EPHEMERAL_RSA
163option of
164.Xr SSL_CTX_set_options 3 ,
165violating the TLS/SSL
166standard.
167When ephemeral RSA key exchange is required for export ciphers,
168it will automatically be used without this option!
169.Pp
170An application may either directly specify the key or can supply the key via
171a callback function.
172The callback approach has the advantage that the callback may generate the key
173only in case it is actually needed.
174However, as the generation of a RSA key is costly,
175it will lead to a significant delay in the handshake procedure.
176Another advantage of the callback function is that it can supply keys of
177different size (e.g., for
178.Dv SSL_OP_EPHEMERAL_RSA
179usage) while the explicit setting of the key is only useful for key size of
180512 bits to satisfy the export restricted ciphers and does give away key length
181if a longer key would be allowed.
182.Pp
183The
184.Fa tmp_rsa_callback
185is called with the
186.Fa keylength
187needed and the
188.Fa is_export
189information.
190The
191.Fa is_export
192flag is set when the ephemeral RSA key exchange is performed with an export
193cipher.
194.Sh RETURN VALUES
195.Fn SSL_CTX_set_tmp_rsa_callback
196and
197.Fn SSL_set_tmp_rsa_callback
198do not return diagnostic output.
199.Pp
200.Fn SSL_CTX_set_tmp_rsa
201and 89and
202.Fn SSL_set_tmp_rsa 90.Fn SSL_set_tmp_rsa
203return 1 on success and 0 on failure. 91issue error messages when called.
204Check the error queue to find out the reason of failure. 92.Sh RETURN VALUES
205.Pp 93These functions always return 0, indicating failure.
206.Fn SSL_CTX_need_tmp_RSA
207and
208.Fn SSL_need_tmp_rsa
209return 1 if a temporary RSA key is needed and 0 otherwise.
210.Sh EXAMPLES
211Generate temporary RSA keys to prepare ephemeral RSA key exchange.
212As the generation of a RSA key costs a lot of computer time,
213they are saved for later reuse.
214For demonstration purposes, two keys for 512 bits and 1024 bits
215respectively are generated.
216.Bd -literal
217\&...
218
219/* Set up ephemeral RSA stuff */
220RSA *rsa_512 = NULL;
221RSA *rsa_1024 = NULL;
222
223rsa_512 = RSA_generate_key(512, RSA_F4, NULL, NULL);
224if (rsa_512 == NULL)
225 evaluate_error_queue();
226
227rsa_1024 = RSA_generate_key(1024, RSA_F4, NULL, NULL);
228if (rsa_1024 == NULL)
229 evaluate_error_queue();
230
231\&...
232
233RSA *
234tmp_rsa_callback(SSL *s, int is_export, int keylength)
235{
236 RSA *rsa_tmp = NULL;
237
238 switch (keylength) {
239 case 512:
240 if (rsa_512)
241 rsa_tmp = rsa_512;
242 else {
243 /*
244 * generate on the fly,
245 * should not happen in this example
246 */
247 rsa_tmp = RSA_generate_key(keylength, RSA_F4, NULL,
248 NULL);
249 rsa_512 = rsa_tmp; /* Remember for later reuse */
250 }
251 break;
252 case 1024:
253 if (rsa_1024)
254 rsa_tmp = rsa_1024;
255 else
256 should_not_happen_in_this_example();
257 break;
258 default:
259 /*
260 * Generating a key on the fly is very costly,
261 * so use what is there
262 */
263 if (rsa_1024)
264 rsa_tmp = rsa_1024;
265 else
266 /* Use at least a shorter key */
267 rsa_tmp = rsa_512;
268 }
269 return rsa_tmp;
270}
271.Ed
272.Sh SEE ALSO 94.Sh SEE ALSO
273.Xr openssl 1 ,
274.Xr ssl 3 , 95.Xr ssl 3 ,
275.Xr SSL_CTX_set_cipher_list 3 , 96.Xr SSL_CTX_set_cipher_list 3 ,
276.Xr SSL_CTX_set_options 3 , 97.Xr SSL_CTX_set_options 3 ,
277.Xr SSL_CTX_set_tmp_dh_callback 3 , 98.Xr SSL_CTX_set_tmp_dh_callback 3 ,
278.Xr SSL_new 3 99.Xr SSL_new 3 ,
100.Xr SSL_set_tmp_ecdh 3