mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 14:54:01 +03:00
Remove timeattack module
This commit is contained in:
+4
-16
@@ -42,10 +42,6 @@ var (
|
||||
// create a proxy but anti replay cache value is undefined.
|
||||
ErrAntiReplayCacheIsNotDefined = errors.New("anti-replay cache is not defined")
|
||||
|
||||
// ErrTimeAttackDetectorIsNotDefined is returned if you are trying to
|
||||
// create a proxy but time attack detector is not defined.
|
||||
ErrTimeAttackDetectorIsNotDefined = errors.New("time attack detector is not defined")
|
||||
|
||||
// ErrIPBlocklistIsNotDefined is returned if you are trying to
|
||||
// create a proxy but ip blocklist instance is not defined.
|
||||
ErrIPBlocklistIsNotDefined = errors.New("ip blocklist is not defined")
|
||||
@@ -75,6 +71,10 @@ const (
|
||||
// in case of idling.
|
||||
DefaultIdleTimeout = time.Minute
|
||||
|
||||
// DefaultTolerateTimeSkewness is a default timeout for time
|
||||
// skewness on a faketls timeout verification.
|
||||
DefaultTolerateTimeSkewness = 3 * time.Second
|
||||
|
||||
// DefaultPreferIP is a default value for Telegram IP connectivity
|
||||
// preference.
|
||||
DefaultPreferIP = "prefer-ipv6"
|
||||
@@ -206,18 +206,6 @@ 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
|
||||
}
|
||||
|
||||
// Logger defines an interface of the logger used by mtglib.
|
||||
//
|
||||
// Each logger has a name. It is possible to stack names to organize
|
||||
|
||||
Reference in New Issue
Block a user