Skip to content

Commit 7a4dadc

Browse files
committed
Removed support for SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG. Also removed
the "-hack" option from s_server that set this option. Reviewed-by: Tim Hudson <tjh@openssl.org>
1 parent f781249 commit 7a4dadc

File tree

5 files changed

+3
-81
lines changed

5 files changed

+3
-81
lines changed

apps/s_server.c

-47
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ static int s_brief = 0;
266266
static char *keymatexportlabel = NULL;
267267
static int keymatexportlen = 20;
268268

269-
static int hack = 0;
270269
#ifndef OPENSSL_NO_ENGINE
271270
static char *engine_id = NULL;
272271
#endif
@@ -423,7 +422,6 @@ static void s_server_init(void)
423422
s_msg = 0;
424423
s_quiet = 0;
425424
s_brief = 0;
426-
hack = 0;
427425
# ifndef OPENSSL_NO_ENGINE
428426
engine_id = NULL;
429427
# endif
@@ -553,8 +551,6 @@ static void sv_usage(void)
553551
BIO_printf(bio_err,
554552
"-no_resume_ephemeral - Disable caching and tickets if ephemeral (EC)DH is used\n");
555553
BIO_printf(bio_err, " -bugs - Turn on SSL bug compatibility\n");
556-
BIO_printf(bio_err,
557-
" -hack - workaround for early Netscape code\n");
558554
BIO_printf(bio_err,
559555
" -www - Respond to a 'GET /' with a status page\n");
560556
BIO_printf(bio_err,
@@ -1333,8 +1329,6 @@ int MAIN(int argc, char *argv[])
13331329
sdebug = 1;
13341330
} else if (strcmp(*argv, "-security_debug_verbose") == 0) {
13351331
sdebug = 2;
1336-
} else if (strcmp(*argv, "-hack") == 0) {
1337-
hack = 1;
13381332
} else if (strcmp(*argv, "-state") == 0) {
13391333
state = 1;
13401334
} else if (strcmp(*argv, "-crlf") == 0) {
@@ -1712,8 +1706,6 @@ int MAIN(int argc, char *argv[])
17121706
BIO_printf(bio_err, "id_prefix '%s' set.\n", session_id_prefix);
17131707
}
17141708
SSL_CTX_set_quiet_shutdown(ctx, 1);
1715-
if (hack)
1716-
SSL_CTX_set_options(ctx, SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG);
17171709
if (exc)
17181710
ssl_ctx_set_excert(ctx, exc);
17191711

@@ -1777,8 +1769,6 @@ int MAIN(int argc, char *argv[])
17771769
BIO_printf(bio_err, "id_prefix '%s' set.\n", session_id_prefix);
17781770
}
17791771
SSL_CTX_set_quiet_shutdown(ctx2, 1);
1780-
if (hack)
1781-
SSL_CTX_set_options(ctx2, SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG);
17821772
if (exc)
17831773
ssl_ctx_set_excert(ctx2, exc);
17841774

@@ -2729,43 +2719,6 @@ static int www_body(char *hostname, int s, int stype, unsigned char *context)
27292719
}
27302720

