Commit Graph

93 Commits

Author SHA1 Message Date
Matthew Stevenson d610a2bf6c
[tls] Backport of #34861 to v1.59.x. (#35801)
Co-authored-by: Luwei Ge <lwge@google.com>
2024-02-05 11:03:24 -08:00
Gregory Cooke f1d14f7f0b
[Security - Revocation] Crl backport to 1.59 (#34926)
Backport CRL provider and directory reloader PRs to 1.59

---------

Co-authored-by: gtcooke94 <gtcooke94@users.noreply.github.com>
Co-authored-by: Andrey Ermolov <aermolov@google.com>
Co-authored-by: erm-g <erm-g@users.noreply.github.com>
2023-11-15 11:30:05 -05:00
Gregory Cooke a4f345ff96
TlsCreds: Support revocation of intermediate in chain. (#32544)
This PR is a small code change with a lot of new test data.
[In OpenSSL, there are two flags that configure CRL checks. Coping
relevant
section:](https://www.openssl.org/docs/man1.0.2/man3/X509_VERIFY_PARAM_get_depth.html)

> - X509_V_FLAG_CRL_CHECK enables CRL checking for the certificate chain
leaf certificate. An error occurs if a suitable CRL cannot be found.
> - X509_V_FLAG_CRL_CHECK_ALL enables CRL checking for the entire
certificate chain.

We currently only set `X509_V_FLAG_CRL_CHECK`, so we will only ever
check if the leaf certificate is revoked. We should check the whole
chain. I am open to making this a user configuration if we want to do it
that way, but we certainly need to be able to check the whole chain.

So, this PR contains the small code change in
`ssl_transport_security.cc` to use the `X509_V_FLAG_CRL_CHECK_ALL` flag.
Then the rest of the changes are in tests. I've added all the necessary
files to have a chain built that looks as follows
`Root CA -> Revoked Intermediate CA -> Leaf Certificate`, and added a
test for this case as well.
You can verify that on master this new test will fail (i.e. the
handshake will succeed even though the intermediate CA is revoked) by
checking out this branch, running `git checkout master --
./src/core/tsi/ssl_transport_security.cc`, then running the test.

I also slightly reorganized test/core/tsi/test_creds/ so that the CRLs
are in their own directory, which is the way our API intends to accept
CRLs.
2023-03-23 11:34:59 -04:00
Yijie Ma ac7faf75ba
Fix a race on vptr for UnimplementedAsyncRequest (#32547)
It is reported in https://github.com/grpc/grpc/issues/32356 that there
is a race on vptr for `UnimplementedAsyncRequest` which would cause
crashes for multi-threaded server if clients send unimplemented RPC
request to the server.

The cause is that the server requests a call for
`UnimplementedAsyncRequest` in its base class `GenericAsyncRequest` when
the `vptr` still points to the base class's `vtable`. If the call went
in and another server thread picks up the tag before the `vptr` points
back to the derived class's `vtable`, it would call the wrong virtual
function and also this is a data race. This fix makes the request of the
call inside the derived class's constructor.

<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->
2023-03-10 13:00:56 -08:00
Craig Tiller 67f364e23e
[cleanup] Eliminate usage of GRPC_ASSERT(false...); (#31757)
* crash function

* progress

* fix

* fix

* Automated change: Fix sanity tests

* fix

* fix

* fix

* fixes

* Automated change: Fix sanity tests

* fix

* Automated change: Fix sanity tests

* fix

* fix

* use cpp attr

* Automated change: Fix sanity tests

* fix

* fix

* fix

* fix

* fix

* fix

* add exclusion

* fix

* typo

* fix

* fmt

* Update tcp_socket_utils.cc

* Automated change: Fix sanity tests

* fix

* revert php changes

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2023-01-11 08:50:32 -08:00
Yijie Ma f99b8b5bc4
Convert c-style comments to C++-style comments (#31923)
* baseline

* fix clang-tidy

* manually revert these files

* manually fixup at eof

* revert 2 more files

* change check_deprecated_grpc++.py

* change end2end_defs.include template

* fix check_include_guards.py

* untrack tools/distrib/python/convert_cstyle_comments_to_cpp.py

not yet ready to be submitted

* fix

yapf check_include_guards.py
remove a space...

* fix version.cc.template

* fix version_info.h.template
2022-12-22 23:01:53 -08:00
Cheng-Yu Chung ac365cadfb
Remove `include/grpc/impl/codegen/port_platform.h` (#31778) 2022-12-14 10:46:33 +08:00
Esun Kim 0ba0c4bf74
Added googletest clang-tidy checks (#31610)
* Added google-googletest

* Autofix

* Fix test names

* Fix
2022-11-18 13:02:20 -08:00
Esun Kim 660a6f281e
Added readability-redundant-string-init (#31609)
* Added readability-redundant-string-init

* Fix
2022-11-10 11:14:36 -08:00
Esun Kim 530b702259
Update Clang 15 (#31518)
* clang-15

* iwyu

* run clang_format_code

* Clang-Tidy config

* Fix misc-unused-using-decls

* Fixed performance-inefficient-vector-operation

* Sanity
2022-11-04 09:08:03 -07:00
Yash Tibrewal 5f6c357e74
Move some targets from //: to //src/core: (#31402)
* temp

* temp

* temp

* top BUILD builds

* everything builds

* buildify

* temp fix_build_deps change

* fix gpr_atm

* additional changes

* fix build files

* nofixdeps

* Generate projects

* json_args

* fix context

* Generate projects

* Sprinkle some avoid_dep tags

* Run fix_build_deps

* Remove additional avoid_dep

* Revert some targets

* grpc_mock_cel
2022-10-20 20:12:53 -07:00
Cheng-Yu Chung a192f155b9
Remove `include/grpcpp/impl/codegen/config.h` (#31061)
* Remove `include/grpcpp/impl/codegen/config.h`

* Update
2022-10-06 13:14:16 -04:00
Craig Tiller 9c98d67d7a
[c++14] absl::make_unique --> std::make_unique (#31159)
* [c++14] absl::make_unique --> std::make_unique

* fix

* fix
2022-09-29 06:45:17 -07:00
Craig Tiller b463cabeec
Update flaky tests (#30873)
* Update flaky tests list

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2022-09-07 10:16:34 -07:00
Craig Tiller f573fd44f9
[test] Semi-automatic flaky test tracking (#30638)
* [test] Semi-automatic flaky test tracking

* fix

* Automated change: Fix sanity tests

* Update update_flakes.py

* fix formatting

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2022-08-19 16:22:31 -07:00
Craig Tiller 05e6bf2e4a
[build] Add test/core/util, test/core/event_engine to auto build deps (#30364)
* [build] Add test/core/util, test/core/event_engine to auto build deps

* deal with suppressions

* fix suppressions

* Automated change: Fix sanity tests

* fix

* fix

* fix

* fix

* progress

* Automated change: Fix sanity tests

* fix

* fix

* fix

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2022-07-25 21:59:25 -07:00
Esun Kim c66c362191
Reland "Enable GRPC_ERROR_IS_ABSEIL_STATUS" (#30047)
* Revert "Revert "Enable GRPC_ERROR_IS_ABSEIL_STATUS (#29869)" (#30031)"

This reverts commit 2d0d1775a9.

* Fix the test
2022-06-23 12:38:19 -07:00
Esun Kim 2d0d1775a9
Revert "Enable GRPC_ERROR_IS_ABSEIL_STATUS (#29869)" (#30031)
This reverts commit c6058b5e6b.
2022-06-15 21:41:55 -07:00
Esun Kim c6058b5e6b
Enable GRPC_ERROR_IS_ABSEIL_STATUS (#29869)
* Enable GRPC_ERROR_IS_ABSEIL_STATUS

* Sanitize

* Fix ServerRequestCallTest
2022-06-15 15:06:15 -07:00
Craig Tiller 0f9d024fec
[iwyu] c++ (#29721)
* Revert "Revert "[iwyu] grpc++ (#29610)" (#29720)"

This reverts commit 0642bc213d.

* fixup status_code_enum import issue

* fix

* Automated change: Fix sanity tests

* import fixes

* fix import

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2022-05-19 07:34:48 -07:00
Craig Tiller 0642bc213d
Revert "[iwyu] grpc++ (#29610)" (#29720)
This reverts commit c8159eabdf.
2022-05-18 09:58:08 -07:00
Craig Tiller c8159eabdf
[iwyu] grpc++ (#29610)
* [iwyu] grpc++

* fix

* fix

* Automated change: Fix sanity tests

* fix

* fix

* fix

* [iwyu] Better script

* eliminate race

* fixes

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2022-05-18 07:16:53 -07:00
AJ Heller 18a8f6aad9
Refactor end2end tests to exercise each EventEngine (#29202)
* Refactor end2end tests to exercise each EventEngine

* fix incorrect bazel_only exclusions

* Automated change: Fix sanity tests

* microbenchmark fix

* sanitize, fix iOS flub

* Automated change: Fix sanity tests

* iOS fix

* reviewer feedback

* first pass at excluding EventEngine test expansion

Also caught a few cases where we should not test pollers, but should
test all engines. And two cases where we likely shouldn't be testing
either product.

* end2end fuzzers to be fuzzed differently via EventEngine.

* sanitize

* reviewer feedback

* remove misleading comment

* reviewer feedback: comments

* EE test_init needs to play with our build system

* fix golden file test runner

Co-authored-by: drfloob <drfloob@users.noreply.github.com>
2022-03-30 15:43:05 -07:00
AJ Heller 85189b24bb
Reintroduce: Avoid fully qualifying namespaces (and add check) (#28917)
Based on a handful of https://abseil.io/tips, it's generally advised to
only fully-qualify namespaces when in a `using` statement, or when it's
otherwise required for compilation. In all other cases, the general
recommendation is to not fully-qualify.

This change fixes most `grpc.*` namespace uses. There are potential
challenges in trying to make blanket changes to non-gRPC namespace uses,
such as `::testing`, since there is also a `grpc::testing` namespace.
2022-02-18 16:18:54 -08:00
AJ Heller e72a5fe5dd
Revert "Avoid fully qualifying namespaces (and add check) (#28901)" (#28916)
This reverts commit fc7314c701.
2022-02-17 17:56:19 -08:00
AJ Heller fc7314c701
Avoid fully qualifying namespaces (and add check) (#28901)
Based on a handful of https://abseil.io/tips, it's generally advised to
only fully-qualify namespaces when in a `using` statement, or when it's
otherwise required for compilation. In all other cases, the general
recommendation is to not fully-qualify.

This change fixes most `grpc.*` namespace uses. There are potential
challenges in trying to make blanket changes to non-gRPC namespace uses,
such as `::testing`, since there is also a `grpc::testing` namespace.
2022-02-17 16:23:25 -08:00
krestofur 1cdcd88fb1
Add experimental API for CRL checking support to gRPC C++ TlsCredentials (#28407) 2022-01-26 20:23:48 -08:00
ZhenLian 2e14f6fa70
Support Custom Post-handshake Verification in TlsCredentials (#25631)
* custom verification refactoring - post-handshake verification
2021-11-10 13:45:52 -08:00
Richard Belleville 468768865b
Make Buildifier Sanity Test Strict (#27807)
* Fix all lint errors in repo.

* Use strict buildifier by default

* Whoops. That file does not exist

* Attempt fix to buildifier invocation

* Add missing copyright
2021-11-03 14:57:04 -07:00
Mark D. Roth e251ee9ffb
disable authorization_policy_provider_test on iOS (#27927) 2021-11-03 11:55:32 -07:00
Ashitha Santhosh a1db97be90
Revert "Revert "Revert "Revert "File watcher authorization policy provider implementation"" (#27605)" (#27644)" (#27645)
This reverts commit b8e01f73a0.
2021-10-08 15:52:13 -07:00
AJ Heller b8e01f73a0
Revert "Revert "Revert "File watcher authorization policy provider implementation"" (#27605)" (#27644)
This reverts commit 5912aedb2b.
2021-10-07 16:45:30 -07:00
Ashitha Santhosh 5912aedb2b
Revert "Revert "File watcher authorization policy provider implementation"" (#27605)
* Revert "Revert "File watcher authorization policy provider implementation (#26779)" (#27591)"

This reverts commit a1ad74f7af.

* Remove license comment
2021-10-07 09:54:23 -07:00
Craig Tiller d1e01ac139
Add a test for a (now-illegal) build file construct (#27602)
* Add a test for a (now-illegal) build file construct

* add to test suite!

* fix

* fix

* fix syntax
2021-10-06 07:43:59 -07:00
Craig Tiller a1ad74f7af
Revert "File watcher authorization policy provider implementation (#26779)" (#27591)
This reverts commit 310accd077.
2021-10-05 09:12:08 -07:00
Ashitha Santhosh 310accd077
File watcher authorization policy provider implementation (#26779)
* File watcher authorization policy provider implementation
2021-10-04 14:22:45 -07:00
Austin Schuh d30404868f
ARM and -Wextra fixups (#19141)
* Make generated code compile with -Wunused-parameters

-Wunused-parameters is turned on by -Werror -Wextra.  gRPC code
generation creates header files with unused parameters.  So let's modify
the generator to not generate code which will make -Wunused-parameters
unhappy.

* Fix unsigned vs signed comparisons and 32 bit string formats

Fix unsigned vs signed comparison warnings.

For 64 bit numbers printed in gRPC, the string formats assume that you
are running on a 64 bit machine.  Use inttypes.h to make it portable.
Also, use size_t format strings for the same reason.

* Fix unaligned memory access

cost_entry_ptr has no alignment guarentees that ubsan can find.  So it
fails the test with an alignment problem.  Use memcopy to read the data
from the pointer to fix this.

* Fix undefined behavior with memcpy and memcmp

Passing in a 0 length piece of data and a null pointer is undefined
behavior.  If the length is 0, don't pass it in.  This fixes ubsan
failures.

* Clang-format

* Automated change: Fix sanity tests
2021-09-27 04:54:05 -07:00
Craig Tiller ea389c00c2
Adjust include order per style guide (#27175)
Introduce clang-format configuration to sort includes closer to our rules.
2021-09-08 12:14:44 -07:00
Craig Tiller 03bdfa4a74
Make socket mutators work for server connections (#26328)
* Make socket mutators work for server connections

* compile fix

* compile fix

* compile fix

* compile fix

* cleanup

* Revert "cleanup"

This reverts commit 480fcc600a.

* Revert "Revert "cleanup""

This reverts commit 29fbc349d2.
2021-06-23 14:40:35 -07:00
Ashitha Santhosh b9a643a817
Static policy provider implementation. (#26134) 2021-06-03 23:18:08 -07:00
Esun Kim f171a6689e Fix StatusCode 2020-12-04 13:10:46 -08:00
Esun Kim 53ab235fb8 Fix google-explicit-constructor 2020-12-03 15:03:39 -08:00
Esun Kim e0d8c498a6 C++ cast for others 2020-11-30 17:36:21 -08:00
Esun Kim 2ff84ed8c2 C++ cast for void* 2020-11-30 17:29:15 -08:00
ZhenLian d74e43da95 Add File Watcher Certificate Provider API 2020-11-19 13:36:13 -08:00
ZhenLian 518ed1303c Add Credential Loading From Static Providers For TLS Credentials 2020-10-22 13:55:31 -07:00
Esun Kim aae4f4cf18 Fix by misc-unused-using-decls 2020-10-19 18:12:11 -07:00
Esun Kim 6ae8463500 Fix by modernize-make-unique 2020-10-16 13:30:56 -07:00
Esun Kim c736cf073c Added call to grpc::testing::TestEnvironment in more tests 2020-07-01 13:27:08 -07:00
Esun Kim 165ee5007a Replaced grpc::string with std::string 2020-06-29 17:56:36 -07:00