Commit 0291eb3a authored by Eric Roman's avatar Eric Roman Committed by Commit Bot

NetLog the SPN used for integrated authentication on Windows.

A similar change is not needed for POSIX platforms, as they log the SPN as part of the AUTH_LIBRARY_IMPORT_NAME event.

Bug: 924746
Change-Id: I8cc1c8e5fb95334fa3ad078adeac3dff96f8d0ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2227176
Commit-Queue: Eric Roman <eroman@chromium.org>
Reviewed-by: default avatarAsanka Herath <asanka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#774856}
parent 08c6a377
...@@ -547,7 +547,12 @@ int HttpAuthSSPI::GetNextSecurityToken(const std::string& spn, ...@@ -547,7 +547,12 @@ int HttpAuthSSPI::GetNextSecurityToken(const std::string& spn,
if (delegation_type_ != DelegationType::kNone) if (delegation_type_ != DelegationType::kNone)
context_flags |= (ISC_REQ_DELEGATE | ISC_REQ_MUTUAL_AUTH); context_flags |= (ISC_REQ_DELEGATE | ISC_REQ_MUTUAL_AUTH);
net_log.BeginEvent(NetLogEventType::AUTH_LIBRARY_INIT_SEC_CTX); net_log.BeginEvent(NetLogEventType::AUTH_LIBRARY_INIT_SEC_CTX, [&] {
base::Value params{base::Value::Type::DICTIONARY};
params.SetStringKey("spn", spn);
params.SetKey("flags", ContextFlagsToValue(context_flags));
return params;
});
// This returns a token that is passed to the remote server. // This returns a token that is passed to the remote server.
DWORD context_attributes = 0; DWORD context_attributes = 0;
......
...@@ -258,6 +258,18 @@ TEST(HttpAuthSSPITest, GenerateAuthToken_FullHandshake_AmbientCreds_Logging) { ...@@ -258,6 +258,18 @@ TEST(HttpAuthSSPITest, GenerateAuthToken_FullHandshake_AmbientCreds_Logging) {
net_log.GetEntriesWithType(NetLogEventType::AUTH_LIBRARY_INIT_SEC_CTX); net_log.GetEntriesWithType(NetLogEventType::AUTH_LIBRARY_INIT_SEC_CTX);
ASSERT_EQ(4u, entries.size()); ASSERT_EQ(4u, entries.size());
expected = base::JSONReader::Read(R"(
{
"flags": {
"delegated": false,
"mutual": false,
"value": "0x00000000"
},
"spn": "HTTP/intranet.google.com"
}
)");
EXPECT_EQ(expected, entries[0].params);
expected = base::JSONReader::Read(R"( expected = base::JSONReader::Read(R"(
{ {
"context": { "context": {
......
...@@ -2658,13 +2658,21 @@ EVENT_TYPE(AUTH_LIBRARY_ACQUIRE_CREDS) ...@@ -2658,13 +2658,21 @@ EVENT_TYPE(AUTH_LIBRARY_ACQUIRE_CREDS)
// This operation involves invoking an external library which may perform disk, // This operation involves invoking an external library which may perform disk,
// IPC, and network IO as a part of its work. // IPC, and network IO as a part of its work.
// //
// On Posix platforms, the END phase has the following parameters. // On Windows, the BEGIN phase has the following parameters:
// {
// "spn": <Service Principle Name>,
// "context_flags": <Integer with bitfield value>
// }
//
// The END phase has the following parameters.
//
// On Posix platforms:
// { // {
// "context": <GSSAPI Context Description>, // "context": <GSSAPI Context Description>,
// "status" : <GSSAPI Status if the operation failed> // "status" : <GSSAPI Status if the operation failed>
// } // }
// //
// On Windows, the END phase has the following parameters. // On Windows:
// { // {
// "context": <SSPI Context Description> // "context": <SSPI Context Description>
// "status" : <SSPI SECURITY_STATUS> // "status" : <SSPI SECURITY_STATUS>
......
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