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 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)
|
||||
common.RandRead(authInfo.WorldState.Rand, quad)
|
||||
authInfo.SessionId = binary.BigEndian.Uint32(quad)
|
||||
|
|
|
|||
|
|
@ -49,8 +49,9 @@ type RemoteConnConfig struct {
|
|||
}
|
||||
|
||||
type LocalConnConfig struct {
|
||||
LocalAddr string
|
||||
Timeout time.Duration
|
||||
LocalAddr string
|
||||
Timeout time.Duration
|
||||
MockDomainList []string
|
||||
}
|
||||
|
||||
type AuthInfo struct {
|
||||
|
|
@ -61,7 +62,6 @@ type AuthInfo struct {
|
|||
Unordered bool
|
||||
ServerPubKey crypto.PublicKey
|
||||
MockDomain string
|
||||
MockDomainList []string
|
||||
WorldState common.WorldState
|
||||
}
|
||||
|
||||
|
|
@ -154,8 +154,8 @@ func (raw *RawConfig) ProcessRawConfig(worldState common.WorldState) (local Loca
|
|||
return nullErr("ServerName")
|
||||
}
|
||||
auth.MockDomain = raw.ServerName
|
||||
auth.MockDomainList = raw.AlternativeNames
|
||||
auth.MockDomainList = append(auth.MockDomainList, auth.MockDomain)
|
||||
local.MockDomainList = raw.AlternativeNames
|
||||
local.MockDomainList = append(local.MockDomainList, auth.MockDomain)
|
||||
if raw.ProxyMethod == "" {
|
||||
return nullErr("ServerName")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue