-
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
Mixed PSK 2c: support RSA-PSK #5665
Comments
I understand that first the missing psa implementation for opaque rsa-psk needs to be added here: |
I think that's one place that will need changing, yes, but other than removing the check and error I don't think there's much to implement here - we're just generating a random secret and encrypting it with RSA, not accessing the PSK in any way. I think the actual use of the PSK happens later in the same function when calling mbedtls/library/ssl_tls12_client.c Lines 3125 to 3142 in ea75049
So, the PSK is actually used elsewhere... let me check. Must be when deriving the MS, since with opaque PSKs we go directly from PSK to MS (the TLS side of the library does not get to "see" the PMS). Ok, it's in Lines 5136 to 5183 in ea75049
mbedtls_ssl_write_client_key_exchange() or one of its callees) will have left the other_secret part of the PMS in the handshake->pms buffer so you can just pass it to PSA from there.
Also, you'll probably need to adjust checks used in ciphersuite selection: hopefully in ClientHello/ServerHello parsing/writing we're currently refusing to use an RSA-PSK ciphersuite if we only have an opaque PSK; this will have to change. Well looking at the code I'm not seeing that anywhere, so perhaps there's nothing to change to ciphersuite selection, I guess we'll see when running tests. And of course that was for the client, we need to identify the relevant places in the server too. Though the place where the actual computation is done should be common to both sides, as it's I don't remember exactly where everything happens, but the best way to find out is probably to write a test in |
This task is to add support for RSA-PSK using PSA-held (aka opaque) keys, that is, keys provisioned with
mbedtls_ssl_conf_psk_opaque()
ormbedtls_ssl_set_hs_psk_opaque()
(used in the PSK callback).The task is done when there are passing tests in
ssl-opt.sh
using RSA-PSK withpsk_opaque=1
with sufficient coverage (client and/or server, static conf and/or callback, see existing tests for pure PSK).Depends on: #5662 (also provides context and references).
Related: #5663, #5664
The text was updated successfully, but these errors were encountered: