|
|
@@ -129,7 +129,15 @@ type EventStream interface {
|
|
129
|
129
|
Send(context.Context, Event)
|
|
130
|
130
|
}
|
|
131
|
131
|
|
|
|
132
|
+// TimeAttackDetector is an abstraction that checks a time, taken from
|
|
|
133
|
+// the faketls client hello message. This timestamp is encoded into
|
|
|
134
|
+// client-generated random bytes and can be extracted after some client
|
|
|
135
|
+// hello verification.
|
|
|
136
|
+//
|
|
|
137
|
+// This is mostly to prevent replay attacks.
|
|
132
|
138
|
type TimeAttackDetector interface {
|
|
|
139
|
+ // Valid returns an error if timestamp is invalid or should not be
|
|
|
140
|
+ // accepted.
|
|
133
|
141
|
Valid(time.Time) error
|
|
134
|
142
|
}
|
|
135
|
143
|
|