Skip to content
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

sectransp: Use common code for cipher suite lookup #13521

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jan2000
Copy link
Contributor

@jan2000 jan2000 commented May 2, 2024

Take advantage of the Curl_cipher_suite_walk_str() and Curl_cipher_suite_get_str() functions introduced in commit fba9afe.

@github-actions github-actions bot added the tests label May 2, 2024
@jan2000 jan2000 marked this pull request as draft May 2, 2024 18:15
@jan2000 jan2000 force-pushed the sectransp-update-ssl-cipher-list branch from 1f7118d to 1ae7131 Compare May 2, 2024 18:22
@@ -235,348 +225,244 @@ struct st_cipher {
#define CIPHER_STRONG_ENOUGH FALSE

/* Please do not change the order of the first ciphers available for SSL.
Do not insert and do not delete any of them. Code below
depends on their order and continuity.
Do not insert and do not delete any of them.
If you add a new cipher, please maintain order by number, i.e.
insert in between existing items to appropriate place based on
cipher suite IANA number
*/
static const struct st_cipher ciphertable[] = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This big table can be removed (or replaced with something smaller) in a future PR. However, to make sure there is no change in behaviour with this commit it is left in for now.

@@ -1453,18 +1265,57 @@ static bool is_cipher_suite_strong(SSLCipherSuite suite_num)
return true;
}

static bool sectransp_is_separator(char c)
static int sectransp_cipher_suite_get_str(uint16_t id, char *buf,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These wrapper functions for Curl_cipher_suite_get_str and Curl_cipher_suite_walk_str are here so there is no change in behavior with this commit. But, I guess no one will shed a tear if support for setting/getting these ciphers is removed?

@jan2000 jan2000 marked this pull request as ready for review May 2, 2024 18:52
Copy link
Member

@nickzman nickzman left a comment

Choose a reason for hiding this comment

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

Thanks for your work on this. I only noticed some minor things; the code looks okay, and it doesn’t appear to introduce any obvious regressions.

return true;
}
return false;
/* are these fortezza suites ever supported ? */
Copy link
Member

Choose a reason for hiding this comment

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

That should be “even” supported. And I have no idea if they’re supported or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well actually I meant to say "were these ever supported ?", but also in present and future tense. As in: can this be safely removed, or should this be kept in for backward compatibility?

size_t len = *end - *str;

if(!id) {
/* are these fortezza suites ever supported ? */
Copy link
Member

Choose a reason for hiding this comment

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

Same change here.

@jan2000 jan2000 force-pushed the sectransp-update-ssl-cipher-list branch from 1ae7131 to 7746df8 Compare May 8, 2024 18:27
Take advantage of the Curl_cipher_suite_walk_str() and
Curl_cipher_suite_get_str() functions introduced in commit fba9afe.
@jan2000 jan2000 force-pushed the sectransp-update-ssl-cipher-list branch from 7746df8 to 18ed50c Compare May 8, 2024 18:40
@jan2000
Copy link
Contributor Author

jan2000 commented May 8, 2024

@nickzman I made the changes you suggested. See https://github.com/curl/curl/compare/1ae71316953f0aa57e5c6a8ad0cb00b9a7deb317..7746df8cf110219407aeeb07e04167d50b336fe9

However, after pushing I saw CI tests failing due to unit2604. So I rebased to latest master and pushed again. Sorry if this caused any inconvenience for the review.

But now I am a bit puzzled as to how the test could be failing on unit2604 in the first place, as it was not yet in the master that this PR was initially based on. How does that work?

@jan2000 jan2000 requested a review from nickzman May 8, 2024 19:30
@icing
Copy link
Contributor

icing commented May 9, 2024

But now I am a bit puzzled as to how the test could be failing on unit2604 in the first place, as it was not yet in the master that this PR was initially based on. How does that work?

It's unrelated. Should be fixed now by merging of #13563 and #13564.

Copy link
Member

@nickzman nickzman left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for your work on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

3 participants