Add documentation for timeattack

This commit is contained in:
9seconds
2021-04-06 11:03:51 +03:00
parent 372c703ad6
commit a3bae795c4
4 changed files with 18 additions and 3 deletions
+8
View File
@@ -129,7 +129,15 @@ type EventStream interface {
Send(context.Context, Event)
}
// TimeAttackDetector is an abstraction that checks a time, taken from
// the faketls client hello message. This timestamp is encoded into
// client-generated random bytes and can be extracted after some client
// hello verification.
//
// This is mostly to prevent replay attacks.
type TimeAttackDetector interface {
// Valid returns an error if timestamp is invalid or should not be
// accepted.
Valid(time.Time) error
}