Skip to content

build: fix Windows build for newer rustls#263

Merged
Benoît Cortier (CBenoit) merged 28 commits intomasterfrom
fix-windows-build
Jul 17, 2024
Merged

build: fix Windows build for newer rustls#263
Benoît Cortier (CBenoit) merged 28 commits intomasterfrom
fix-windows-build

Conversation

@CBenoit
Copy link
Member

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

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.

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?

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

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.

4 participants