зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1788290 - Add the telemetry for Web Privacy. r=keeler.
Differential Revision: https://phabricator.services.mozilla.com/D156107
This commit is contained in:
Родитель
97f4470f70
Коммит
a7c2f2a620
|
@ -1201,6 +1201,39 @@ static void reportHandshakeResult(int32_t bytesTransferred, bool wasReading,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Telemetry::Accumulate(Telemetry::SSL_HANDSHAKE_RESULT, bucket);
|
Telemetry::Accumulate(Telemetry::SSL_HANDSHAKE_RESULT, bucket);
|
||||||
|
|
||||||
|
if (bucket == 0) {
|
||||||
|
// Web Privacy Telemetry for successful connections.
|
||||||
|
// Discard errors from these function calls in release.
|
||||||
|
bool success = true;
|
||||||
|
|
||||||
|
bool usedPrivateDNS = false;
|
||||||
|
success &= socketInfo->GetUsedPrivateDNS(&usedPrivateDNS) == NS_OK;
|
||||||
|
MOZ_ASSERT(success, "Transport Security Getters should not fail.");
|
||||||
|
|
||||||
|
bool madeOCSPRequest = false;
|
||||||
|
success &= socketInfo->GetMadeOCSPRequests(&madeOCSPRequest) == NS_OK;
|
||||||
|
MOZ_ASSERT(success, "Transport Security Getters should not fail.");
|
||||||
|
|
||||||
|
uint16_t protocolVersion = 0;
|
||||||
|
success &= socketInfo->GetProtocolVersion(&protocolVersion) == NS_OK;
|
||||||
|
MOZ_ASSERT(success, "Transport Security Getters should not fail.");
|
||||||
|
bool usedTLS13 = protocolVersion == 4;
|
||||||
|
|
||||||
|
bool usedECH = false;
|
||||||
|
success &= socketInfo->GetIsAcceptedEch(&usedECH) == NS_OK;
|
||||||
|
MOZ_ASSERT(success, "Transport Security Getters should not fail.");
|
||||||
|
|
||||||
|
if (success) {
|
||||||
|
uint8_t TLSPrivacyResult = 0;
|
||||||
|
TLSPrivacyResult |= usedTLS13 << 0;
|
||||||
|
TLSPrivacyResult |= !madeOCSPRequest << 1;
|
||||||
|
TLSPrivacyResult |= usedPrivateDNS << 2;
|
||||||
|
TLSPrivacyResult |= usedECH << 3;
|
||||||
|
|
||||||
|
Telemetry::Accumulate(Telemetry::SSL_HANDSHAKE_PRIVACY, TLSPrivacyResult);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t checkHandshake(int32_t bytesTransfered, bool wasReading,
|
int32_t checkHandshake(int32_t bytesTransfered, bool wasReading,
|
||||||
|
|
|
@ -3120,6 +3120,17 @@
|
||||||
"n_values": 16,
|
"n_values": 16,
|
||||||
"description": "Negotiated SSL Version (1=tls1, 2=tls1.1, 3=tls1.2, 4=tls1.3)"
|
"description": "Negotiated SSL Version (1=tls1, 2=tls1.1, 3=tls1.2, 4=tls1.3)"
|
||||||
},
|
},
|
||||||
|
"SSL_HANDSHAKE_PRIVACY": {
|
||||||
|
"record_in_processes": ["main", "socket"],
|
||||||
|
"products": ["firefox", "fennec"],
|
||||||
|
"alert_emails": ["seceng-telemetry@mozilla.com"],
|
||||||
|
"bug_numbers": [1788290],
|
||||||
|
"releaseChannelCollection": "opt-out",
|
||||||
|
"expires_in_version": "never",
|
||||||
|
"kind": "enumerated",
|
||||||
|
"n_values": 16,
|
||||||
|
"description": "0th bit - TLS13 used? 1th bit - Revocation Privacy, 2nd bit - DNS Privacy, 3rd bit - ECH Privacy"
|
||||||
|
},
|
||||||
"SSL_HANDSHAKE_RESULT": {
|
"SSL_HANDSHAKE_RESULT": {
|
||||||
"record_in_processes": ["main", "content"],
|
"record_in_processes": ["main", "content"],
|
||||||
"products": ["firefox", "fennec"],
|
"products": ["firefox", "fennec"],
|
||||||
|
|
Загрузка…
Ссылка в новой задаче