-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
TLS record HMAC 2a: variable-time computations #5177
Comments
@mpg I have an issue with The results of Using the I can't find anything in the PSA API about the
|
@superna9999 I'm not sure what the problem is here, but do note that if you're using a truncated MAC algorithm, you have to pass something like |
Hmm, support for truncated HMAC was removed in Mbed TLS 3.0, so these tests might be obsolete. I'll check tomorrow and confirm, but my initial impression is we should remove those tests rather than jump through hoops to make them pass. |
@gilles-peskine-arm thanks, I added support for TRUNCATED_MAC in the @mpg the impact of using truncated HMAC is really reduced and only impacts code in |
Ok, I checked, and on second thought... I still think those tests are obsolete and should be removed. Specifically, all tests that are using |
@mpg remove or disable with PSA_CRYPTO ? |
Oh, we've been posting at the same time.
Sure, but these tests are covering are about a feature that's no longer present in the library. When preparing Mbed TLS 3.0, we took a number of shortcuts, in particular when removing features we didn't go and check which tests could be removed, which could be simplified, etc. That's the only reason those tests are still here. So, remove entirely. And that's also why I don't think it's worth spending even the tiniest amount of code, even if it's only in
In general we should really avoid disabling tests with |
@mpg Why are these tests passing if they're testing something that's been removed? Are they testing an internal function that's no longer used with the given parameters? |
Because they're building the |
Perform all variable-time HMAC computations related to TLS record protection using
psa_mac
instead ofmbedtls_md_hmac
, using the key slots referenced in the transform (see #5176), whenMBEDTLS_USE_PSA_CRYPTO
is defined.mbedtls_ssl_encrypt_buf()
whenmode == MBEDTLS_MODE_STREAM
or CBC without encrypt-then-mac → usepsa_mac_sign
APIs.mbedtls_ssl_encrypt_buf()
whenmode
is CBC and encrypt-then-MAC is active → usepsa_mac_sign
APIs.mbedtls_ssl_decrypt_buf()
whenmode
is CBC and encrypt-then-MAC is active → usepsa_mac_verify
APIs; remove themac_expect
buffer and associated debug messages.Note: each computation will need its own temporary
psa_mac_operation_t
object. Previously themd_ctx_xxx
from the transform serve both for key storage and multi-part context; now only the key is referenced in the transform, and the multi-part context is local to the function doing the computation.Depends on: #5176 - to have the keys available in
struct mbedtls_ssl_transform
.Related: #5178
Follow-up: #5179
The text was updated successfully, but these errors were encountered: