Commit 48ddc2de authored by Asanka Herath's avatar Asanka Herath Committed by Commit Bot

[net/auth] Simplify GN condition for using external GSSAPI

Use of GSSAPI libraries is gated on a complicated condition that's
repeated in multiple locations. In reality it simplifies greatly since
there are only two exceptions to the "Use an external POSIXish GSSAPI
library if supporting Kerberos" rule.

Bug: 927182
Change-Id: I6e3b514cdddb857409e90ee9fd0460d8d7836404
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1640782
Commit-Queue: Asanka Herath <asanka@chromium.org>
Reviewed-by: default avatarMatt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#665646}
parent d683ebf6
......@@ -55,6 +55,18 @@ enable_python_utils =
# won't get either.
use_remote_test_server = !enable_python_utils && !is_ios
# Whether //net should use an external GSSAPI library for implementing HTTP
# Negotiate authentication. All platforms for which use_kerberos is true should
# have some external implementation since //net doesn't have intrinsic support
# for Kerberos. This implementation is an external GSSAPI library on all
# platforms except on:
#
# Windows : Uses SSPI for Negotiate authentication.
#
# Android : Uses an external authenticator. See
# https://www.chromium.org/developers/design-documents/http-authentication/writing-a-spnego-authenticator-for-chrome-on-android
use_external_gssapi = use_kerberos && !is_android && !is_win
config("net_test_config") {
if (use_remote_test_server) {
defines = [ "USE_REMOTE_TEST_SERVER" ]
......@@ -77,10 +89,7 @@ buildflag_header("buildflags") {
}
config("net_internal_config") {
defines = [
"DLOPEN_KERBEROS",
"NET_IMPLEMENTATION",
]
defines = [ "NET_IMPLEMENTATION" ]
if (use_kerberos && is_android) {
include_dirs = [ "/usr/include/kerberosV" ]
......@@ -89,6 +98,10 @@ config("net_internal_config") {
if (enable_built_in_dns) {
defines += [ "ENABLE_BUILT_IN_DNS" ]
}
if (use_external_gssapi) {
defines += [ "DLOPEN_KERBEROS" ]
}
}
net_configs = [
......@@ -1907,7 +1920,7 @@ component("net") {
]
}
if (use_kerberos && ((is_posix && !is_android) || is_fuchsia)) {
if (use_external_gssapi) {
sources += [
"http/http_auth_gssapi_posix.cc",
"http/http_auth_gssapi_posix.h",
......@@ -5758,15 +5771,14 @@ test("net_unittests") {
}
}
# These are excluded on Android, because the actual Kerberos support, which
# these test, is in a separate app on Android.
if (use_kerberos && ((is_posix && !is_android) || is_fuchsia)) {
if (use_external_gssapi) {
sources += [
"http/http_auth_gssapi_posix_unittest.cc",
"http/mock_gssapi_library_posix.cc",
"http/mock_gssapi_library_posix.h",
]
}
if (!use_kerberos) {
sources -= [ "http/http_auth_handler_negotiate_unittest.cc" ]
}
......
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