Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macos system roots implementation #16246

Closed

Conversation

maliksaafir
Copy link

@maliksaafir maliksaafir commented Aug 4, 2018

This implements the utilization of MacOS system root certificates. It's currently missing the implementation of a feature to remove distrusted certs from the cert pool gathered by the code.

@grpc-testing
Copy link

****************************************************************

libgrpc.so

     VM SIZE                                                                           FILE SIZE
 ++++++++++++++ GROWING                                                             ++++++++++++++
  +0.3% +1.89Ki [None]                                                              +28.0Ki  +0.3%
      +0.3% +1.92Ki [Unmapped]                                                          +28.0Ki  +0.3%
      [NEW]     +16 CSWTCH.83                                                               +16  [NEW]
  [NEW] +1.31Ki src/core/lib/security/security_connector/load_system_roots_linux.cc +1.31Ki  [NEW]
      [NEW]    +773 grpc_core::CreateRootCertsBundle                                       +773  [NEW]
      [NEW]    +225 grpc_core::LoadSystemRootCerts                                         +225  [NEW]
      [NEW]    +170 grpc_core::GetSystemRootCerts                                          +170  [NEW]
      [NEW]     +68 grpc_core::GetAbsoluteFilePath                                          +68  [NEW]
      [NEW]     +40 grpc_core::linux_cert_files_                                            +40  [NEW]
      [NEW]     +40 grpc_core::linux_cert_directories_                                      +40  [NEW]
      [NEW]     +29 [Unmapped]                                                              +29  [NEW]
  +1.6%    +160 src/core/lib/security/security_connector/security_connector.cc         +160  +1.6%
       +38%    +168 grpc_core::DefaultSslRootStore::ComputePemRootCerts                    +168   +38%

  +0.2% +3.36Ki TOTAL                                                               +29.5Ki  +0.3%


****************************************************************

libgrpc++.so

     VM SIZE        FILE SIZE
 ++++++++++++++  ++++++++++++++

  [ = ]       0        0  [ = ]



@grpc-testing
Copy link

[trickle] No significant performance differences

@grpc-testing
Copy link

[microbenchmarks] No significant performance differences

@maliksaafir maliksaafir force-pushed the macos-system-roots-clean-history branch from 6593233 to e10f67b Compare August 8, 2018 00:27
@maliksaafir maliksaafir changed the title [WIP] Macos system roots implementation Macos system roots implementation Aug 8, 2018
@grpc-testing
Copy link

****************************************************************

libgrpc.so

     VM SIZE                                                                           FILE SIZE
 ++++++++++++++ GROWING                                                             ++++++++++++++
  +0.2% +1.79Ki [None]                                                              +27.9Ki  +0.3%
      +0.3% +1.71Ki [Unmapped]                                                          +27.8Ki  +0.3%
      [NEW]     +40 grpc_core::(anonymous namespace)::kLinuxCertFiles                       +40  [NEW]
      [NEW]     +40 grpc_core::(anonymous namespace)::kLinuxCertDirectories                 +40  [NEW]
      [NEW]     +16 CSWTCH.83                                                               +16  [NEW]
  [NEW] +1.43Ki src/core/lib/security/security_connector/load_system_roots_linux.cc +1.43Ki  [NEW]
      [NEW]    +921 grpc_core::CreateRootCertsBundle                                       +921  [NEW]
      [NEW]    +426 grpc_core::LoadSystemRootCerts                                         +426  [NEW]
      [NEW]    +105 grpc_core::GetAbsoluteFilePath                                         +105  [NEW]
      [NEW]     +14 [Unmapped]                                                              +14  [NEW]
  +1.6%    +160 src/core/lib/security/security_connector/security_connector.cc         +160  +1.6%
       +38%    +168 grpc_core::DefaultSslRootStore::ComputePemRootCerts                    +168   +38%

  +0.2% +3.38Ki TOTAL                                                               +29.5Ki  +0.3%


****************************************************************

libgrpc++.so

     VM SIZE        FILE SIZE
 ++++++++++++++  ++++++++++++++

  [ = ]       0        0  [ = ]



@grpc-testing
Copy link

[trickle] No significant performance differences

@grpc-testing
Copy link

[microbenchmarks] No significant performance differences

@grpc-testing
Copy link

****************************************************************

