Skip to content

wolfcrypt: Remove sslv2 support, at best was a stub and condition other older methods on WC config define #366

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions libwget/ssl_wolfssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,10 +594,9 @@ void wget_ssl_init(void)

debug_printf("WolfSSL init\n");
wolfSSL_Init();
#ifndef NO_OLD_TLS

if (!wget_strcasecmp_ascii(config.secure_protocol, "SSLv2")) {
method = SSLv2_client_method();
} else if (!wget_strcasecmp_ascii(config.secure_protocol, "SSLv3")) {
if (!wget_strcasecmp_ascii(config.secure_protocol, "SSLv3") || !wget_strcasecmp_ascii(config.secure_protocol, "SSL")) {
Copy link
Owner

@rockdaboot rockdaboot Dec 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!wget_strcasecmp_ascii(config.secure_protocol, "SSLv3") || !wget_strcasecmp_ascii(config.secure_protocol, "SSL")) {
if (!wget_strncasecmp_ascii(config.secure_protocol, "SSL", 3)) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can make this change, only issue is if someone specifies SSLv2 it won't tell them invalid option but they also won't get what they ask for. I assumed we would prefer fall to the default case of Missing TLS method. Confirm this is desired instead?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You raise a good point. I just compared the WolfSSL code with our OpenSSL and GnuTLS implementations, that why I suggested the above. IMO, all three should behave semantically the same. But I now realize that the docs need to be changed and maybe in a follow-up PR, we need a bit of code deduplication.

So yes, please change the code as suggested above.

I take care of the docs later, and print a warning that SSLv3 is used instead of SSLv2 (if explicitly requested).

method = wolfSSLv23_client_method();
min_version = WOLFSSL_SSLV3;
} else if (!wget_strcasecmp_ascii(config.secure_protocol, "TLSv1")) {
Expand All @@ -606,7 +605,9 @@ void wget_ssl_init(void)
} else if (!wget_strcasecmp_ascii(config.secure_protocol, "TLSv1_1")) {
method = wolfSSLv23_client_method();
min_version = WOLFSSL_TLSV1_1;
} else if (!wget_strcasecmp_ascii(config.secure_protocol, "TLSv1_2")) {
} else
#endif // ! NO_OLD_TLS
if (!wget_strcasecmp_ascii(config.secure_protocol, "TLSv1_2")) {
method = wolfSSLv23_client_method();
min_version = WOLFSSL_TLSV1_2;
} else if (!wget_strcasecmp_ascii(config.secure_protocol, "TLSv1_3")) {
Expand Down