-
Notifications
You must be signed in to change notification settings - Fork 22
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
Conversation
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"), | ||
)) | ||
} | ||
}; |
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.
@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?
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.
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?
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.
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
I don’t know why, but this PR got merged even though CI wasn’t green: #261