This commit adds new getters: `GetGroupID` and `GetSessionIDs` to the
session store which can be used to query the newly added indexes to get
the associated group ID for a session ID or the associated set of
session IDs for a group ID.
This commit adds two new indexes to the session store. One from session
ID to group ID and one from groupID to a set of session IDs. This commit
only adds the new logic and starts writing the the new indexes from the
`StoreSession` method. The next commit will add a migration to back-fill
the new indexes.
Add the new `GroupID1` field to the `Session` struct and ensure that the
new fields are properly serialised and deserialised. The `GroupID` is
the ID of the first Session in a set of linked sessions.
This commit does a few things:
1. Instead of deriving IDs using the first 4 bytes of the session's
serialised local pub key, we instead use bytes [1:5] in order to skip
the first byte which is either 0x02 or 0x03. This results in a
greater entropy set.
2. We also add a new index from ID to key and we write to this index
each time a new session is added.
3. We add a `ReserveNewSessionID` method to the session store which will
grind through private keys until it finds one that does not clash
with the current ID set.
4. A migration is added to back-fill the ID-to-key index. If any old
sessions are found that _do_ have a colliding ID, they are sorted by
created time and all but the newest session is revoked. Only an entry
for the newest session will be added to the ID-to-key index.
In this commit, the Account session type is changed to be type 5 in
both the session proto and in the persisted Session. This is done so
that type 4 can be reserved for future use.
In this commit, we add a deadline for the initial connection of an LNC
connection. So with this, the user is forced to use their pairing phrase
within a certain time frame. After this initial connection, future
connections are made with the second handshake version meaning that the
pairing phrase is rendered useless. By adding a time limit to the time
in which a user can use their pairing phrase, we reduce the risk created
by the users pairing phrase being leaked. The default time limit is set
to 10 minutes but can be customsed with the new `firstlncconndeadline`
flag.
In this commit, we update the go mod to point to the version of LNC that
contains the logic for handshake version 2. This requires that we pass
in a call back that LNC can call to persist the remote static key once
it is received. This then needs to be provided each time we start up the
session again.
In this commit, we update the go mod to point to the version of LNC that
contains the logic for handshake version 2. This requires that we pass
in a call back that LNC can call to persist the remote static key once
it is received. This then needs to be provided each time we start up the
session again.
Whenever we bake a supermacaroon, we want it to be recognizable as such.
For that we use the 64bit unsigned integer that is used as the
macaroon's storage ID (or root key ID) and set the first 4 bytes to a
specific value that we can detect later on.
Add a quit channel to mailboxSession that will be closed on session
close. This is also returned from the StartSession function so that, in
a future commit, the channel can be listened on.