libgrpc.so

     VM SIZE                                                                           FILE SIZE
 ++++++++++++++ GROWING                                                             ++++++++++++++
  +0.2% +1.79Ki [None]                                                              +27.9Ki  +0.3%
      +0.3% +1.71Ki [Unmapped]                                                          +27.8Ki  +0.3%
      [NEW]     +40 grpc_core::(anonymous namespace)::kLinuxCertFiles                       +40  [NEW]
      [NEW]     +40 grpc_core::(anonymous namespace)::kLinuxCertDirectories                 +40  [NEW]
      [NEW]     +16 CSWTCH.83                                                               +16  [NEW]
  [NEW] +1.43Ki src/core/lib/security/security_connector/load_system_roots_linux.cc +1.43Ki  [NEW]
      [NEW]    +921 grpc_core::CreateRootCertsBundle                                       +921  [NEW]
      [NEW]    +426 grpc_core::LoadSystemRootCerts                                         +426  [NEW]
      [NEW]    +105 grpc_core::GetAbsoluteFilePath                                         +105  [NEW]
      [NEW]     +14 [Unmapped]                                                              +14  [NEW]
  +1.6%    +160 src/core/lib/security/security_connector/security_connector.cc         +160  +1.6%
       +38%    +168 grpc_core::DefaultSslRootStore::ComputePemRootCerts                    +168   +38%

  +0.2% +3.38Ki TOTAL                                                               +29.5Ki  +0.3%


****************************************************************

libgrpc++.so

     VM SIZE        FILE SIZE
 ++++++++++++++  ++++++++++++++

  [ = ]       0        0  [ = ]



@grpc-testing
Copy link

[trickle] No significant performance differences

@maliksaafir maliksaafir force-pushed the macos-system-roots-clean-history branch from 361ffcf to 562a1e5 Compare August 10, 2018 00:24
@grpc-testing
Copy link

[microbenchmarks] No significant performance differences

@maliksaafir maliksaafir force-pushed the macos-system-roots-clean-history branch from 562a1e5 to f409732 Compare August 10, 2018 15:57
tdbhacks and others added 10 commits August 10, 2018 10:03
Added a flag-guarded feature that allows gRPC to load TLS/SSL
roots from the OS trust store. This is the Linux-specific
implementation of such feature.
- Removed instances of d_type, now using POSIX-compliant stat;
- Not including dirent.h on Windows anymore.
- Now using suggested structure to handle platform specificity;
- Addressed first wave of review comments and suggestions.
- should fix build errors on non-linux systems
- slight formatting
- Fixed wrong include statement that was causing Windows failures
- Added system roots flag to grpc_security_constants.h
- Removed MacOS and Windows references, focusing on Linux now
- Removed old unit test from security_connector_test.cc
- Regenerated project files and added new files to BUILD, which
should address Bazel build failures.
- One of the unit tests introduced in security_connector_test
is now Linux-specific as a way to temporarily address the issue
while we investigate its failure on MacOS.
- Minor comment improvements.
- add missing gpr_frees and grpc_slice_unrefs
gpr_getenv() was causing memory leaks. Freed variables accordingly.
After a quick check, valgrind does not show any memory leaks now.
@grpc-testing
Copy link

****************************************************************

libgrpc.so

     VM SIZE              FILE SIZE
 ++++++++++++++ GROWIN ++++++++++++++
  [ = ]       0 [None]    +576  +0.0%

  [ = ]       0 TOTAL     +576  +0.0%


****************************************************************

libgrpc++.so

     VM SIZE        FILE SIZE
 ++++++++++++++  ++++++++++++++

  [ = ]       0        0  [ = ]



@grpc-testing
Copy link

[trickle] No significant performance differences

- TODO for compatibility with iOS Security library
@grpc-testing
Copy link

[microbenchmarks] No significant performance differences

@grpc-testing
Copy link

****************************************************************

libgrpc.so

     VM SIZE              FILE SIZE
 ++++++++++++++ GROWIN ++++++++++++++
  [ = ]       0 [None]    +576  +0.0%

  [ = ]       0 TOTAL     +576  +0.0%


****************************************************************

libgrpc++.so

     VM SIZE        FILE SIZE
 ++++++++++++++  ++++++++++++++

  [ = ]       0        0  [ = ]



@grpc-testing
Copy link

[trickle] No significant performance differences

@grpc-testing
Copy link

[microbenchmarks] No significant performance differences

@yang-g
Copy link
Member

yang-g commented Feb 12, 2019

Seems obsolete, closing.

@yang-g yang-g closed this Feb 12, 2019
@ywh233
Copy link
Contributor

ywh233 commented Mar 6, 2019

I wonder why this is closed without merging. Is there still a plan to use system trust store on Mac?

@nicolasnoble
Copy link
Member

This is mainly a cleanup-close. Code that has been rotting since 8+ months probably needs revisiting.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants