TLS 1.3 specify two pre-shared key exchange modes, which are psk_ke
and psk_dhe_ke
. The former is a non-ephemeral key exchange where the master secret is basically derived from the pre-shared key, the client random and the server random; whereas the latter is ephemeral and derives master secret from those same data plus the (EC)DH result. Ephemeral key exchange gives forward secrecy, so it's unarguably the better choice, only if the pre-shared key is a long-term secret.
According to RFC8446 Section 7.1:
PSK (a pre-shared key established externally or derived from the resumption_master_secret value from a previous connection)
If I understand correctly, for session resumption, after the PSK of the current connection has done its job (deriving all needed secrets/keys), the TLS implementation must automatically erase (ideally zeroize) it for us, right? Therefore it is definitely not a long-term secret.
For external PSK, the TLS implementation cannot automatically erase it because the implementation doesn't know whether the PSK is/will be used for any other purpose or not. So one can tweak at the application layer with a simple key update mechanism like derive $PSK_{n+1} = KDF(PSK_n)$ then erase $PSK_n$ at both sides after the handshake. Therefore we can make the PSK no longer a long-term secret while keeping communication capability. (Side note: IMO, one PSK should be used solely for the purpose of communicating between one pair of parties, so this key update mechanism could be integrated into the TLS implementation.)
In both cases, session resumption and external PSK, we get forward secrecy without using a ephemeral key exchange like Diffie-Hellman. The advantage is performance gain by not using public key cryptography. And I couldn't think of any disadvantage. So my question is:
In TLS, should the non-ephemeral psk_ke
mode always be preferred over the ephemeral psk_dhe_ke
mode for session resumption? And also the same for external pre-shared key if proper key update is applied?
Please correct me if I had any misunderstanding. Thanks in advance and have a nice day!