27312721
for (;;) {
2732-
if (hack) {
2733-
i = SSL_accept(con);
2734-
#ifndef OPENSSL_NO_SRP
2735-
while (i <= 0
2736-
&& SSL_get_error(con, i) == SSL_ERROR_WANT_X509_LOOKUP) {
2737-
BIO_printf(bio_s_out, "LOOKUP during accept %s\n",
2738-
srp_callback_parm.login);
2739-
srp_callback_parm.user =
2740-
SRP_VBASE_get_by_user(srp_callback_parm.vb,
2741-
srp_callback_parm.login);
2742-
if (srp_callback_parm.user)
2743-
BIO_printf(bio_s_out, "LOOKUP done %s\n",
2744-
srp_callback_parm.user->info);
2745-
else
2746-
BIO_printf(bio_s_out, "LOOKUP not successful\n");
2747-
i = SSL_accept(con);
2748-
}
2749-
#endif
2750-
switch (SSL_get_error(con, i)) {
2751-
case SSL_ERROR_NONE:
2752-
break;
2753-
case SSL_ERROR_WANT_WRITE:
2754-
case SSL_ERROR_WANT_READ:
2755-
case SSL_ERROR_WANT_X509_LOOKUP:
2756-
continue;
2757-
case SSL_ERROR_SYSCALL:
2758-
case SSL_ERROR_SSL:
2759-
case SSL_ERROR_ZERO_RETURN:
2760-
ret = 1;
2761-
goto err;
2762-
/* break; */
2763-
}
2764-
2765-
SSL_renegotiate(con);
2766-
SSL_write(con, NULL, 0);
2767-
}
2768-
27692722
i = BIO_gets(io, buf, bufsize - 1);
27702723
if (i < 0) { /* error */
27712724
if (!BIO_should_retry(io)) {

doc/apps/s_server.pod

-6
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ B<openssl> B<s_server>
7373
[B<-no_ecdhe>]
7474
[B<-bugs>]
7575
[B<-brief>]
76-
[B<-hack>]
7776
[B<-www>]
7877
[B<-WWW>]
7978
[B<-HTTP>]
@@ -294,11 +293,6 @@ option enables various workarounds.
294293
only provide a brief summary of connection parameters instead of the
295294
normal verbose output.
296295

297-
=item B<-hack>
298-
299-
this option enables a further workaround for some some early Netscape
300-
SSL code (?).
301-
302296
=item B<-cipher cipherlist>
303297

304298
this allows the cipher list used by the server to be modified. When

doc/ssl/SSL_CTX_set_options.pod

-3
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,6 @@ will send its list of preferences to the client and the client chooses.
170170
...
171171

172172

173-
=item SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG
174-
175-
...
176173

177174
=item SSL_OP_NO_SSLv2
178175

ssl/s3_srvr.c

+1-24
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@
148148
* OTHERWISE.
149149
*/
150150

151-
#define REUSE_CIPHER_BUG
152151
#define NETSCAPE_HANG_BUG
153152

154153
#include <stdio.h>
@@ -1384,29 +1383,7 @@ int ssl3_get_client_hello(SSL *s)
13841383
s->tlsext_ticket_expected = 0;
13851384
} else {
13861385
/* Session-id reuse */
1387-
#ifdef REUSE_CIPHER_BUG
1388-
STACK_OF(SSL_CIPHER) *sk;
1389-
SSL_CIPHER *nc = NULL;
1390-
SSL_CIPHER *ec = NULL;
1391-
1392-
if (s->options & SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG) {
1393-
sk = s->session->ciphers;
1394-
for (i = 0; i < sk_SSL_CIPHER_num(sk); i++) {
1395-
c = sk_SSL_CIPHER_value(sk, i);
1396-
if (c->algorithm_enc & SSL_eNULL)
1397-
nc = c;
1398-
if (SSL_C_IS_EXPORT(c))
1399-
ec = c;
1400-
}
1401-
if (nc != NULL)
1402-
s->s3->tmp.new_cipher = nc;
1403-
else if (ec != NULL)
1404-
s->s3->tmp.new_cipher = ec;
1405-
else
1406-
s->s3->tmp.new_cipher = s->session->cipher;
1407-
} else
1408-
#endif
1409-
s->s3->tmp.new_cipher = s->session->cipher;
1386+
s->s3->tmp.new_cipher = s->session->cipher;
14101387
}
14111388

14121389
if (!SSL_USE_SIGALGS(s) || !(s->verify_mode & SSL_VERIFY_PEER)) {

ssl/ssl.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,8 @@ typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type,
480480

481481
/* Removed as of OpenSSL 1.1.0 */
482482
# define SSL_OP_NETSCAPE_CA_DN_BUG 0x0
483-
# define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x40000000L
483+
/* Removed as of OpenSSL 1.1.0 */
484+
# define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x0L
484485
/*
485486
* Make server add server-hello extension from early version of cryptopro
486487
* draft, when GOST ciphersuite is negotiated. Required for interoperability

0 commit comments

Comments
 (0)