-
Notifications
You must be signed in to change notification settings - Fork 1
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
Full State and Session State Invariants #58
base: main
Are you sure you want to change the base?
Conversation
…ter readability of function types)
This reverts commit 3c7970b.
…o renamed it to state_id)
…n the prefix of the trace (like the event pred; introducing state_was_set_at)
…on and get full state functions
…- WIP (split predicate method not adaped yet, admit in state.tagged)
…ded lemmas for that
…elated to the split predicate not yet adapted to the new state predicate)
… counter invariant
…to the same session) -- init
Thanks, I look forward having a look at the code! For now, I am trying to understand what is the end goal, but I'm not understanding the section "What do we need this for?". E.g. I don't understand in the first sentence whether Could you explain that in more details, and in particular how it would help proving new kind of security properties, or prove hidden assumptions? |
In the example, A generates both The property that we want to ensure in this simple example is that A and B together have a coherent view of the "session data", in that they both agree that In a two-party protocol, there may be some workarounds for this (we haven't examined it too closely), but this initially arose when trying to ensure that 3+ (honest) parties all share a coherent idea of what one session of the given protocol is, so that we can reasonably work with statements of the form "A knows that the data that C associates with session X of the protocol has property Y". There were two problems that arose, both centering on how a participant identifies a session --- in many of the protocols we have looked at, there is some form of "session ID" (or possibly a few different session IDs shared between different subsets of the participants), and when a message is received, it will contain one of these session IDs, which can then be used to look up the corresponding state to work with. However, we have no guarantee that there is a unique such state --- our invariants are not expressive enough to state that a given session ID is used in at most one state at a given participant, and so it is difficult to guarantee that we actually have all of the needed information for that session stored coherently and in a way that avoids spurious mix-ups (between sessions sharing IDs, for instance, which we generally disregard in modelling, as long as the session IDs are generated centrally). The other problem is that we have no way to enforce that this session ID stays fixed for the lifetime of the session --- changing session IDs can again lead to mix-ups even if at any given time no two sessions share an ID, because they may have the same ID at different times, and again, these mix-ups are the sort of thing that we generally want to exclude in modelling unless the protocol explicitly allows for updating session IDs. I'll also think further on a concrete simple example of a property that this enables proving, but the general class of properties that we want are about this ability to coherently and unambiguously reason about a session between honest parties, even if they are not all in direct communication with one another. The specific tools that we seem to need for this are
|
This is an update on the current state of "the state changes" for easier commenting. (Previous discussions are here #9)
Main conceptual changes
dolev-yao-star-extrinsic/src/core/DY.Core.Trace.Invariant.fst
Lines 52 to 56 in eb55a1d
The key idea for showing the state invariants in the trace invariant is:
If there are no more
SetState p _ _
entries , the full state of a principal stays the same:(and similarly for a specific session
sid
of p)We then show that the operations
send_msg
,mk_rand
andtrigger_event
don't add anySetState
entries.An Example Protocol
To show how the new state invariants can be used, there is a small example protocol in https://github.com/REPROSEC/dolev-yao-star-extrinsic/tree/cwaldm/experimental/examples/invariants .
In this example, we have a state type that contains two identifiers and a counter:
dolev-yao-star-extrinsic/examples/invariants/DY.Example.Invariants.Uniqueness.fst
Lines 20 to 21 in eb55a1d
with the following invariants:
Previously, we were not able to express these. But now we can:
dolev-yao-star-extrinsic/examples/invariants/DY.Example.Invariants.Uniqueness.fst
Lines 196 to 231 in eb55a1d
The protocol consists of two steps:
For each of the two steps, we show that the trace invariant (i.e., the global state predicate) is maintained ( init and next)
Further, we show that the identifiers are indeed identifiers, that is, if there are two state entries on the trace that have the same identifier, both of them must belong to the same session (see here)
What do we need this for?
Consider the following situation:
A participant "A" generates two fresh identifiers "id1" and "id2", stores them in a state and sends them to a participant "B", who stores both in his own state (where "id2" is again an identifier for states of "B").
At some later point "A" looks up his latest state that has "id1". Associated with this is a second identifier "id2_A". (Since the "id1" field is an identifier for states of A, we know that "id2_A" must be "id2" generated together with "id1".)
Suppose that at some point "B" uses the identifier "id2" to look up his latest state. Then again this state has an associated "id1_B".
We would now like to show that "id1_B" must be "id1", so that both "A" and "B" looked up a state that corresponds to "the same session" (identified by the pair ("id1", "id2")).
Next Steps
Right now, this is a first try and still very inconvenient for users and probably missing some properties that we need for actual use cases.
Some of the next steps are (not necessarily in order):
parse
s in the invariants)