Add MacOS system roots loading support. (#29957)

This change includes:
* adding a cert file path for MacOS
* updating related test to run on MacOS too
* s/linux/supported/ since this now includes more platforms
* regenerating files affected by the name change
pull/29968/head
Alessio Buraggina 2 years ago committed by GitHub
parent 347d9ed3ea
commit 990bb66ebf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      BUILD
  2. 76
      CMakeLists.txt
  3. 4
      Makefile
  4. 26
      build_autogenerated.yaml
  5. 2
      config.m4
  6. 2
      config.w32
  7. 4
      gRPC-C++.podspec
  8. 6
      gRPC-Core.podspec
  9. 4
      grpc.gemspec
  10. 4
      grpc.gyp
  11. 4
      package.xml
  12. 5
      src/core/lib/security/security_connector/load_system_roots_fallback.cc
  13. 12
      src/core/lib/security/security_connector/load_system_roots_supported.cc
  14. 10
      src/core/lib/security/security_connector/load_system_roots_supported.h
  15. 2
      src/python/grpcio/grpc_core_dependencies.py
  16. 4
      test/core/security/BUILD
  17. 10
      test/core/security/system_roots_test.cc
  18. 4
      tools/doxygen/Doxyfile.c++.internal
  19. 4
      tools/doxygen/Doxyfile.core.internal
  20. 48
      tools/run_tests/generated/tests.json

@ -5431,13 +5431,13 @@ grpc_cc_library(
srcs = [ srcs = [
"src/core/lib/security/credentials/tls/tls_utils.cc", "src/core/lib/security/credentials/tls/tls_utils.cc",
"src/core/lib/security/security_connector/load_system_roots_fallback.cc", "src/core/lib/security/security_connector/load_system_roots_fallback.cc",
"src/core/lib/security/security_connector/load_system_roots_linux.cc", "src/core/lib/security/security_connector/load_system_roots_supported.cc",
"src/core/lib/security/util/json_util.cc", "src/core/lib/security/util/json_util.cc",
], ],
hdrs = [ hdrs = [
"src/core/lib/security/credentials/tls/tls_utils.h", "src/core/lib/security/credentials/tls/tls_utils.h",
"src/core/lib/security/security_connector/load_system_roots.h", "src/core/lib/security/security_connector/load_system_roots.h",
"src/core/lib/security/security_connector/load_system_roots_linux.h", "src/core/lib/security/security_connector/load_system_roots_supported.h",
"src/core/lib/security/util/json_util.h", "src/core/lib/security/util/json_util.h",
], ],
external_deps = [ external_deps = [

76
CMakeLists.txt generated

@ -1074,7 +1074,6 @@ if(gRPC_BUILD_TESTS)
add_dependencies(buildtests_cxx latch_test) add_dependencies(buildtests_cxx latch_test)
add_dependencies(buildtests_cxx lb_get_cpu_stats_test) add_dependencies(buildtests_cxx lb_get_cpu_stats_test)
add_dependencies(buildtests_cxx lb_load_data_store_test) add_dependencies(buildtests_cxx lb_load_data_store_test)
add_dependencies(buildtests_cxx linux_system_roots_test)
add_dependencies(buildtests_cxx log_test) add_dependencies(buildtests_cxx log_test)
add_dependencies(buildtests_cxx loop_test) add_dependencies(buildtests_cxx loop_test)
add_dependencies(buildtests_cxx match_test) add_dependencies(buildtests_cxx match_test)
@ -1161,6 +1160,7 @@ if(gRPC_BUILD_TESTS)
endif() endif()
add_dependencies(buildtests_cxx streams_not_seen_test) add_dependencies(buildtests_cxx streams_not_seen_test)
add_dependencies(buildtests_cxx string_ref_test) add_dependencies(buildtests_cxx string_ref_test)
add_dependencies(buildtests_cxx system_roots_test)
add_dependencies(buildtests_cxx table_test) add_dependencies(buildtests_cxx table_test)
add_dependencies(buildtests_cxx test_core_event_engine_slice_buffer_test) add_dependencies(buildtests_cxx test_core_event_engine_slice_buffer_test)
add_dependencies(buildtests_cxx test_core_gprpp_time_test) add_dependencies(buildtests_cxx test_core_gprpp_time_test)
@ -2202,7 +2202,7 @@ add_library(grpc
src/core/lib/security/security_connector/fake/fake_security_connector.cc src/core/lib/security/security_connector/fake/fake_security_connector.cc
src/core/lib/security/security_connector/insecure/insecure_security_connector.cc src/core/lib/security/security_connector/insecure/insecure_security_connector.cc
src/core/lib/security/security_connector/load_system_roots_fallback.cc src/core/lib/security/security_connector/load_system_roots_fallback.cc
src/core/lib/security/security_connector/load_system_roots_linux.cc src/core/lib/security/security_connector/load_system_roots_supported.cc
src/core/lib/security/security_connector/local/local_security_connector.cc src/core/lib/security/security_connector/local/local_security_connector.cc
src/core/lib/security/security_connector/security_connector.cc src/core/lib/security/security_connector/security_connector.cc
src/core/lib/security/security_connector/ssl/ssl_security_connector.cc src/core/lib/security/security_connector/ssl/ssl_security_connector.cc
@ -2794,7 +2794,7 @@ add_library(grpc_unsecure
src/core/lib/security/security_connector/fake/fake_security_connector.cc src/core/lib/security/security_connector/fake/fake_security_connector.cc
src/core/lib/security/security_connector/insecure/insecure_security_connector.cc src/core/lib/security/security_connector/insecure/insecure_security_connector.cc
src/core/lib/security/security_connector/load_system_roots_fallback.cc src/core/lib/security/security_connector/load_system_roots_fallback.cc
src/core/lib/security/security_connector/load_system_roots_linux.cc src/core/lib/security/security_connector/load_system_roots_supported.cc
src/core/lib/security/security_connector/security_connector.cc src/core/lib/security/security_connector/security_connector.cc
src/core/lib/security/transport/client_auth_filter.cc src/core/lib/security/transport/client_auth_filter.cc
src/core/lib/security/transport/secure_endpoint.cc src/core/lib/security/transport/secure_endpoint.cc
@ -12955,41 +12955,6 @@ target_link_libraries(lb_load_data_store_test
) )
endif()
if(gRPC_BUILD_TESTS)
add_executable(linux_system_roots_test
test/core/security/linux_system_roots_test.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
)
target_include_directories(linux_system_roots_test
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
${_gRPC_RE2_INCLUDE_DIR}
${_gRPC_SSL_INCLUDE_DIR}
${_gRPC_UPB_GENERATED_DIR}
${_gRPC_UPB_GRPC_GENERATED_DIR}
${_gRPC_UPB_INCLUDE_DIR}
${_gRPC_XXHASH_INCLUDE_DIR}
${_gRPC_ZLIB_INCLUDE_DIR}
third_party/googletest/googletest/include
third_party/googletest/googletest
third_party/googletest/googlemock/include
third_party/googletest/googlemock
${_gRPC_PROTO_GENS_DIR}
)
target_link_libraries(linux_system_roots_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
grpc_test_util
)
endif() endif()
if(gRPC_BUILD_TESTS) if(gRPC_BUILD_TESTS)
@ -16180,6 +16145,41 @@ target_link_libraries(string_ref_test
) )
endif()
if(gRPC_BUILD_TESTS)
add_executable(system_roots_test
test/core/security/system_roots_test.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-all.cc
)
target_include_directories(system_roots_test
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
${_gRPC_RE2_INCLUDE_DIR}
${_gRPC_SSL_INCLUDE_DIR}
${_gRPC_UPB_GENERATED_DIR}
${_gRPC_UPB_GRPC_GENERATED_DIR}
${_gRPC_UPB_INCLUDE_DIR}
${_gRPC_XXHASH_INCLUDE_DIR}
${_gRPC_ZLIB_INCLUDE_DIR}
third_party/googletest/googletest/include
third_party/googletest/googletest
third_party/googletest/googlemock/include
third_party/googletest/googlemock
${_gRPC_PROTO_GENS_DIR}
)
target_link_libraries(system_roots_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
grpc_test_util
)
endif() endif()
if(gRPC_BUILD_TESTS) if(gRPC_BUILD_TESTS)

4
Makefile generated

@ -1590,7 +1590,7 @@ LIBGRPC_SRC = \
src/core/lib/security/security_connector/fake/fake_security_connector.cc \ src/core/lib/security/security_connector/fake/fake_security_connector.cc \
src/core/lib/security/security_connector/insecure/insecure_security_connector.cc \ src/core/lib/security/security_connector/insecure/insecure_security_connector.cc \
src/core/lib/security/security_connector/load_system_roots_fallback.cc \ src/core/lib/security/security_connector/load_system_roots_fallback.cc \
src/core/lib/security/security_connector/load_system_roots_linux.cc \ src/core/lib/security/security_connector/load_system_roots_supported.cc \
src/core/lib/security/security_connector/local/local_security_connector.cc \ src/core/lib/security/security_connector/local/local_security_connector.cc \
src/core/lib/security/security_connector/security_connector.cc \ src/core/lib/security/security_connector/security_connector.cc \
src/core/lib/security/security_connector/ssl/ssl_security_connector.cc \ src/core/lib/security/security_connector/ssl/ssl_security_connector.cc \
@ -2022,7 +2022,7 @@ LIBGRPC_UNSECURE_SRC = \
src/core/lib/security/security_connector/fake/fake_security_connector.cc \ src/core/lib/security/security_connector/fake/fake_security_connector.cc \
src/core/lib/security/security_connector/insecure/insecure_security_connector.cc \ src/core/lib/security/security_connector/insecure/insecure_security_connector.cc \
src/core/lib/security/security_connector/load_system_roots_fallback.cc \ src/core/lib/security/security_connector/load_system_roots_fallback.cc \
src/core/lib/security/security_connector/load_system_roots_linux.cc \ src/core/lib/security/security_connector/load_system_roots_supported.cc \
src/core/lib/security/security_connector/security_connector.cc \ src/core/lib/security/security_connector/security_connector.cc \
src/core/lib/security/transport/client_auth_filter.cc \ src/core/lib/security/transport/client_auth_filter.cc \
src/core/lib/security/transport/secure_endpoint.cc \ src/core/lib/security/transport/secure_endpoint.cc \

@ -906,7 +906,7 @@ libs:
- src/core/lib/security/security_connector/fake/fake_security_connector.h - src/core/lib/security/security_connector/fake/fake_security_connector.h
- src/core/lib/security/security_connector/insecure/insecure_security_connector.h - src/core/lib/security/security_connector/insecure/insecure_security_connector.h
- src/core/lib/security/security_connector/load_system_roots.h - src/core/lib/security/security_connector/load_system_roots.h
- src/core/lib/security/security_connector/load_system_roots_linux.h - src/core/lib/security/security_connector/load_system_roots_supported.h
- src/core/lib/security/security_connector/local/local_security_connector.h - src/core/lib/security/security_connector/local/local_security_connector.h
- src/core/lib/security/security_connector/security_connector.h - src/core/lib/security/security_connector/security_connector.h
- src/core/lib/security/security_connector/ssl/ssl_security_connector.h - src/core/lib/security/security_connector/ssl/ssl_security_connector.h
@ -1568,7 +1568,7 @@ libs:
- src/core/lib/security/security_connector/fake/fake_security_connector.cc - src/core/lib/security/security_connector/fake/fake_security_connector.cc
- src/core/lib/security/security_connector/insecure/insecure_security_connector.cc - src/core/lib/security/security_connector/insecure/insecure_security_connector.cc
- src/core/lib/security/security_connector/load_system_roots_fallback.cc - src/core/lib/security/security_connector/load_system_roots_fallback.cc
- src/core/lib/security/security_connector/load_system_roots_linux.cc - src/core/lib/security/security_connector/load_system_roots_supported.cc
- src/core/lib/security/security_connector/local/local_security_connector.cc - src/core/lib/security/security_connector/local/local_security_connector.cc
- src/core/lib/security/security_connector/security_connector.cc - src/core/lib/security/security_connector/security_connector.cc
- src/core/lib/security/security_connector/ssl/ssl_security_connector.cc - src/core/lib/security/security_connector/ssl/ssl_security_connector.cc
@ -2086,7 +2086,7 @@ libs:
- src/core/lib/security/security_connector/fake/fake_security_connector.h - src/core/lib/security/security_connector/fake/fake_security_connector.h
- src/core/lib/security/security_connector/insecure/insecure_security_connector.h - src/core/lib/security/security_connector/insecure/insecure_security_connector.h
- src/core/lib/security/security_connector/load_system_roots.h - src/core/lib/security/security_connector/load_system_roots.h
- src/core/lib/security/security_connector/load_system_roots_linux.h - src/core/lib/security/security_connector/load_system_roots_supported.h
- src/core/lib/security/security_connector/security_connector.h - src/core/lib/security/security_connector/security_connector.h
- src/core/lib/security/transport/auth_filters.h - src/core/lib/security/transport/auth_filters.h
- src/core/lib/security/transport/secure_endpoint.h - src/core/lib/security/transport/secure_endpoint.h
@ -2391,7 +2391,7 @@ libs:
- src/core/lib/security/security_connector/fake/fake_security_connector.cc - src/core/lib/security/security_connector/fake/fake_security_connector.cc
- src/core/lib/security/security_connector/insecure/insecure_security_connector.cc - src/core/lib/security/security_connector/insecure/insecure_security_connector.cc
- src/core/lib/security/security_connector/load_system_roots_fallback.cc - src/core/lib/security/security_connector/load_system_roots_fallback.cc
- src/core/lib/security/security_connector/load_system_roots_linux.cc - src/core/lib/security/security_connector/load_system_roots_supported.cc
- src/core/lib/security/security_connector/security_connector.cc - src/core/lib/security/security_connector/security_connector.cc
- src/core/lib/security/transport/client_auth_filter.cc - src/core/lib/security/transport/client_auth_filter.cc
- src/core/lib/security/transport/secure_endpoint.cc - src/core/lib/security/transport/secure_endpoint.cc
@ -6795,15 +6795,6 @@ targets:
deps: deps:
- grpc++ - grpc++
- grpc_test_util - grpc_test_util
- name: linux_system_roots_test
gtest: true
build: test
language: c++
headers: []
src:
- test/core/security/linux_system_roots_test.cc
deps:
- grpc_test_util
- name: log_test - name: log_test
gtest: true gtest: true
build: test build: test
@ -8183,6 +8174,15 @@ targets:
- grpc++ - grpc++
- grpc_test_util - grpc_test_util
uses_polling: false uses_polling: false
- name: system_roots_test
gtest: true
build: test
language: c++
headers: []
src:
- test/core/security/system_roots_test.cc
deps:
- grpc_test_util
- name: table_test - name: table_test
gtest: true gtest: true
build: test build: test

2
config.m4 generated

@ -658,7 +658,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/security/security_connector/fake/fake_security_connector.cc \ src/core/lib/security/security_connector/fake/fake_security_connector.cc \
src/core/lib/security/security_connector/insecure/insecure_security_connector.cc \ src/core/lib/security/security_connector/insecure/insecure_security_connector.cc \
src/core/lib/security/security_connector/load_system_roots_fallback.cc \ src/core/lib/security/security_connector/load_system_roots_fallback.cc \
src/core/lib/security/security_connector/load_system_roots_linux.cc \ src/core/lib/security/security_connector/load_system_roots_supported.cc \
src/core/lib/security/security_connector/local/local_security_connector.cc \ src/core/lib/security/security_connector/local/local_security_connector.cc \
src/core/lib/security/security_connector/security_connector.cc \ src/core/lib/security/security_connector/security_connector.cc \
src/core/lib/security/security_connector/ssl/ssl_security_connector.cc \ src/core/lib/security/security_connector/ssl/ssl_security_connector.cc \

2
config.w32 generated

@ -624,7 +624,7 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\security\\security_connector\\fake\\fake_security_connector.cc " + "src\\core\\lib\\security\\security_connector\\fake\\fake_security_connector.cc " +
"src\\core\\lib\\security\\security_connector\\insecure\\insecure_security_connector.cc " + "src\\core\\lib\\security\\security_connector\\insecure\\insecure_security_connector.cc " +
"src\\core\\lib\\security\\security_connector\\load_system_roots_fallback.cc " + "src\\core\\lib\\security\\security_connector\\load_system_roots_fallback.cc " +
"src\\core\\lib\\security\\security_connector\\load_system_roots_linux.cc " + "src\\core\\lib\\security\\security_connector\\load_system_roots_supported.cc " +
"src\\core\\lib\\security\\security_connector\\local\\local_security_connector.cc " + "src\\core\\lib\\security\\security_connector\\local\\local_security_connector.cc " +
"src\\core\\lib\\security\\security_connector\\security_connector.cc " + "src\\core\\lib\\security\\security_connector\\security_connector.cc " +
"src\\core\\lib\\security\\security_connector\\ssl\\ssl_security_connector.cc " + "src\\core\\lib\\security\\security_connector\\ssl\\ssl_security_connector.cc " +

4
gRPC-C++.podspec generated

@ -864,7 +864,7 @@ Pod::Spec.new do |s|
'src/core/lib/security/security_connector/fake/fake_security_connector.h', 'src/core/lib/security/security_connector/fake/fake_security_connector.h',
'src/core/lib/security/security_connector/insecure/insecure_security_connector.h', 'src/core/lib/security/security_connector/insecure/insecure_security_connector.h',
'src/core/lib/security/security_connector/load_system_roots.h', 'src/core/lib/security/security_connector/load_system_roots.h',
'src/core/lib/security/security_connector/load_system_roots_linux.h', 'src/core/lib/security/security_connector/load_system_roots_supported.h',
'src/core/lib/security/security_connector/local/local_security_connector.h', 'src/core/lib/security/security_connector/local/local_security_connector.h',
'src/core/lib/security/security_connector/security_connector.h', 'src/core/lib/security/security_connector/security_connector.h',
'src/core/lib/security/security_connector/ssl/ssl_security_connector.h', 'src/core/lib/security/security_connector/ssl/ssl_security_connector.h',
@ -1684,7 +1684,7 @@ Pod::Spec.new do |s|
'src/core/lib/security/security_connector/fake/fake_security_connector.h', 'src/core/lib/security/security_connector/fake/fake_security_connector.h',
'src/core/lib/security/security_connector/insecure/insecure_security_connector.h', 'src/core/lib/security/security_connector/insecure/insecure_security_connector.h',
'src/core/lib/security/security_connector/load_system_roots.h', 'src/core/lib/security/security_connector/load_system_roots.h',
'src/core/lib/security/security_connector/load_system_roots_linux.h', 'src/core/lib/security/security_connector/load_system_roots_supported.h',
'src/core/lib/security/security_connector/local/local_security_connector.h', 'src/core/lib/security/security_connector/local/local_security_connector.h',
'src/core/lib/security/security_connector/security_connector.h', 'src/core/lib/security/security_connector/security_connector.h',
'src/core/lib/security/security_connector/ssl/ssl_security_connector.h', 'src/core/lib/security/security_connector/ssl/ssl_security_connector.h',

6
gRPC-Core.podspec generated

@ -1422,8 +1422,8 @@ Pod::Spec.new do |s|
'src/core/lib/security/security_connector/insecure/insecure_security_connector.h', 'src/core/lib/security/security_connector/insecure/insecure_security_connector.h',
'src/core/lib/security/security_connector/load_system_roots.h', 'src/core/lib/security/security_connector/load_system_roots.h',
'src/core/lib/security/security_connector/load_system_roots_fallback.cc', 'src/core/lib/security/security_connector/load_system_roots_fallback.cc',
'src/core/lib/security/security_connector/load_system_roots_linux.cc', 'src/core/lib/security/security_connector/load_system_roots_supported.cc',
'src/core/lib/security/security_connector/load_system_roots_linux.h', 'src/core/lib/security/security_connector/load_system_roots_supported.h',
'src/core/lib/security/security_connector/local/local_security_connector.cc', 'src/core/lib/security/security_connector/local/local_security_connector.cc',
'src/core/lib/security/security_connector/local/local_security_connector.h', 'src/core/lib/security/security_connector/local/local_security_connector.h',
'src/core/lib/security/security_connector/security_connector.cc', 'src/core/lib/security/security_connector/security_connector.cc',
@ -2285,7 +2285,7 @@ Pod::Spec.new do |s|
'src/core/lib/security/security_connector/fake/fake_security_connector.h', 'src/core/lib/security/security_connector/fake/fake_security_connector.h',
'src/core/lib/security/security_connector/insecure/insecure_security_connector.h', 'src/core/lib/security/security_connector/insecure/insecure_security_connector.h',
'src/core/lib/security/security_connector/load_system_roots.h', 'src/core/lib/security/security_connector/load_system_roots.h',
'src/core/lib/security/security_connector/load_system_roots_linux.h', 'src/core/lib/security/security_connector/load_system_roots_supported.h',
'src/core/lib/security/security_connector/local/local_security_connector.h', 'src/core/lib/security/security_connector/local/local_security_connector.h',
'src/core/lib/security/security_connector/security_connector.h', 'src/core/lib/security/security_connector/security_connector.h',
'src/core/lib/security/security_connector/ssl/ssl_security_connector.h', 'src/core/lib/security/security_connector/ssl/ssl_security_connector.h',

4
grpc.gemspec generated

@ -1335,8 +1335,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/security/security_connector/insecure/insecure_security_connector.h ) s.files += %w( src/core/lib/security/security_connector/insecure/insecure_security_connector.h )
s.files += %w( src/core/lib/security/security_connector/load_system_roots.h ) s.files += %w( src/core/lib/security/security_connector/load_system_roots.h )
s.files += %w( src/core/lib/security/security_connector/load_system_roots_fallback.cc ) s.files += %w( src/core/lib/security/security_connector/load_system_roots_fallback.cc )
s.files += %w( src/core/lib/security/security_connector/load_system_roots_linux.cc ) s.files += %w( src/core/lib/security/security_connector/load_system_roots_supported.cc )
s.files += %w( src/core/lib/security/security_connector/load_system_roots_linux.h ) s.files += %w( src/core/lib/security/security_connector/load_system_roots_supported.h )
s.files += %w( src/core/lib/security/security_connector/local/local_security_connector.cc ) s.files += %w( src/core/lib/security/security_connector/local/local_security_connector.cc )
s.files += %w( src/core/lib/security/security_connector/local/local_security_connector.h ) s.files += %w( src/core/lib/security/security_connector/local/local_security_connector.h )
s.files += %w( src/core/lib/security/security_connector/security_connector.cc ) s.files += %w( src/core/lib/security/security_connector/security_connector.cc )

4
grpc.gyp generated

@ -947,7 +947,7 @@
'src/core/lib/security/security_connector/fake/fake_security_connector.cc', 'src/core/lib/security/security_connector/fake/fake_security_connector.cc',
'src/core/lib/security/security_connector/insecure/insecure_security_connector.cc', 'src/core/lib/security/security_connector/insecure/insecure_security_connector.cc',
'src/core/lib/security/security_connector/load_system_roots_fallback.cc', 'src/core/lib/security/security_connector/load_system_roots_fallback.cc',
'src/core/lib/security/security_connector/load_system_roots_linux.cc', 'src/core/lib/security/security_connector/load_system_roots_supported.cc',
'src/core/lib/security/security_connector/local/local_security_connector.cc', 'src/core/lib/security/security_connector/local/local_security_connector.cc',
'src/core/lib/security/security_connector/security_connector.cc', 'src/core/lib/security/security_connector/security_connector.cc',
'src/core/lib/security/security_connector/ssl/ssl_security_connector.cc', 'src/core/lib/security/security_connector/ssl/ssl_security_connector.cc',
@ -1371,7 +1371,7 @@
'src/core/lib/security/security_connector/fake/fake_security_connector.cc', 'src/core/lib/security/security_connector/fake/fake_security_connector.cc',
'src/core/lib/security/security_connector/insecure/insecure_security_connector.cc', 'src/core/lib/security/security_connector/insecure/insecure_security_connector.cc',
'src/core/lib/security/security_connector/load_system_roots_fallback.cc', 'src/core/lib/security/security_connector/load_system_roots_fallback.cc',
'src/core/lib/security/security_connector/load_system_roots_linux.cc', 'src/core/lib/security/security_connector/load_system_roots_supported.cc',
'src/core/lib/security/security_connector/security_connector.cc', 'src/core/lib/security/security_connector/security_connector.cc',
'src/core/lib/security/transport/client_auth_filter.cc', 'src/core/lib/security/transport/client_auth_filter.cc',
'src/core/lib/security/transport/secure_endpoint.cc', 'src/core/lib/security/transport/secure_endpoint.cc',

4
package.xml generated

@ -1317,8 +1317,8 @@
<file baseinstalldir="/" name="src/core/lib/security/security_connector/insecure/insecure_security_connector.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/security/security_connector/insecure/insecure_security_connector.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/security_connector/load_system_roots.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/security/security_connector/load_system_roots.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/security_connector/load_system_roots_fallback.cc" role="src" /> <file baseinstalldir="/" name="src/core/lib/security/security_connector/load_system_roots_fallback.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/security_connector/load_system_roots_linux.cc" role="src" /> <file baseinstalldir="/" name="src/core/lib/security/security_connector/load_system_roots_supported.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/security_connector/load_system_roots_linux.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/security/security_connector/load_system_roots_supported.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/security_connector/local/local_security_connector.cc" role="src" /> <file baseinstalldir="/" name="src/core/lib/security/security_connector/local/local_security_connector.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/security_connector/local/local_security_connector.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/security/security_connector/local/local_security_connector.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/security_connector/security_connector.cc" role="src" /> <file baseinstalldir="/" name="src/core/lib/security/security_connector/security_connector.cc" role="src" />

@ -22,7 +22,8 @@
#include "src/core/lib/security/security_connector/load_system_roots.h" #include "src/core/lib/security/security_connector/load_system_roots.h"
#if !defined(GPR_LINUX) && !defined(GPR_ANDROID) && !defined(GPR_FREEBSD) #if !defined(GPR_LINUX) && !defined(GPR_ANDROID) && !defined(GPR_FREEBSD) && \
!defined(GPR_APPLE)
namespace grpc_core { namespace grpc_core {
@ -30,4 +31,4 @@ grpc_slice LoadSystemRootCerts() { return grpc_empty_slice(); }
} // namespace grpc_core } // namespace grpc_core
#endif /* !(GPR_LINUX || GPR_ANDROID || GPR_FREEBSD) */ #endif /* !(GPR_LINUX || GPR_ANDROID || GPR_FREEBSD || GPR_APPLE) */

@ -18,11 +18,12 @@
#include <grpc/support/port_platform.h> #include <grpc/support/port_platform.h>
#include "src/core/lib/security/security_connector/load_system_roots_linux.h" #include "src/core/lib/security/security_connector/load_system_roots_supported.h"
#include <grpc/slice_buffer.h> #include <grpc/slice_buffer.h>
#if defined(GPR_LINUX) || defined(GPR_ANDROID) || defined(GPR_FREEBSD) #if defined(GPR_LINUX) || defined(GPR_ANDROID) || defined(GPR_FREEBSD) || \
defined(GPR_APPLE)
#include <dirent.h> #include <dirent.h>
#include <fcntl.h> #include <fcntl.h>
@ -63,7 +64,10 @@ const char* kCertDirectories[] = {
const char* kCertFiles[] = {"/etc/ssl/cert.pem", const char* kCertFiles[] = {"/etc/ssl/cert.pem",
"/usr/local/share/certs/ca-root-nss.crt"}; "/usr/local/share/certs/ca-root-nss.crt"};
const char* kCertDirectories[] = {""}; const char* kCertDirectories[] = {""};
#endif // GPR_FREEBSD #elif defined(GPR_APPLE) // endif GPR_FREEBSD
const char* kCertFiles[] = {"/etc/ssl/cert.pem"};
const char* kCertDirectories[] = {""};
#endif // GPR_APPLE
grpc_slice GetSystemRootCerts() { grpc_slice GetSystemRootCerts() {
grpc_slice valid_bundle_slice = grpc_empty_slice(); grpc_slice valid_bundle_slice = grpc_empty_slice();
@ -173,4 +177,4 @@ grpc_slice LoadSystemRootCerts() {
} // namespace grpc_core } // namespace grpc_core
#endif /* GPR_LINUX || GPR_ANDROID || GPR_FREEBSD */ #endif /* GPR_LINUX || GPR_ANDROID || GPR_FREEBSD || GPR_APPLE */

@ -16,14 +16,14 @@
* *
*/ */
#ifndef GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_LOAD_SYSTEM_ROOTS_LINUX_H #ifndef GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_LOAD_SYSTEM_ROOTS_SUPPORTED_H
#define GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_LOAD_SYSTEM_ROOTS_LINUX_H #define GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_LOAD_SYSTEM_ROOTS_SUPPORTED_H
#include <grpc/support/port_platform.h> #include <grpc/support/port_platform.h>
#include <grpc/slice.h> #include <grpc/slice.h>
#if defined(GPR_LINUX) || defined(GPR_FREEBSD) #if defined(GPR_LINUX) || defined(GPR_FREEBSD) || defined(GPR_APPLE)
namespace grpc_core { namespace grpc_core {
@ -41,6 +41,6 @@ void GetAbsoluteFilePath(const char* valid_file_dir,
} // namespace grpc_core } // namespace grpc_core
#endif /* GPR_LINUX || GPR_FREEBSD */ #endif /* GPR_LINUX || GPR_FREEBSD || GPR_APPLE */
#endif /* GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_LOAD_SYSTEM_ROOTS_LINUX_H \ #endif /* GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_LOAD_SYSTEM_ROOTS_SUPPORTED_H \
*/ */

@ -633,7 +633,7 @@ CORE_SOURCE_FILES = [
'src/core/lib/security/security_connector/fake/fake_security_connector.cc', 'src/core/lib/security/security_connector/fake/fake_security_connector.cc',
'src/core/lib/security/security_connector/insecure/insecure_security_connector.cc', 'src/core/lib/security/security_connector/insecure/insecure_security_connector.cc',
'src/core/lib/security/security_connector/load_system_roots_fallback.cc', 'src/core/lib/security/security_connector/load_system_roots_fallback.cc',
'src/core/lib/security/security_connector/load_system_roots_linux.cc', 'src/core/lib/security/security_connector/load_system_roots_supported.cc',
'src/core/lib/security/security_connector/local/local_security_connector.cc', 'src/core/lib/security/security_connector/local/local_security_connector.cc',
'src/core/lib/security/security_connector/security_connector.cc', 'src/core/lib/security/security_connector/security_connector.cc',
'src/core/lib/security/security_connector/ssl/ssl_security_connector.cc', 'src/core/lib/security/security_connector/ssl/ssl_security_connector.cc',

@ -174,8 +174,8 @@ grpc_cc_test(
) )
grpc_cc_test( grpc_cc_test(
name = "linux_system_roots_test", name = "system_roots_test",
srcs = ["linux_system_roots_test.cc"], srcs = ["system_roots_test.cc"],
data = [ data = [
"//test/core/security/etc:bundle.pem", "//test/core/security/etc:bundle.pem",
"//test/core/security/etc:test_roots/cert1.pem", "//test/core/security/etc:test_roots/cert1.pem",

@ -20,7 +20,7 @@
#include <stdio.h> #include <stdio.h>
#if defined(GPR_LINUX) || defined(GPR_FREEBSD) #if defined(GPR_LINUX) || defined(GPR_FREEBSD) || defined(GPR_APPLE)
#include <string.h> #include <string.h>
#include <sys/param.h> #include <sys/param.h>
@ -36,7 +36,7 @@
#include "src/core/lib/iomgr/load_file.h" #include "src/core/lib/iomgr/load_file.h"
#include "src/core/lib/security/context/security_context.h" #include "src/core/lib/security/context/security_context.h"
#include "src/core/lib/security/security_connector/load_system_roots.h" #include "src/core/lib/security/security_connector/load_system_roots.h"
#include "src/core/lib/security/security_connector/load_system_roots_linux.h" #include "src/core/lib/security/security_connector/load_system_roots_supported.h"
#include "src/core/lib/security/security_connector/security_connector.h" #include "src/core/lib/security/security_connector/security_connector.h"
#include "src/core/lib/slice/slice_string_helpers.h" #include "src/core/lib/slice/slice_string_helpers.h"
#include "src/core/tsi/ssl_transport_security.h" #include "src/core/tsi/ssl_transport_security.h"
@ -95,8 +95,8 @@ int main(int argc, char** argv) {
#else #else
int main() { int main() {
printf( printf(
"*** WARNING: this test is only supported on Linux and FreeBSD systems" "*** WARNING: this test is only supported on Linux, FreeBSD, and MacOS"
"***\n"); "systems ***\n");
return 0; return 0;
} }
#endif // GPR_LINUX || GPR_FREEBSD #endif // GPR_LINUX || GPR_FREEBSD || GPR_APPLE

@ -2318,8 +2318,8 @@ src/core/lib/security/security_connector/insecure/insecure_security_connector.cc
src/core/lib/security/security_connector/insecure/insecure_security_connector.h \ src/core/lib/security/security_connector/insecure/insecure_security_connector.h \
src/core/lib/security/security_connector/load_system_roots.h \ src/core/lib/security/security_connector/load_system_roots.h \
src/core/lib/security/security_connector/load_system_roots_fallback.cc \ src/core/lib/security/security_connector/load_system_roots_fallback.cc \
src/core/lib/security/security_connector/load_system_roots_linux.cc \ src/core/lib/security/security_connector/load_system_roots_supported.cc \
src/core/lib/security/security_connector/load_system_roots_linux.h \ src/core/lib/security/security_connector/load_system_roots_supported.h \
src/core/lib/security/security_connector/local/local_security_connector.cc \ src/core/lib/security/security_connector/local/local_security_connector.cc \
src/core/lib/security/security_connector/local/local_security_connector.h \ src/core/lib/security/security_connector/local/local_security_connector.h \
src/core/lib/security/security_connector/security_connector.cc \ src/core/lib/security/security_connector/security_connector.cc \

@ -2112,8 +2112,8 @@ src/core/lib/security/security_connector/insecure/insecure_security_connector.cc
src/core/lib/security/security_connector/insecure/insecure_security_connector.h \ src/core/lib/security/security_connector/insecure/insecure_security_connector.h \
src/core/lib/security/security_connector/load_system_roots.h \ src/core/lib/security/security_connector/load_system_roots.h \
src/core/lib/security/security_connector/load_system_roots_fallback.cc \ src/core/lib/security/security_connector/load_system_roots_fallback.cc \
src/core/lib/security/security_connector/load_system_roots_linux.cc \ src/core/lib/security/security_connector/load_system_roots_supported.cc \
src/core/lib/security/security_connector/load_system_roots_linux.h \ src/core/lib/security/security_connector/load_system_roots_supported.h \
src/core/lib/security/security_connector/local/local_security_connector.cc \ src/core/lib/security/security_connector/local/local_security_connector.cc \
src/core/lib/security/security_connector/local/local_security_connector.h \ src/core/lib/security/security_connector/local/local_security_connector.h \
src/core/lib/security/security_connector/security_connector.cc \ src/core/lib/security/security_connector/security_connector.cc \

@ -5187,30 +5187,6 @@
], ],
"uses_polling": true "uses_polling": true
}, },
{
"args": [],
"benchmark": false,
"ci_platforms": [
"linux",
"mac",
"posix",
"windows"
],
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
"gtest": true,
"language": "c++",
"name": "linux_system_roots_test",
"platforms": [
"linux",
"mac",
"posix",
"windows"
],
"uses_polling": true
},
{ {
"args": [], "args": [],
"benchmark": false, "benchmark": false,
@ -6853,6 +6829,30 @@
], ],
"uses_polling": false "uses_polling": false
}, },
{
"args": [],
"benchmark": false,
"ci_platforms": [
"linux",
"mac",
"posix",
"windows"
],
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
"gtest": true,
"language": "c++",
"name": "system_roots_test",
"platforms": [
"linux",
"mac",
"posix",
"windows"
],
"uses_polling": true
},
{ {
"args": [], "args": [],
"benchmark": false, "benchmark": false,

Loading…
Cancel
Save