watchtower/wtdb: apply sanity checks to session policy before accepting

This commit is contained in:
Conner Fromknecht committed 2019-06-13 19:54:22 -07:00
1 parent 1979f9a7c0
commit 059887bd7b
3 files changed
+18

No files matched your search

+6
View File
@@ -193,6 +193,12 @@ func (t *TowerDB) InsertSessionInfo(session *SessionInfo) error {
return ErrSessionAlreadyExists
}
// Perform a quick sanity check on the session policy before
// accepting.
if err := session.Policy.Validate(); err != nil {
return err
}
err = putSession(sessions, session)
if err != nil {
return err