External PSK importers make TLS key reuse a deployment decision
External PSK importers make TLS key reuse a deployment decision Pre-shared keys are convenient for embedded clients, private links, and deployments without a practical public-key enrollment path. TLS 1.3 changes how th
External PSK importers make TLS key reuse a deployment decision
Pre-shared keys are convenient for embedded clients, private links, and deployments without a practical public-key enrollment path. TLS 1.3 changes how those keys enter the handshake. A PSK that was assigned an identity and a cryptographic purpose in another protocol does not map automatically to a safe TLS 1.3 key schedule. RFC 9258 describes an importer interface that derives a new PSK for a specific key derivation function, hash, and usage label.
The distinction matters when one external secret serves several endpoints or protocol versions. Without an importer, similar secrets can be rerouted between contexts and produce related key material. RFC 9257 recommends importers when applicable and notes that derivation should bind the identities involved. The importer should be treated as a controlled cryptographic boundary, not a small library call added at the last minute.
What the importer creates
The external PSK and its external identity are inputs to the import process. The output is a derived PSK and a derived identity suitable for TLS 1.3 or DTLS 1.3. These outputs are tied to the target KDF and hash. If one endpoint imports the PSK and the other does not, the new usage label prevents an accidental negotiation under mismatched assumptions.
Practical deployments need to store the original secret, the importer context, the target algorithm, and the resulting identity. They also need a way to reproduce the derivation during recovery. A configuration that says only psk=... is incomplete because it does not show which importer, context string, identities, or KDF produced the active key.
Treat the context string as authorization data
The context passed to an importer should identify the intended deployment and peer relationship. It should not be copied from an unrelated example or generated from a hostname that can be changed without review. If two clusters share a secret, separate importer contexts can separate their derived keys. If an administrator accidentally gives both clusters the same context, the operational separation disappears.
This is not a substitute for certificate identity. PSK authentication proves possession of a secret, not a full organizational identity. Monitoring must therefore include key ID, assigned peers, rotation date, last successful handshake, and the owner who can authorize reuse. These fields should come from configuration inventory rather than from a packet capture that reveals no useful external identity.
Rotate both sides without a flag day
A rotation plan should stage the new secret and its importer context on the server, verify that intended clients can negotiate, and then remove the old material. Metrics should distinguish authentication failure from a KDF or importer mismatch. A generic TLS alert may not tell an operator which side imported the key with a different hash.
Applications also need to reject unexpected PSK identities explicitly. Supporting a list of historical keys without age limits turns a compatibility mechanism into a permanent credential store. Expired identities should be removed from configuration and from secret-management backups according to the same policy.
Review the threat model around the secret
Anyone who obtains the external PSK and the importer inputs may be able to impersonate an endpoint. Restrict access to the secret, the identity mapping, and the derivation logic together. Audit changes to all three. A read-only backup that exposes the secret but not the importer context may be incomplete for recovery, while a backup that exposes both is a high-value credential.
The useful control is not the presence of TLS 1.3 alone. It is an inventory that connects a secret to a peer, a derived identity, a KDF, and an owner. That record makes key reuse visible before it becomes an authentication incident.
References
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes โ full credit and traffic to the original publisher.