-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
NSS: Add ciphers to map #6670
NSS: Add ciphers to map #6670
Conversation
Add cipher names to the `cipherlist` map, based on the list of ciphers implemented by the NSS in the source code file https://github.com/nss-dev/nss/blob/master/lib/ssl/sslenum.c
I looked at the latest NSS source code and compared list of ciphers they implement with the mapping in the curl source code file lib/vtls/nss.c ( I difficulty building NSS on my machine, I'll try to overcome them, but I do not environment to build and test my change locally. I'll send you update if I test it properly. I'd like to discuss first if this change makes sense. |
The fact that they're missing doesn't necessarily mean that they wanted. Can you provide some rationale for why we should include them? |
@danielgustafsson The user (or the application that uses libcurl) decides which cipher-suites will be enabled. The mapping just needs to be updated to keep this configurable. |
To be clear, the proposed change does not affect the list of cipher-suites enabled by default. |
Daniel and Kamil, thank you for the discussion. If users do not care about specific ciphers, they do not set the cipher list value. If users specified some cipher(s), they have some reason for it. The main reason for this change is to complete the mapping to ciphers implemented by NSS and make it more consistent. Thank you |
Sorry for being slow to respond. Thanks for clearing up the intent and impact, I don't have any objections to aligning ourselves with what is available in NSS (I haven't reviewed this list wrt which versions of NSS this would require vs the baseline version we require but I have little doubt they wont overlap). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. It would be good to also update https://github.com/curl/curl/blob/master/docs/CIPHERS.md but that could be handled separately.
/* Introduced in release 3.20 */ | ||
{"dhe_dss_aes_128_sha_256", TLS_DHE_DSS_WITH_AES_128_CBC_SHA256}, | ||
{"dhe_dss_aes_256_sha_256", TLS_DHE_DSS_WITH_AES_256_CBC_SHA256}, | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would just put there an additional space to keep the second column aligned.
Hi Daniel,
No problem, I am also not fast.
I tried to track down constants to versions they were introduced. Ciphers with AES algorithm (TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 and TLS_DHE_DSS_WITH_AES_256_CBC_SHA256) were introduced by 3.20 release (https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/NSS_3.20_release_notes). The first one AES with Galois counter mode is already included, only two cipher block chaining ciphers are missing and added by this change. I added them under Camellia ciphers were introduced in the 3.12 release (https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/NSS_3.12_release_notes.html). I added an The single SEED NSS suite TLS_RSA_WITH_SEED_CBC_SHA was added in the 3.12.3 release (https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/NSS_3.12.3_release_notes). I added an The TLS_DHE_DSS_WITH_RC4_128_SHA suite is not registered by IANA, but NSS implements it since a long time ago, I did not find the first version it was introduced, but for sure 3.10 already has it. I checked other cipher numbers already in the curl nss.c source code and found they were introduced after NSS 3.10 release (between 3.10 and 3.12), like TLS_ECDHE_ECDSA_WITH_NULL_SHA, TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_anon_WITH_AES_256_CBC_SHA and others (13 total). Therefore I assume the base version of NSS is supported by curl is later than 3.10. Hence I did not add The case for ciphers TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA, TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA, TLS_DHE_RSA_WITH_DES_CBC_SHA, and TLS_DHE_DSS_WITH_DES_CBC_SHA is more complicated. The NSS 3.16 release introduced those constants in addition to already defined SSL_ names ( I'll send the updated version soon. Please let me know if that version should be improved. Also, I have another question about cipher names but I'll make another comment for it. |
Rearranged records order. Added `#ifdef` compilation guard for a SEED cipher
I tried to figure out a pattern for cipher names and found that some ciphers contain 'cbc' part for cipher clock mode (dhe_dss_aes_128_cbc_sha, dhe_rsa_aes_256_cbc_sha, etc.) and some don't (ecdh_ecdsa_aes_128_sha, ecdh_rsa_3des_sha, etc.) That is ok, even IANA and IETF cipher names are not very consistent. I googled and chose variants without cbc to match mod_nss and Firefox cipher names. Another question about naming, unification with OpenSSL or IANA. |
Just a minor remark: we do not need any |
Thanks! |
Add cipher names to the
cipherlist
map, based on the list of ciphersimplemented by the NSS in the source code file
https://github.com/nss-dev/nss/blob/master/lib/ssl/sslenum.c