Skip to content

build: fix Windows build for newer rustls #263

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

Merged
merged 28 commits into from
Jul 17, 2024
Merged

build: fix Windows build for newer rustls #263

merged 28 commits into from
Jul 17, 2024

Conversation

CBenoit
Copy link
Member

@CBenoit CBenoit commented Jul 10, 2024

I don’t know why, but this PR got merged even though CI wasn’t green: #261

@CBenoit CBenoit requested review from a team as code owners July 10, 2024 09:07
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"),
))
}
};
Copy link
Member Author

Choose a reason for hiding this comment

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

@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?

Copy link
Collaborator

Choose a reason for hiding this comment

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

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

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

@CBenoit CBenoit enabled auto-merge (squash) July 16, 2024 03:24
@CBenoit CBenoit merged commit fd5afc5 into master Jul 17, 2024
42 checks passed
@CBenoit CBenoit deleted the fix-windows-build branch July 17, 2024 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants