Rod Hynes 8 лет назад
Родитель
Сommit
20219ed6e6
2 измененных файлов с 3 добавлено и 1 удалено
  1. 2 1
      psiphon/common/tactics/tactics.go
  2. 1 0
      psiphon/server/api.go

+ 2 - 1
psiphon/common/tactics/tactics.go

@@ -1262,12 +1262,13 @@ func FetchTactics(
 // enables the client performing the speed test to record the
 // sample time with an accurate server clock; the random padding
 // is to frustrate fingerprinting.
+// The speed test timestamp is truncated as a privacy measure.
 func MakeSpeedTestResponse(minPadding, maxPadding int) ([]byte, error) {
 
 	// MarshalBinary encoding (version 1) is 15 bytes:
 	// https://github.com/golang/go/blob/release-branch.go1.9/src/time/time.go#L1112
 
-	timestamp, err := time.Now().UTC().MarshalBinary()
+	timestamp, err := time.Now().UTC().Truncate(1 * time.Hour).MarshalBinary()
 	if err == nil && len(timestamp) > 255 {
 		err = fmt.Errorf("unexpected marshaled time size: %d", len(timestamp))
 	}

+ 1 - 0
psiphon/server/api.go

@@ -315,6 +315,7 @@ var connectedRequestParams = append(
 // established and at least once per day. The last_connected input value,
 // which should be a connected_timestamp output from a previous connected
 // response, is used to calculate unique user stats.
+// connected_timestamp is truncated as a privacy measure.
 func connectedAPIRequestHandler(
 	support *SupportServices,
 	geoIPData GeoIPData,