Description
Problem
Found during internal security review at Google.
In either of these cases, a resumption has successfully occurred:
- When Initiator resumed and received a Sigma2 Resume that was successful
- When Responder received a Sigma1 for valid resumption and had received a successful session establishment status from the resumption
The spec says:
=== Validate Sigma2_Resume
...
. The initiator SHALL set the `Resumption ID` in the <<ref_SecureSessionContext, Session Context>> to the value `Resume2Msg.resumptionID`.
It doesn't mention what to do with the previous resumption state, but a careful consideration of the side-effects implies that since the resumption ID set by the responder and processed by the initiator gets updated in "session context" and that a given "session" has to be resumed, the previous resumption state, if any, for the given peer, should be deleted, prior to saving the new resumption state. Otherwise, it is possible that a session be multiply resumed, or that resumption contexts that are now logically expired, be reused.
The current implementation of DefaultSessionResumptionStorage
never removes a prior entry for a given peer, except when fabric removal is called.
Proposed Solution
Either:
Delete(ScopedNodeId)
should always be called beforeSave(...)
Save(...)
should automatically calledDelete
(and ignore "failure/missing") for the ScopedNodeId of the peer
Furthermore,
Delete(ScopedNodeId)
must support trying to delete any possible duplicate within the index, if any exists (i.e. make sure there remains no reume contexts). This makes sense since there should only need to be one node resumption state between peers.
Activity