hsts: duplicate live hsts data in curl_easy_duphandle().#21809
hsts: duplicate live hsts data in curl_easy_duphandle().#21809whatchamacallem wants to merge 1 commit into
Conversation
08b3020 to
2836c07
Compare
|
This looks ready to merge. I'll let you handle it from here. (I ended up rebasing the commit to merge your fix to a flakey test and a couple times more to pass the linter.) |
|
How about adding a libtest that verifies this? |
6f36190 to
e489d59
Compare
98c293c to
e4448a6
Compare
| static CURLSTScode hstsread1922(CURL *curl, struct curl_hstsentry *e, | ||
| void *userp) |
There was a problem hiding this comment.
| static CURLSTScode hstsread1922(CURL *curl, struct curl_hstsentry *e, | |
| void *userp) | |
| static CURLSTScode t1922_hstsread(CURL *curl, struct curl_hstsentry *e, | |
| void *userp) |
minor indent nit, and also the naming scheme as in most other tests.
| }; | ||
|
|
||
| static const struct entry preload_hosts[] = { | ||
| #if (SIZEOF_TIME_T < 5) |
There was a problem hiding this comment.
| #if (SIZEOF_TIME_T < 5) | |
| #if SIZEOF_TIME_T < 5 |
drop parents, to make it like most of the code
There was a problem hiding this comment.
I was in the middle to dorking with this PR when you made suggestions. I have applied all your suggestions to the latest commit.
| ***************************************************************************/ | ||
| #include "first.h" | ||
|
|
||
| struct state1922 { |
There was a problem hiding this comment.
| struct state1922 { | |
| struct t1922_state { |
sync with naming scheme used in most tests.
| static CURLSTScode hstswrite1922(CURL *curl, struct curl_hstsentry *e, | ||
| struct curl_index *i, void *userp) |
There was a problem hiding this comment.
| static CURLSTScode hstswrite1922(CURL *curl, struct curl_hstsentry *e, | |
| struct curl_index *i, void *userp) | |
| static CURLSTScode t1922_hstswrite(CURL *curl, struct curl_hstsentry *e, | |
| struct curl_index *i, void *userp) |
fix indent, and use common naming scheme.
| /* | ||
| * Verify that curl_easy_duphandle() copies live HSTS entries to the clone. | ||
| */ | ||
|
|
There was a problem hiding this comment.
drop empty line.
| @@ -0,0 +1,60 @@ | |||
| <?xml version="1.0" encoding="US-ASCII"?> | |||
There was a problem hiding this comment.
This file needs to be added to the local Makefile.inc to add it to dist and pass CI.
d6bb7b1 to
d5839d0
Compare
|
I don't know what to do about this one CI issue. https://github.com/curl/curl/actions/runs/26723735880/job/78755299214?pr=21809 |
|
This looks ready to merge. Let me know if you want it rebased onto master again. The midnightbsd failure was also failing on master. The other two failures look like overloaded CI servers timing out and running out of resources. |
|
Shouldn't the test also use the duplicated handle to "prove" that the HSTS data is actually copied over? Otherwise the test doesn't really verify that. |
f71ed1b to
d830fcc
Compare
d830fcc to
8d61a0e
Compare
|
@bagder @vszakats All tests pass. I didn't rebase because (I swear just using file globs is easier than maintaining lists of files. We have git for tracking the contents of directories. Fixing the whitespace in a list of files feels like masochism after you have experienced freedom.) |
|
Thanks! |
curl_easy_duphandle()now copies live HSTS entries (aquired from Strict-Transport-Security response headers) into the cloned handle. Previously only file-based entries were duplicated. AddsCurl_hsts_copy()to handle the transfer. Expired entries are skipped.