Skip to content

Commit

Permalink
Remove histogram Net.Ntlm.HashDependsOnLocale
Browse files Browse the repository at this point in the history
Enough data has been collected from the histogram
Net.Ntlm.HashDependsOnLocale and it is set to expire. Remove it.

BUG=1051924,1249094

Change-Id: I8d9a97acbc9d24e86f64ba7ccdcf8e2c9a374a5e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3158984
Commit-Queue: Adam Rice <[email protected]>
Reviewed-by: Ryan Sleevi <[email protected]>
Reviewed-by: Weilun Shi <[email protected]>
Cr-Commit-Position: refs/heads/main@{#929077}
ricea authored and Chromium LUCI CQ committed Oct 7, 2021
1 parent 048c4fc commit 0e05fb1
Showing 2 changed files with 8 additions and 11 deletions.
16 changes: 5 additions & 11 deletions net/ntlm/ntlm.cc
Original file line number Diff line number Diff line change
@@ -8,9 +8,7 @@

#include "base/check_op.h"
#include "base/containers/span.h"
#include "base/metrics/histogram_macros.h"
#include "base/notreached.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "net/base/net_string_util.h"
#include "net/ntlm/ntlm_buffer_writer.h"
@@ -294,19 +292,15 @@ void GenerateNtlmHashV2(const std::u16string& domain,
base::span<uint8_t, kNtlmHashLen> v2_hash) {
// NOTE: According to [MS-NLMP] Section 3.3.2 only the username and not the
// domain is uppercased.

// TODO(https://crbug.com/1051924): Using a locale-sensitive upper casing
// algorithm is problematic. A more predictable approach would be to only
// uppercase ASCII characters, so the hash does not change depending on the
// user's locale.
std::u16string upper_username;
bool result = ToUpper(username, &upper_username);
DCHECK(result);

// TODO(https://crbug.com/1051924): Using a locale-sensitive upper casing
// algorithm is problematic. A more predictable approach is to only uppercase
// ASCII characters, so the hash does not change depending on the user's
// locale. Histogram how often the locale-sensitive ToUpper() gives a result
// that differs from ASCII uppercasing, to see how often this ambiguity arises
// in practice.
UMA_HISTOGRAM_BOOLEAN("Net.Ntlm.HashDependsOnLocale",
upper_username != base::ToUpperASCII(username));

uint8_t v1_hash[kNtlmHashLen];
GenerateNtlmHashV1(password, v1_hash);
NtlmBufferWriter input_writer((upper_username.length() + domain.length()) *
3 changes: 3 additions & 0 deletions tools/metrics/histograms/metadata/net/histograms.xml
Original file line number Diff line number Diff line change
@@ -2377,6 +2377,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.

<histogram name="Net.Ntlm.HashDependsOnLocale" enum="Boolean"
expires_after="2021-10-25">
<obsolete>
Removed in 2021/09.
</obsolete>
<owner>[email protected]</owner>
<owner>src/net/OWNERS</owner>
<summary>

0 comments on commit 0e05fb1

Please sign in to comment.