summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorguenther <>2014-04-18 15:39:53 +0000
committerguenther <>2014-04-18 15:39:53 +0000
commit2cc456829e290c8c01ffd29532e961a810d0f05e (patch)
treecd56b260b305a9f3bcb8b4a84345694af61cb48e /src
parente5771c8113183d9900791e248265caa10e314025 (diff)
downloadopenbsd-2cc456829e290c8c01ffd29532e961a810d0f05e.tar.gz
openbsd-2cc456829e290c8c01ffd29532e961a810d0f05e.tar.bz2
openbsd-2cc456829e290c8c01ffd29532e961a810d0f05e.zip
Finish zapping SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION usage; only keep
the #define for compat, but document that it's a no-op now. Also, neuter the -legacy_renegotiation option to "openssl s_{client,server}" ok beck@
Diffstat (limited to 'src')
-rw-r--r--src/lib/libssl/s3_pkt.c3
-rw-r--r--src/lib/libssl/src/apps/s_client.c13
-rw-r--r--src/lib/libssl/src/apps/s_server.c3
-rw-r--r--src/lib/libssl/src/doc/ssl/SSL_CTX_set_options.pod22
-rw-r--r--src/lib/libssl/src/ssl/s3_pkt.c3
5 files changed, 19 insertions, 25 deletions
diff --git a/src/lib/libssl/s3_pkt.c b/src/lib/libssl/s3_pkt.c
index e901268a34..ec73ef50bd 100644
--- a/src/lib/libssl/s3_pkt.c
+++ b/src/lib/libssl/s3_pkt.c
@@ -1095,8 +1095,7 @@ start:
1095 (s->version > SSL3_VERSION) && 1095 (s->version > SSL3_VERSION) &&
1096 (s->s3->handshake_fragment_len >= 4) && 1096 (s->s3->handshake_fragment_len >= 4) &&
1097 (s->s3->handshake_fragment[0] == SSL3_MT_CLIENT_HELLO) && 1097 (s->s3->handshake_fragment[0] == SSL3_MT_CLIENT_HELLO) &&
1098 (s->session != NULL) && (s->session->cipher != NULL) && 1098 (s->session != NULL) && (s->session->cipher != NULL)) {
1099 !(s->ctx->options & SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION)) {
1100 /*s->s3->handshake_fragment_len = 0;*/ 1099 /*s->s3->handshake_fragment_len = 0;*/
1101 rr->length = 0; 1100 rr->length = 0;
1102 ssl3_send_alert(s, SSL3_AL_WARNING, SSL_AD_NO_RENEGOTIATION); 1101 ssl3_send_alert(s, SSL3_AL_WARNING, SSL_AD_NO_RENEGOTIATION);
diff --git a/src/lib/libssl/src/apps/s_client.c b/src/lib/libssl/src/apps/s_client.c
index 4290548de5..cbdba2ae52 100644
--- a/src/lib/libssl/src/apps/s_client.c
+++ b/src/lib/libssl/src/apps/s_client.c
@@ -334,7 +334,7 @@ sc_usage(void)
334 BIO_printf(bio_err, " -starttls prot - use the STARTTLS command before starting TLS\n"); 334 BIO_printf(bio_err, " -starttls prot - use the STARTTLS command before starting TLS\n");
335 BIO_printf(bio_err, " for those protocols that support it, where\n"); 335 BIO_printf(bio_err, " for those protocols that support it, where\n");
336 BIO_printf(bio_err, " 'prot' defines which one to assume. Currently,\n"); 336 BIO_printf(bio_err, " 'prot' defines which one to assume. Currently,\n");
337 BIO_printf(bio_err, " only \"smtp\", \"pop3\", \"imap\", \"ftp\" and \"xmpp\"\n"); 337 BIO_printf(bio_err, " only \"smtp\", \"lmtp\", \"pop3\", \"imap\", \"ftp\" and \"xmpp\"\n");
338 BIO_printf(bio_err, " are supported.\n"); 338 BIO_printf(bio_err, " are supported.\n");
339#ifndef OPENSSL_NO_ENGINE 339#ifndef OPENSSL_NO_ENGINE
340 BIO_printf(bio_err, " -engine id - Initialise and use the specified engine\n"); 340 BIO_printf(bio_err, " -engine id - Initialise and use the specified engine\n");
@@ -351,7 +351,6 @@ sc_usage(void)
351 BIO_printf(bio_err, " -nextprotoneg arg - enable NPN extension, considering named protocols supported (comma-separated list)\n"); 351 BIO_printf(bio_err, " -nextprotoneg arg - enable NPN extension, considering named protocols supported (comma-separated list)\n");
352#endif 352#endif
353#endif 353#endif
354 BIO_printf(bio_err, " -legacy_renegotiation - enable use of legacy renegotiation (dangerous)\n");
355#ifndef OPENSSL_NO_SRTP 354#ifndef OPENSSL_NO_SRTP
356 BIO_printf(bio_err, " -use_srtp profiles - Offer SRTP key management with a colon-separated profile list\n"); 355 BIO_printf(bio_err, " -use_srtp profiles - Offer SRTP key management with a colon-separated profile list\n");
357#endif 356#endif
@@ -535,6 +534,7 @@ next_proto_cb(SSL * s, unsigned char **out, unsigned char *outlen, const unsigne
535enum { 534enum {
536 PROTO_OFF = 0, 535 PROTO_OFF = 0,
537 PROTO_SMTP, 536 PROTO_SMTP,
537 PROTO_LMTP,
538 PROTO_POP3, 538 PROTO_POP3,
539 PROTO_IMAP, 539 PROTO_IMAP,
540 PROTO_FTP, 540 PROTO_FTP,
@@ -832,7 +832,7 @@ s_client_main(int argc, char **argv)
832 else if (strcmp(*argv, "-serverpref") == 0) 832 else if (strcmp(*argv, "-serverpref") == 0)
833 off |= SSL_OP_CIPHER_SERVER_PREFERENCE; 833 off |= SSL_OP_CIPHER_SERVER_PREFERENCE;
834 else if (strcmp(*argv, "-legacy_renegotiation") == 0) 834 else if (strcmp(*argv, "-legacy_renegotiation") == 0)
835 off |= SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION; 835 ; /* no-op */
836 else if (strcmp(*argv, "-legacy_server_connect") == 0) { 836 else if (strcmp(*argv, "-legacy_server_connect") == 0) {
837 off |= SSL_OP_LEGACY_SERVER_CONNECT; 837 off |= SSL_OP_LEGACY_SERVER_CONNECT;
838 } else if (strcmp(*argv, "-no_legacy_server_connect") == 0) { 838 } else if (strcmp(*argv, "-no_legacy_server_connect") == 0) {
@@ -853,6 +853,8 @@ s_client_main(int argc, char **argv)
853 ++argv; 853 ++argv;
854 if (strcmp(*argv, "smtp") == 0) 854 if (strcmp(*argv, "smtp") == 0)
855 starttls_proto = PROTO_SMTP; 855 starttls_proto = PROTO_SMTP;
856 else if (strcmp(*argv, "lmtp") == 0)
857 starttls_proto = PROTO_LMTP;
856 else if (strcmp(*argv, "pop3") == 0) 858 else if (strcmp(*argv, "pop3") == 0)
857 starttls_proto = PROTO_POP3; 859 starttls_proto = PROTO_POP3;
858 else if (strcmp(*argv, "imap") == 0) 860 else if (strcmp(*argv, "imap") == 0)
@@ -1287,7 +1289,7 @@ re_start:
1287 * push a buffering BIO into the chain that is removed again later on 1289 * push a buffering BIO into the chain that is removed again later on
1288 * to not disturb the rest of the s_client operation. 1290 * to not disturb the rest of the s_client operation.
1289 */ 1291 */
1290 if (starttls_proto == PROTO_SMTP) { 1292 if (starttls_proto == PROTO_SMTP || starttls_proto == PROTO_LMTP) {
1291 int foundit = 0; 1293 int foundit = 0;
1292 BIO *fbio = BIO_new(BIO_f_buffer()); 1294 BIO *fbio = BIO_new(BIO_f_buffer());
1293 BIO_push(fbio, sbio); 1295 BIO_push(fbio, sbio);
@@ -1297,7 +1299,8 @@ re_start:
1297 } 1299 }
1298 while (mbuf_len > 3 && mbuf[3] == '-'); 1300 while (mbuf_len > 3 && mbuf[3] == '-');
1299 /* STARTTLS command requires EHLO... */ 1301 /* STARTTLS command requires EHLO... */
1300 BIO_printf(fbio, "EHLO openssl.client.net\r\n"); 1302 BIO_printf(fbio, "%cHLO openssl.client.net\r\n",
1303 starttls_proto == PROTO_SMTP ? 'E' : 'L');
1301 (void) BIO_flush(fbio); 1304 (void) BIO_flush(fbio);
1302 /* wait for multi-line response to end EHLO SMTP response */ 1305 /* wait for multi-line response to end EHLO SMTP response */
1303 do { 1306 do {
diff --git a/src/lib/libssl/src/apps/s_server.c b/src/lib/libssl/src/apps/s_server.c
index 27925b492d..a84b822538 100644
--- a/src/lib/libssl/src/apps/s_server.c
+++ b/src/lib/libssl/src/apps/s_server.c
@@ -525,7 +525,6 @@ sv_usage(void)
525 BIO_printf(bio_err, " not specified (default is %s)\n", TEST_CERT2); 525 BIO_printf(bio_err, " not specified (default is %s)\n", TEST_CERT2);
526 BIO_printf(bio_err, " -tlsextdebug - hex dump of all TLS extensions received\n"); 526 BIO_printf(bio_err, " -tlsextdebug - hex dump of all TLS extensions received\n");
527 BIO_printf(bio_err, " -no_ticket - disable use of RFC4507bis session tickets\n"); 527 BIO_printf(bio_err, " -no_ticket - disable use of RFC4507bis session tickets\n");
528 BIO_printf(bio_err, " -legacy_renegotiation - enable use of legacy renegotiation (dangerous)\n");
529#ifndef OPENSSL_NO_NEXTPROTONEG 528#ifndef OPENSSL_NO_NEXTPROTONEG
530 BIO_printf(bio_err, " -nextprotoneg arg - set the advertised protocols for the NPN extension (comma-separated list)\n"); 529 BIO_printf(bio_err, " -nextprotoneg arg - set the advertised protocols for the NPN extension (comma-separated list)\n");
531#endif 530#endif
@@ -904,7 +903,7 @@ s_server_main(int argc, char *argv[])
904 else if (strcmp(*argv, "-serverpref") == 0) { 903 else if (strcmp(*argv, "-serverpref") == 0) {
905 off |= SSL_OP_CIPHER_SERVER_PREFERENCE; 904 off |= SSL_OP_CIPHER_SERVER_PREFERENCE;
906 } else if (strcmp(*argv, "-legacy_renegotiation") == 0) 905 } else if (strcmp(*argv, "-legacy_renegotiation") == 0)
907 off |= SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION; 906 ; /* no-op */
908 else if (strcmp(*argv, "-cipher") == 0) { 907 else if (strcmp(*argv, "-cipher") == 0) {
909 if (--argc < 1) 908 if (--argc < 1)
910 goto bad; 909 goto bad;
diff --git a/src/lib/libssl/src/doc/ssl/SSL_CTX_set_options.pod b/src/lib/libssl/src/doc/ssl/SSL_CTX_set_options.pod
index fded0601b5..d932282551 100644
--- a/src/lib/libssl/src/doc/ssl/SSL_CTX_set_options.pod
+++ b/src/lib/libssl/src/doc/ssl/SSL_CTX_set_options.pod
@@ -216,8 +216,10 @@ not be used by clients or servers.
216 216
217=item SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION 217=item SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION
218 218
219Allow legacy insecure renegotiation between OpenSSL and unpatched clients or 219As of OpenBSD 5.6, this option has no effect.
220servers. See the B<SECURE RENEGOTIATION> section for more details. 220In previous versions it allowed legacy insecure renegotiation between
221OpenSSL and unpatched clients or servers.
222See the B<SECURE RENEGOTIATION> section for more details.
221 223
222=item SSL_OP_LEGACY_SERVER_CONNECT 224=item SSL_OP_LEGACY_SERVER_CONNECT
223 225
@@ -258,9 +260,6 @@ If the patched OpenSSL server attempts to renegotiate a fatal
258B<handshake_failure> alert is sent. This is because the server code may be 260B<handshake_failure> alert is sent. This is because the server code may be
259unaware of the unpatched nature of the client. 261unaware of the unpatched nature of the client.
260 262
261If the option B<SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION> is set then
262renegotiation B<always> succeeds.
263
264B<NB:> a bug in OpenSSL clients earlier than 0.9.8m (all of which are 263B<NB:> a bug in OpenSSL clients earlier than 0.9.8m (all of which are
265unpatched) will result in the connection hanging if it receives a 264unpatched) will result in the connection hanging if it receives a
266B<no_renegotiation> alert. OpenSSL versions 0.9.8m and later will regard 265B<no_renegotiation> alert. OpenSSL versions 0.9.8m and later will regard
@@ -271,8 +270,7 @@ was refused.
271 270
272=head2 Patched OpenSSL client and unpatched server. 271=head2 Patched OpenSSL client and unpatched server.
273 272
274If the option B<SSL_OP_LEGACY_SERVER_CONNECT> or 273If the option B<SSL_OP_LEGACY_SERVER_CONNECT> is set then initial connections
275B<SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION> is set then initial connections
276and renegotiation between patched OpenSSL clients and unpatched servers 274and renegotiation between patched OpenSSL clients and unpatched servers
277succeeds. If neither option is set then initial connections to unpatched 275succeeds. If neither option is set then initial connections to unpatched
278servers will fail. 276servers will fail.
@@ -295,13 +293,6 @@ unpatched servers (and thus avoid any security issues) should always B<clear>
295B<SSL_OP_LEGACY_SERVER_CONNECT> using SSL_CTX_clear_options() or 293B<SSL_OP_LEGACY_SERVER_CONNECT> using SSL_CTX_clear_options() or
296SSL_clear_options(). 294SSL_clear_options().
297 295
298The difference between the B<SSL_OP_LEGACY_SERVER_CONNECT> and
299B<SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION> options is that
300B<SSL_OP_LEGACY_SERVER_CONNECT> enables initial connections and secure
301renegotiation between OpenSSL clients and unpatched servers B<only>, while
302B<SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION> allows initial connections
303and renegotiation between OpenSSL and unpatched clients or servers.
304
305=head1 RETURN VALUES 296=head1 RETURN VALUES
306 297
307SSL_CTX_set_options() and SSL_set_options() return the new options bitmask 298SSL_CTX_set_options() and SSL_set_options() return the new options bitmask
@@ -344,4 +335,7 @@ B<SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION>, B<SSL_OP_LEGACY_SERVER_CONNECT>
344and the function SSL_get_secure_renegotiation_support() were first added in 335and the function SSL_get_secure_renegotiation_support() were first added in
345OpenSSL 0.9.8m. 336OpenSSL 0.9.8m.
346 337
338B<SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION> was changed to have no effect
339in OpenBSD 5.6.
340
347=cut 341=cut
diff --git a/src/lib/libssl/src/ssl/s3_pkt.c b/src/lib/libssl/src/ssl/s3_pkt.c
index e901268a34..ec73ef50bd 100644
--- a/src/lib/libssl/src/ssl/s3_pkt.c
+++ b/src/lib/libssl/src/ssl/s3_pkt.c
@@ -1095,8 +1095,7 @@ start:
1095 (s->version > SSL3_VERSION) && 1095 (s->version > SSL3_VERSION) &&
1096 (s->s3->handshake_fragment_len >= 4) && 1096 (s->s3->handshake_fragment_len >= 4) &&
1097 (s->s3->handshake_fragment[0] == SSL3_MT_CLIENT_HELLO) && 1097 (s->s3->handshake_fragment[0] == SSL3_MT_CLIENT_HELLO) &&
1098 (s->session != NULL) && (s->session->cipher != NULL) && 1098 (s->session != NULL) && (s->session->cipher != NULL)) {
1099 !(s->ctx->options & SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION)) {
1100 /*s->s3->handshake_fragment_len = 0;*/ 1099 /*s->s3->handshake_fragment_len = 0;*/
1101 rr->length = 0; 1100 rr->length = 0;
1102 ssl3_send_alert(s, SSL3_AL_WARNING, SSL_AD_NO_RENEGOTIATION); 1101 ssl3_send_alert(s, SSL3_AL_WARNING, SSL_AD_NO_RENEGOTIATION);