-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Port to librustls 0.12.0 #12989
Closed
Closed
Port to librustls 0.12.0 #12989
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kpcyrd
force-pushed
the
librustls-0.12.0
branch
2 times, most recently
from
February 25, 2024 21:26
18cbaf7
to
1133e13
Compare
kpcyrd
force-pushed
the
librustls-0.12.0
branch
from
February 25, 2024 21:36
1133e13
to
c24f11e
Compare
bagder
approved these changes
Feb 26, 2024
Thanks! |
From clang-cl, there is still these 2 warnings: vtls/rustls.c(295,53): warning: format specifies type 'long' but the argument has type 'size_t' (aka 'unsigned long long') [-Wformat]
295 | CURL_TRC_CF(data, cf, "cf_send: %ld plain bytes", plainlen);
| ~~~ ^~~~~~~~
| %zu
./curl_trc.h(79,38): note: expanded from macro 'CURL_TRC_CF'
79 | Curl_trc_cf_infof(data, cf, __VA_ARGS__); } while(0)
| ^~~~~~~~~~~
vtls/rustls.c(411,23): warning: incompatible function pointer types passing 'enum rustls_result (void *, const rustls_verify_server_cert_params *)' (aka
'enum rustls_result (void *, const struct rustls_verify_server_cert_params *)') to parameter of type 'rustls_verify_server_cert_callback' (aka
'unsigned int (*)(void *, const struct rustls_verify_server_cert_params *)') [-Wincompatible-function-pointer-types-strict]
411 | config_builder, cr_verify_none);
| ^~~~~~~~~~~~~~
f:/MinGW32/src/inet/Crypto/RusTls/src\rustls.h(1272,114): note: passing argument to parameter 'callback' here
1272 | rustls_verify_server_cert_callback callback);
| ^
2 warnings generated. which I fixed by: --- a/vtls/rustls.c 2024-02-26 11:45:13
+++ b/vtls/rustls.c 2024-02-26 11:58:58
@@ -292,7 +292,7 @@
DEBUGASSERT(backend);
rconn = backend->conn;
- CURL_TRC_CF(data, cf, "cf_send: %ld plain bytes", plainlen);
+ CURL_TRC_CF(data, cf, "cf_send: %zu plain bytes", plainlen);
io_ctx.cf = cf;
io_ctx.data = data;
@@ -343,7 +343,7 @@
/* A server certificate verify callback for rustls that always returns
RUSTLS_RESULT_OK, or in other words disable certificate verification. */
-static enum rustls_result
+static uint32_t
cr_verify_none(void *userdata UNUSED_PARAM,
const rustls_verify_server_cert_params *params UNUSED_PARAM)
{ |
@gvanem thanks for pointing this out, do you want to submit the patch yourself or should I take care of this? |
@kpcyrd Please go ahead. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #12737, relates to rustls/rustls-ffi#384.
I've tried to port this as literal as possible, then slightly restructured it since both the
ca_info_blob
branch and thessl_cafile
branch started having a lot of duplicate code. I suspect theelse if(ca_info_blob || ssl_cafile) {
can possibly be replaced byelse {
.I'm also somewhat certain I've overlook some things for correctly
*_free
-ing everything.This is part of the effort of integrating librustls into Arch Linux and Gentoo: rustls/rustls-ffi#274.