diff --git a/cmd/ck-client/ck-client.go b/cmd/ck-client/ck-client.go index 01c5cba..08282d5 100644 --- a/cmd/ck-client/ck-client.go +++ b/cmd/ck-client/ck-client.go @@ -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) diff --git a/internal/client/state.go b/internal/client/state.go index ff84a2e..0ab8270 100644 --- a/internal/client/state.go +++ b/internal/client/state.go @@ -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") }