-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Siliently ignore RecordPadding option for QUIC objects #28992
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
|
backport ci jobs can be ignored, will fixup manually on merge |
Sashan
left a comment
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.
Why do we need this change? snippet below comes from SSL_set_block_padding_ex():
6026
6027 int SSL_set_block_padding_ex(SSL *ssl, size_t app_block_size,
6028 size_t hs_block_size)
6029 {
6030 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(ssl);
6031
6032 if (sc == NULL
6033 || (IS_QUIC(ssl)
6034 && (app_block_size > 1 || hs_block_size > 1)))
6035 return 0;
The SSL_set_block_padding_ex() currently indicate failure (return 0) when it is presented with SSL QUIC object.
I think we can opt for more conservative change without introducing public version of SSL_CTX_is_quic(). We can let SSL_set_block_padding_ex() to always succeed for QUIC objects. Something like
in SSL_set_block_padding_ex(SSL *ssl, size_t app_block_size, size_t hs_block_size)
{
if (IS_QUIC(ssl))
return 1;
...
I think the one-liner above has the same effect as the change proposed here. I admit I might be missing some detail... thanks.
|
@Sashan I specifically opted not to go with that approach because SSL_set_block_padding_ex and SSL_CTX_set_block_padding_ex are unsupported by QUIC, so I wanted applications that make those calls directly to be informed of that lack of support via the error code return. The exception we have to that case is the event in which we set these options via config file (where we have no idea what kind of SSL object we will be applying the padding to), so I figured this was the best compromise to make. |
Sashan
left a comment
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.
thanks for clarificaiton. looks good to me.
Just run the quicapitest (which attempts to create quic connections) while using a config that specifies recordpadding, which quic should ignore
|
test added |
t8m
left a comment
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.
OK for 4.0.
Sashan
left a comment
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.
|
This pull request is ready to merge |
Like SSL_is_quic, it would be helpful to know if SSL_CTX objects create QUIC SSL's or not. Reviewed-by: Saša Nedvědický <sashan@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from #28992)
QUIC connections always pad data at the packet level during packet encryption, and so have no ability to do padding at the record level. We want to be able to inform the user of this condition when applications call SSL_set_block_padding_ex directly by returning an error, we have no idea of what kind of SSL objects are created when the config file is written. As such, silently ignore this config file option when QUIC objects are created. Fixes #28953 Reviewed-by: Saša Nedvědický <sashan@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from #28992)
Just run the quicapitest (which attempts to create quic connections) while using a config that specifies recordpadding, which quic should ignore Reviewed-by: Saša Nedvědický <sashan@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from #28992)
|
Merged to the master branch. Please create a backport PR for 3.6 branch without having the SSL_CTX_is_quic() API addition. (I.e. make non-public ossl_ssl_ctx_is_quic() there.) |
QUIC doesn't support the SSL_set_block_padding_ex apis, because QUIC objects always pad at the packet level during packet encryption. However, record padding is a config file option, and setting it there is done without any knoweldge of the kind of SSL objects we are going to create (TCP vs QUIC). As such, it seems to make sense to siliently ignore the option when configuring an SSL/SSL_CTX on QUIC objects.
Checklist