-
Notifications
You must be signed in to change notification settings - Fork 610
Bug 5133: OpenSSL 3.0 support #694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0591829
4dd37f3
5564eb4
b787e70
e290d6c
b98cd0f
34d6c44
be2c0e8
743fa75
a9e367d
df2d57e
cc0ab60
fe02c2b
6834979
add1846
55d159c
b993bce
27bba66
929cfba
fd264d0
434a238
9e9547d
5d2e616
ee3948c
dee21be
ed96b56
743ea80
955b86f
aef550c
53e3404
754c2d1
599d44a
6781d41
cb99ce7
7badc4c
940efa1
d4a42e7
ae08044
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -293,134 +293,134 @@ Security::PeerOptions::createClientContext(bool setOptions) | |
| /// set of options we can parse and what they map to | ||
| static struct ssl_option { | ||
| const char *name; | ||
| long value; | ||
| Security::ParsedOptions value; | ||
|
|
||
rousskov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } ssl_options[] = { | ||
|
|
||
| #if SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG | ||
| #if defined(SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG) | ||
rousskov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| { | ||
| "NETSCAPE_REUSE_CIPHER_CHANGE_BUG", SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG | ||
| }, | ||
| #endif | ||
| #if SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG | ||
| #if defined(SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG) | ||
| { | ||
| "SSLREF2_REUSE_CERT_TYPE_BUG", SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG | ||
| }, | ||
| #endif | ||
| #if SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER | ||
| #if defined(SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER) | ||
| { | ||
| "MICROSOFT_BIG_SSLV3_BUFFER", SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER | ||
| }, | ||
| #endif | ||
| #if SSL_OP_SSLEAY_080_CLIENT_DH_BUG | ||
| #if defined(SSL_OP_SSLEAY_080_CLIENT_DH_BUG) | ||
| { | ||
| "SSLEAY_080_CLIENT_DH_BUG", SSL_OP_SSLEAY_080_CLIENT_DH_BUG | ||
| }, | ||
| #endif | ||
| #if SSL_OP_TLS_D5_BUG | ||
| #if defined(SSL_OP_TLS_D5_BUG) | ||
| { | ||
| "TLS_D5_BUG", SSL_OP_TLS_D5_BUG | ||
| }, | ||
| #endif | ||
| #if SSL_OP_TLS_BLOCK_PADDING_BUG | ||
| #if defined(SSL_OP_TLS_BLOCK_PADDING_BUG) | ||
| { | ||
| "TLS_BLOCK_PADDING_BUG", SSL_OP_TLS_BLOCK_PADDING_BUG | ||
| }, | ||
| #endif | ||
| #if SSL_OP_TLS_ROLLBACK_BUG | ||
| #if defined(SSL_OP_TLS_ROLLBACK_BUG) | ||
| { | ||
| "TLS_ROLLBACK_BUG", SSL_OP_TLS_ROLLBACK_BUG | ||
| }, | ||
| #endif | ||
| #if SSL_OP_ALL | ||
| #if defined(SSL_OP_ALL) | ||
| { | ||
| "ALL", (long)SSL_OP_ALL | ||
| }, | ||
| #endif | ||
| #if SSL_OP_SINGLE_DH_USE | ||
| #if defined(SSL_OP_SINGLE_DH_USE) | ||
| { | ||
| "SINGLE_DH_USE", SSL_OP_SINGLE_DH_USE | ||
| }, | ||
| #endif | ||
| #if SSL_OP_EPHEMERAL_RSA | ||
| #if defined(SSL_OP_EPHEMERAL_RSA) | ||
| { | ||
| "EPHEMERAL_RSA", SSL_OP_EPHEMERAL_RSA | ||
| }, | ||
| #endif | ||
| #if SSL_OP_PKCS1_CHECK_1 | ||
| #if defined(SSL_OP_PKCS1_CHECK_1) | ||
| { | ||
| "PKCS1_CHECK_1", SSL_OP_PKCS1_CHECK_1 | ||
| }, | ||
| #endif | ||
| #if SSL_OP_PKCS1_CHECK_2 | ||
| #if defined(SSL_OP_PKCS1_CHECK_2) | ||
| { | ||
| "PKCS1_CHECK_2", SSL_OP_PKCS1_CHECK_2 | ||
| }, | ||
| #endif | ||
| #if SSL_OP_NETSCAPE_CA_DN_BUG | ||
| #if defined(SSL_OP_NETSCAPE_CA_DN_BUG) | ||
| { | ||
| "NETSCAPE_CA_DN_BUG", SSL_OP_NETSCAPE_CA_DN_BUG | ||
| }, | ||
| #endif | ||
| #if SSL_OP_NON_EXPORT_FIRST | ||
| #if defined(SSL_OP_NON_EXPORT_FIRST) | ||
| { | ||
| "NON_EXPORT_FIRST", SSL_OP_NON_EXPORT_FIRST | ||
| }, | ||
| #endif | ||
| #if SSL_OP_CIPHER_SERVER_PREFERENCE | ||
| #if defined(SSL_OP_CIPHER_SERVER_PREFERENCE) | ||
| { | ||
| "CIPHER_SERVER_PREFERENCE", SSL_OP_CIPHER_SERVER_PREFERENCE | ||
| }, | ||
| #endif | ||
| #if SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG | ||
| #if defined(SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG) | ||
| { | ||
| "NETSCAPE_DEMO_CIPHER_CHANGE_BUG", SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG | ||
| }, | ||
| #endif | ||
| #if SSL_OP_NO_SSLv3 | ||
| #if defined(SSL_OP_NO_SSLv3) | ||
| { | ||
| "NO_SSLv3", SSL_OP_NO_SSLv3 | ||
| }, | ||
| #endif | ||
| #if SSL_OP_NO_TLSv1 | ||
| #if defined(SSL_OP_NO_TLSv1) | ||
| { | ||
| "NO_TLSv1", SSL_OP_NO_TLSv1 | ||
| }, | ||
| #else | ||
| { "NO_TLSv1", 0 }, | ||
| #endif | ||
| #if SSL_OP_NO_TLSv1_1 | ||
| #if defined(SSL_OP_NO_TLSv1_1) | ||
| { | ||
| "NO_TLSv1_1", SSL_OP_NO_TLSv1_1 | ||
| }, | ||
| #else | ||
| { "NO_TLSv1_1", 0 }, | ||
| #endif | ||
| #if SSL_OP_NO_TLSv1_2 | ||
| #if defined(SSL_OP_NO_TLSv1_2) | ||
| { | ||
| "NO_TLSv1_2", SSL_OP_NO_TLSv1_2 | ||
| }, | ||
| #else | ||
| { "NO_TLSv1_2", 0 }, | ||
| #endif | ||
| #if SSL_OP_NO_TLSv1_3 | ||
| #if defined(SSL_OP_NO_TLSv1_3) | ||
| { | ||
| "NO_TLSv1_3", SSL_OP_NO_TLSv1_3 | ||
| }, | ||
| #else | ||
| { "NO_TLSv1_3", 0 }, | ||
| #endif | ||
| #if SSL_OP_NO_COMPRESSION | ||
| #if defined(SSL_OP_NO_COMPRESSION) | ||
| { | ||
| "No_Compression", SSL_OP_NO_COMPRESSION | ||
| }, | ||
| #endif | ||
| #if SSL_OP_NO_TICKET | ||
| #if defined(SSL_OP_NO_TICKET) | ||
| { | ||
| "NO_TICKET", SSL_OP_NO_TICKET | ||
| }, | ||
| #endif | ||
| #if SSL_OP_SINGLE_ECDH_USE | ||
| #if defined(SSL_OP_SINGLE_ECDH_USE) | ||
| { | ||
| "SINGLE_ECDH_USE", SSL_OP_SINGLE_ECDH_USE | ||
| }, | ||
|
|
@@ -455,7 +455,7 @@ Security::PeerOptions::parseOptions() | |
|
|
||
| #if USE_OPENSSL | ||
| ::Parser::Tokenizer tok(str); | ||
| long op = 0; | ||
| ParsedOptions op = 0; | ||
|
|
||
| while (!tok.atEnd()) { | ||
| enum { | ||
|
|
@@ -472,7 +472,8 @@ Security::PeerOptions::parseOptions() | |
| static const CharacterSet optChars = CharacterSet("TLS-option", "_") + CharacterSet::ALPHA + CharacterSet::DIGIT; | ||
| int64_t hex = 0; | ||
| SBuf option; | ||
| long value = 0; | ||
| ParsedOptions value = 0; | ||
| bool found = false; | ||
|
|
||
| // Bug 4429: identify the full option name before determining text or numeric | ||
| if (tok.prefix(option, optChars)) { | ||
|
|
@@ -481,14 +482,16 @@ Security::PeerOptions::parseOptions() | |
| for (struct ssl_option *opttmp = ssl_options; opttmp->name; ++opttmp) { | ||
| if (option.cmp(opttmp->name) == 0) { | ||
| value = opttmp->value; | ||
| found = true; | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| // Special case.. hex specification | ||
| ::Parser::Tokenizer tmp(option); | ||
| if (!value && tmp.int64(hex, 16, false) && tmp.atEnd()) { | ||
| if (!found && tmp.int64(hex, 16, false) && tmp.atEnd()) { | ||
| value = hex; | ||
| found = true; | ||
| } | ||
| } | ||
|
|
||
|
Comment on lines
495
to
497
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should be using Optional instead of a (value, found) pair. Optional improves code quality in use cases like this. Internally, Optional is essentially a (value, found) pair itself. I cannot attach a change request to the line immediately below this one, but it is abusing non-zero value for "found". BTW, using Optional (as suggested in an earlier change request IIRC) would likely eliminate that problem (or highlight it). In the interest of merging this long-neglected PR sooner, I do not insist on this change, but there is no good reason for avoid it AFAICT.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FWIW, I am not against the idea of making this array better and will probably waive through good quality PRs doing it. I really just think it is complexity, not necessary for this PR scope.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change request is not about the array. It is about the (value, found) pair (which is essentially added by this PR). Addressing this change request will not make the code more complex.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would be happy to address this change request, demonstrating that the improved code will remain simple. Just let me know if you want me to do that. I still do not insist on this change. |
||
|
|
@@ -502,7 +505,7 @@ Security::PeerOptions::parseOptions() | |
| break; | ||
| } | ||
| } else { | ||
| debugs(83, DBG_PARSE_NOTE(1), "ERROR: Unknown TLS option " << option); | ||
| debugs(83, DBG_PARSE_NOTE(DBG_IMPORTANT), "ERROR: " << (found?"Unsupported":"Unknown") << " TLS option " << option); | ||
| } | ||
|
|
||
| static const CharacterSet delims("TLS-option-delim",":,"); | ||
|
|
@@ -512,9 +515,10 @@ Security::PeerOptions::parseOptions() | |
|
|
||
| } | ||
|
|
||
| #if SSL_OP_NO_SSLv2 | ||
| #if defined(SSL_OP_NO_SSLv2) | ||
| // compliance with RFC 6176: Prohibiting Secure Sockets Layer (SSL) Version 2.0 | ||
| op = op | SSL_OP_NO_SSLv2; | ||
| if (SSL_OP_NO_SSLv2) | ||
| op |= SSL_OP_NO_SSLv2; | ||
| #endif | ||
| parsedOptions = op; | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.