mirror of https://github.com/cbeuw/Cloak
Move MockDomainList to LocalConnConfig as the list doesn't need to be sent to the remote
This commit is contained in:
parent
4a66426e30
commit
b9cccbe815
|
|
@ -177,7 +177,7 @@ func main() {
|
||||||
// sessionID is usergenerated. There shouldn't be a security concern because the scope of
|
// sessionID is usergenerated. There shouldn't be a security concern because the scope of
|
||||||
// sessionID is limited to its UID.
|
// sessionID is limited to its UID.
|
||||||
|
|
||||||
authInfo.MockDomain = authInfo.MockDomainList[rand.Intn(len(authInfo.MockDomainList))]
|
authInfo.MockDomain = localConfig.MockDomainList[rand.Intn(len(localConfig.MockDomainList))]
|
||||||
quad := make([]byte, 4)
|
quad := make([]byte, 4)
|
||||||
common.RandRead(authInfo.WorldState.Rand, quad)
|
common.RandRead(authInfo.WorldState.Rand, quad)
|
||||||
authInfo.SessionId = binary.BigEndian.Uint32(quad)
|
authInfo.SessionId = binary.BigEndian.Uint32(quad)
|
||||||
|
|
|
||||||
|
|
@ -49,8 +49,9 @@ type RemoteConnConfig struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type LocalConnConfig struct {
|
type LocalConnConfig struct {
|
||||||
LocalAddr string
|
LocalAddr string
|
||||||
Timeout time.Duration
|
Timeout time.Duration
|
||||||
|
MockDomainList []string
|
||||||
}
|
}
|
||||||
|
|
||||||
type AuthInfo struct {
|
type AuthInfo struct {
|
||||||
|
|
@ -61,7 +62,6 @@ type AuthInfo struct {
|
||||||
Unordered bool
|
Unordered bool
|
||||||
ServerPubKey crypto.PublicKey
|
ServerPubKey crypto.PublicKey
|
||||||
MockDomain string
|
MockDomain string
|
||||||
MockDomainList []string
|
|
||||||
WorldState common.WorldState
|
WorldState common.WorldState
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -154,8 +154,8 @@ func (raw *RawConfig) ProcessRawConfig(worldState common.WorldState) (local Loca
|
||||||
return nullErr("ServerName")
|
return nullErr("ServerName")
|
||||||
}
|
}
|
||||||
auth.MockDomain = raw.ServerName
|
auth.MockDomain = raw.ServerName
|
||||||
auth.MockDomainList = raw.AlternativeNames
|
local.MockDomainList = raw.AlternativeNames
|
||||||
auth.MockDomainList = append(auth.MockDomainList, auth.MockDomain)
|
local.MockDomainList = append(local.MockDomainList, auth.MockDomain)
|
||||||
if raw.ProxyMethod == "" {
|
if raw.ProxyMethod == "" {
|
||||||
return nullErr("ServerName")
|
return nullErr("ServerName")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue