build: fix Windows build for newer rustls#263
Merged
Benoît Cortier (CBenoit) merged 28 commits intomasterfrom Jul 17, 2024
Merged
build: fix Windows build for newer rustls#263Benoît Cortier (CBenoit) merged 28 commits intomasterfrom
Benoît Cortier (CBenoit) merged 28 commits intomasterfrom
Conversation
Comment on lines
-323
to
374
|
|
||
| let bulk_cipher = match connection_cipher { | ||
| rustls::SupportedCipherSuite::Tls12(cipher_suite) => &cipher_suite.common.bulk, | ||
| rustls::SupportedCipherSuite::Tls13(cipher_suite) => &cipher_suite.common.bulk, | ||
| let suite = match connection_cipher { | ||
| rustls::SupportedCipherSuite::Tls12(cipher_suite) => &cipher_suite.common.suite, | ||
| rustls::SupportedCipherSuite::Tls13(cipher_suite) => &cipher_suite.common.suite, | ||
| }; | ||
| let block_size = match bulk_cipher { | ||
| rustls::BulkAlgorithm::Aes128Gcm => AES_BLOCK_SIZE, | ||
| rustls::BulkAlgorithm::Aes256Gcm => AES_BLOCK_SIZE, | ||
|
|
||
| let block_size = match suite.as_str() { | ||
| Some(name) if name.contains("AES_128_GCM") => AES_BLOCK_SIZE, | ||
| Some(name) if name.contains("AES_256_GCM") => AES_BLOCK_SIZE, | ||
| // ChaCha20 is a stream cipher | ||
| rustls::BulkAlgorithm::Chacha20Poly1305 => 0, | ||
| Some(name) if name.contains("CHACHA20_POLY1305") => 0, | ||
| _ => { | ||
| return Err(Error::new( | ||
| ErrorKind::UnsupportedFunction, | ||
| format!("cipher suite {suite:?} not supported"), | ||
| )) | ||
| } | ||
| }; |
Member
Author
There was a problem hiding this comment.
Pavlo Myroniuk (@TheBestTvarynka) rustls API significantly changed in a breaking way and the BulkAlgorithm enum does not exist anymore. For the purpose of making this code compile again, I used this dirty trick, but I don’t think it’s a very good idea. Do you think you could look for a proper solution here?
Collaborator
There was a problem hiding this comment.
Do you think you could look for a proper solution here?
Yes, I can. Should I prioritize it over my current tasks or it can wait a little?
Member
Author
There was a problem hiding this comment.
Thank you!
If you're almost done, go ahead with your current tasks, otherwise it would be good to take care of that in priority because I can't cut a new release with this
b740d5d to
99ddcf8
Compare
99ddcf8 to
fe61e1b
Compare
b3a6022 to
e61fe4e
Compare
Marc-André Moreau (awakecoding)
approved these changes
Jul 17, 2024
This file contains hidden or 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
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.
I don’t know why, but this PR got merged even though CI wasn’t green: #261