watchtower/wtclient/interface+wtmock: add session key reservation

This commit is contained in:
Conner Fromknecht
2019-04-23 20:04:40 -07:00
parent df390df966
commit 0404aedede
2 changed files with 33 additions and 0 deletions

View File

@@ -23,6 +23,14 @@ type DB interface {
// LoadTower retrieves a tower by its tower ID.
LoadTower(uint64) (*wtdb.Tower, error)
// NextSessionKeyIndex reserves a new session key derivation index for a
// particular tower id. The index is reserved for that tower until
// CreateClientSession is invoked for that tower and index, at which
// point a new index for that tower can be reserved. Multiple calls to
// this method before CreateClientSession is invoked should return the
// same index.
NextSessionKeyIndex(uint64) (uint32, error)
// CreateClientSession saves a newly negotiated client session to the
// client's database. This enables the session to be used across
// restarts.