Commit 1fd69450 authored by Eric Roman's avatar Eric Roman Committed by Commit Bot

Add a histogram to measure how often we generate NTLM hashes that are locale dependent.

The goal of this histogram isn't to measure which version the server is
expecting, but rather to upper bound how many differences (success OR failure)
there _could_ be if we changed to a locale-insensitive uppercasing approach.

Bug: 1051924
Change-Id: I8ed7471a6270b95e3cd1a4d8c808d23339321a02
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2438258Reviewed-by: default avatarDavid Schinazi <dschinazi@chromium.org>
Commit-Queue: Eric Roman <eroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812219}
parent cac6cd8c
......@@ -8,7 +8,9 @@
#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"
......@@ -296,6 +298,15 @@ void GenerateNtlmHashV2(const base::string16& domain,
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()) *
......
......@@ -1811,6 +1811,20 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</summary>
</histogram>
<histogram name="Net.Ntlm.HashDependsOnLocale" enum="Boolean"
expires_after="M90">
<owner>eroman@chromium.org</owner>
<owner>src/net/OWNERS</owner>
<summary>
Whether the NTLM hash depends on the user's current locale. More
specifically, this measures whether a locale-sensitive uppercasing of the
username gives a different result from an ASCII-only uppercasing. The spec
doesn't define uppercasing rules for NTLM. This histogram is intended to
inform https://crbug.com/1051924 on how often an ambiguity would arise
should we switch to an ASCII-only approach.
</summary>
</histogram>
<histogram name="Net.NumQuicSessionsAtShutdown" units="units"
expires_after="2021-05-11">
<owner>dschinazi@chromium.org</owner>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment