h2o / picotls

TLS 1.3 implementation in C (master supports RFC8446 as well as draft-26, -27, -28)
535 stars 140 forks source link

Should exclude PSK_DHE mode when key_share is null #531

Open sshock opened 4 months ago

sshock commented 4 months ago

The ptls_context_t key_exchanges can be set to NULL to force PSK-only mode.

In this scenario, the client key_share_ctx is NULL, so encode_client_hello does not include any key_share entries.

So far so good. But encode_client_hello still includes PSK_DHE in the PSK_KEY_EXCHANGE_MODES, even though that mode won't be able to work.

In practice this hasn't caused any issues for me, but it would probably be good to exclude that mode in this scenario.