Skip to content

Commit 3c33c6f

Browse files
committed
Remove support for SSL_OP_NETSCAPE_CA_DN_BUG.
This is an ancient bug workaround for Netscape clients. The documentation talks about versions 3.x and 4.x beta. Reviewed-by: Tim Hudson <[email protected]>
1 parent ae63297 commit 3c33c6f

4 files changed

Lines changed: 9 additions & 35 deletions

File tree

doc/ssl/SSL_CTX_set_options.pod

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,6 @@ will send its list of preferences to the client and the client chooses.
169169

170170
...
171171

172-
=item SSL_OP_NETSCAPE_CA_DN_BUG
173-
174-
If we accept a netscape connection, demand a client cert, have a
175-
non-self-signed CA which does not have its CA in netscape, and the
176-
browser has a cert, it will crash/hang. Works for 3.x and 4.xbeta
177172

178173
=item SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG
179174

ssl/s3_clnt.c

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2109,8 +2109,6 @@ int ssl3_get_certificate_request(SSL *s)
21092109
for (nc = 0; nc < llen;) {
21102110
n2s(p, l);
21112111
if ((l + nc + 2) > llen) {
2112-
if ((s->options & SSL_OP_NETSCAPE_CA_DN_BUG))
2113-
goto cont; /* netscape bugs */
21142112
ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR);
21152113
SSLerr(SSL_F_SSL3_GET_CERTIFICATE_REQUEST, SSL_R_CA_DN_TOO_LONG);
21162114
goto err;
@@ -2119,14 +2117,9 @@ int ssl3_get_certificate_request(SSL *s)
21192117
q = p;
21202118

21212119
if ((xn = d2i_X509_NAME(NULL, &q, l)) == NULL) {
2122-
/* If netscape tolerance is on, ignore errors */
2123-
if (s->options & SSL_OP_NETSCAPE_CA_DN_BUG)
2124-
goto cont;
2125-
else {
2126-
ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR);
2127-
SSLerr(SSL_F_SSL3_GET_CERTIFICATE_REQUEST, ERR_R_ASN1_LIB);
2128-
goto err;
2129-
}
2120+
ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR);
2121+
SSLerr(SSL_F_SSL3_GET_CERTIFICATE_REQUEST, ERR_R_ASN1_LIB);
2122+
goto err;
21302123
}
21312124

21322125
if (q != (p + l)) {
@@ -2144,11 +2137,6 @@ int ssl3_get_certificate_request(SSL *s)
21442137
nc += l + 2;
21452138
}
21462139

2147-
if (0) {
2148-
cont:
2149-
ERR_clear_error();
2150-
}
2151-
21522140
/* we should setup a certificate to return.... */
21532141
s->s3->tmp.cert_req = 1;
21542142
s->s3->tmp.ctype_num = ctype_num;

ssl/s3_srvr.c

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2056,20 +2056,10 @@ int ssl3_send_certificate_request(SSL *s)
20562056
goto err;
20572057
}
20582058
p = ssl_handshake_start(s) + n;
2059-
if (!(s->options & SSL_OP_NETSCAPE_CA_DN_BUG)) {
2060-
s2n(j, p);
2061-
i2d_X509_NAME(name, &p);
2062-
n += 2 + j;
2063-
nl += 2 + j;
2064-
} else {
2065-
d = p;
2066-
i2d_X509_NAME(name, &p);
2067-
j -= 2;
2068-
s2n(j, d);
2069-
j += 2;
2070-
n += j;
2071-
nl += j;
2072-
}
2059+
s2n(j, p);
2060+
i2d_X509_NAME(name, &p);
2061+
n += 2 + j;
2062+
nl += 2 + j;
20732063
}
20742064
}
20752065
/* else no CA names */

ssl/ssl.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,8 @@ typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type,
478478
# define SSL_OP_PKCS1_CHECK_1 0x0
479479
# define SSL_OP_PKCS1_CHECK_2 0x0
480480

481-
# define SSL_OP_NETSCAPE_CA_DN_BUG 0x20000000L
481+
/* Removed as of OpenSSL 1.1.0 */
482+
# define SSL_OP_NETSCAPE_CA_DN_BUG 0x0
482483
# define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x40000000L
483484
/*
484485
* Make server add server-hello extension from early version of cryptopro

0 commit comments

Comments
 (0)