Skip to content

Commit

Permalink
Sync c-core 1.66.0-pre3
Browse files Browse the repository at this point in the history
  • Loading branch information
HannahShiSFB committed Aug 9, 2024
1 parent d76af29 commit 842f08d
Show file tree
Hide file tree
Showing 21 changed files with 69 additions and 63 deletions.
2 changes: 1 addition & 1 deletion gRPC-C++.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
Pod::Spec.new do |s|
s.name = 'gRPC-C++'
# TODO (mxyan): use version that match gRPC version when pod is stabilized
version = '1.66.0-pre2'
version = '1.66.0-pre3'
s.version = version
s.summary = 'gRPC C++ library'
s.homepage = 'https://grpc.io'
Expand Down
2 changes: 1 addition & 1 deletion gRPC-Core.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

Pod::Spec.new do |s|
s.name = 'gRPC-Core'
version = '1.66.0-pre2'
version = '1.66.0-pre3'
s.version = version
s.summary = 'Core cross-platform gRPC library, written in C'
s.homepage = 'https://grpc.io'
Expand Down
2 changes: 1 addition & 1 deletion gRPC-ProtoRPC.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

Pod::Spec.new do |s|
s.name = 'gRPC-ProtoRPC'
version = '1.66.0-pre2'
version = '1.66.0-pre3'
s.version = version
s.summary = 'RPC library for Protocol Buffers, based on gRPC'
s.homepage = 'https://grpc.io'
Expand Down
2 changes: 1 addition & 1 deletion gRPC-RxLibrary.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

Pod::Spec.new do |s|
s.name = 'gRPC-RxLibrary'
version = '1.66.0-pre2'
version = '1.66.0-pre3'
s.version = version
s.summary = 'Reactive Extensions library for iOS/OSX.'
s.homepage = 'https://grpc.io'
Expand Down
2 changes: 1 addition & 1 deletion gRPC.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

Pod::Spec.new do |s|
s.name = 'gRPC'
version = '1.66.0-pre2'
version = '1.66.0-pre3'
s.version = version
s.summary = 'gRPC client library for iOS/OSX'
s.homepage = 'https://grpc.io'
Expand Down
4 changes: 2 additions & 2 deletions include/grpcpp/version_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#define GRPC_CPP_VERSION_MAJOR 1
#define GRPC_CPP_VERSION_MINOR 66
#define GRPC_CPP_VERSION_PATCH 0
#define GRPC_CPP_VERSION_TAG "pre2"
#define GRPC_CPP_VERSION_STRING "1.66.0-pre2"
#define GRPC_CPP_VERSION_TAG "pre3"
#define GRPC_CPP_VERSION_STRING "1.66.0-pre3"

#endif // GRPCPP_VERSION_INFO_H
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace internal {
char* read_bios_file(const char* bios_file) {
FILE* fp = fopen(bios_file, "r");
if (!fp) {
LOG(INFO) << "BIOS data file does not exist or cannot be opened.";
VLOG(2) << "BIOS data file does not exist or cannot be opened.";
return nullptr;
}
char buf[kBiosDataBufferSize + 1];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "src/core/lib/security/credentials/alts/check_gcp_environment.h"

bool grpc_alts_is_running_on_gcp() {
LOG(INFO) << "ALTS: Platforms other than Linux and Windows are not supported";
VLOG(2) << "ALTS: Platforms other than Linux and Windows are not supported";
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/lib/security/credentials/jwt/json_token.cc
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ static char* encoded_jwt_claim(const grpc_auth_json_key* json_key,
gpr_timespec now = gpr_now(GPR_CLOCK_REALTIME);
gpr_timespec expiration = gpr_time_add(now, token_lifetime);
if (gpr_time_cmp(token_lifetime, grpc_max_auth_token_lifetime()) > 0) {
LOG(INFO) << "Cropping token lifetime to maximum allowed value.";
VLOG(2) << "Cropping token lifetime to maximum allowed value.";
expiration = gpr_time_add(now, grpc_max_auth_token_lifetime());
}

Expand Down
17 changes: 8 additions & 9 deletions src/core/lib/security/credentials/jwt/jwt_credentials.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ grpc_service_account_jwt_access_credentials::
: key_(key) {
gpr_timespec max_token_lifetime = grpc_max_auth_token_lifetime();
if (gpr_time_cmp(token_lifetime, max_token_lifetime) > 0) {
LOG(INFO) << "Cropping token lifetime to maximum allowed value ("
<< max_token_lifetime.tv_sec << " secs).";
VLOG(2) << "Cropping token lifetime to maximum allowed value ("
<< max_token_lifetime.tv_sec << " secs).";
token_lifetime = grpc_max_auth_token_lifetime();
}
jwt_lifetime_ = token_lifetime;
Expand Down Expand Up @@ -155,13 +155,12 @@ grpc_call_credentials* grpc_service_account_jwt_access_credentials_create(
const char* json_key, gpr_timespec token_lifetime, void* reserved) {
if (GRPC_TRACE_FLAG_ENABLED(api)) {
char* clean_json = redact_private_key(json_key);
LOG(INFO) << "grpc_service_account_jwt_access_credentials_create("
<< "json_key=" << clean_json
<< ", token_lifetime=gpr_timespec { tv_sec: "
<< token_lifetime.tv_sec
<< ", tv_nsec: " << token_lifetime.tv_nsec
<< ", clock_type: " << token_lifetime.clock_type
<< " }, reserved=" << reserved << ")";
VLOG(2) << "grpc_service_account_jwt_access_credentials_create("
<< "json_key=" << clean_json
<< ", token_lifetime=gpr_timespec { tv_sec: "
<< token_lifetime.tv_sec << ", tv_nsec: " << token_lifetime.tv_nsec
<< ", clock_type: " << token_lifetime.clock_type
<< " }, reserved=" << reserved << ")";
gpr_free(clean_json);
}
CHECK_EQ(reserved, nullptr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ FileWatcherCertificateProvider::FileWatcherCertificateProvider(
refresh_interval_sec_(refresh_interval_sec),
distributor_(MakeRefCounted<grpc_tls_certificate_distributor>()) {
if (refresh_interval_sec_ < kMinimumFileWatcherRefreshIntervalSeconds) {
LOG(INFO) << "FileWatcherCertificateProvider refresh_interval_sec_ set to "
"value less than minimum. Overriding configured value to "
"minimum.";
VLOG(2) << "FileWatcherCertificateProvider refresh_interval_sec_ set to "
"value less than minimum. Overriding configured value to "
"minimum.";
refresh_interval_sec_ = kMinimumFileWatcherRefreshIntervalSeconds;
}
// Private key and identity cert files must be both set or both unset.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,9 @@ void grpc_tls_credentials_options_set_tls_session_key_log_file_path(
// Tls session key logging is assumed to be enabled if the specified log
// file is non-empty.
if (path != nullptr) {
LOG(INFO) << "Enabling TLS session key logging with keys stored at: "
<< path;
VLOG(2) << "Enabling TLS session key logging with keys stored at: " << path;
} else {
LOG(INFO) << "Disabling TLS session key logging";
VLOG(2) << "Disabling TLS session key logging";
}
options->set_tls_session_key_log_file_path(path != nullptr ? path : "");
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/lib/security/credentials/tls/tls_credentials.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ bool CredentialOptionSanityCheck(grpc_tls_credentials_options* options,
// If no verifier is specified on the client side, use the hostname verifier
// as default. Users who want to bypass all the verifier check should
// implement an external verifier instead.
LOG(INFO) << "No verifier specified on the client side. Using default "
"hostname verifier";
VLOG(2) << "No verifier specified on the client side. Using default "
"hostname verifier";
options->set_certificate_verifier(
grpc_core::MakeRefCounted<grpc_core::HostNameCertificateVerifier>());
}
Expand Down
15 changes: 9 additions & 6 deletions src/core/lib/security/security_connector/ssl_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -232,16 +232,18 @@ static bool IsSpiffeId(absl::string_view uri) {
return false;
};
if (uri.size() > 2048) {
LOG(INFO) << "Invalid SPIFFE ID: ID longer than 2048 bytes.";
GRPC_TRACE_LOG(tsi, INFO)
<< "Invalid SPIFFE ID: ID longer than 2048 bytes.";
return false;
}
std::vector<absl::string_view> splits = absl::StrSplit(uri, '/');
if (splits.size() < 4 || splits[3].empty()) {
LOG(INFO) << "Invalid SPIFFE ID: workload id is empty.";
GRPC_TRACE_LOG(tsi, INFO) << "Invalid SPIFFE ID: workload id is empty.";
return false;
}
if (splits[2].size() > 255) {
LOG(INFO) << "Invalid SPIFFE ID: domain longer than 255 characters.";
GRPC_TRACE_LOG(tsi, INFO)
<< "Invalid SPIFFE ID: domain longer than 255 characters.";
return false;
}
return true;
Expand Down Expand Up @@ -332,7 +334,7 @@ grpc_core::RefCountedPtr<grpc_auth_context> grpc_ssl_peer_to_auth_context(
GRPC_PEER_SPIFFE_ID_PROPERTY_NAME,
spiffe_data, spiffe_length);
} else {
LOG(INFO) << "Invalid SPIFFE ID: multiple URI SANs.";
GRPC_TRACE_LOG(tsi, INFO) << "Invalid SPIFFE ID: multiple URI SANs.";
}
}
return ctx;
Expand Down Expand Up @@ -419,8 +421,9 @@ grpc_security_status grpc_ssl_tsi_client_handshaker_factory_init(
const char* root_certs;
const tsi_ssl_root_certs_store* root_store;
if (pem_root_certs == nullptr && !skip_server_certificate_verification) {
LOG(INFO) << "No root certificates specified; use ones stored in system "
"default locations instead";
GRPC_TRACE_LOG(tsi, INFO)
<< "No root certificates specified; use ones stored in system "
"default locations instead";
// Use default root certificates.
root_certs = grpc_core::DefaultSslRootStore::GetPemRootCerts();
if (root_certs == nullptr) {
Expand Down
12 changes: 6 additions & 6 deletions src/core/tsi/alts/handshaker/alts_handshaker_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,14 @@ void alts_handshaker_client_handle_response(alts_handshaker_client* c,
}
// TSI handshake has been shutdown.
if (alts_tsi_handshaker_has_shutdown(handshaker)) {
LOG(INFO) << "TSI handshake shutdown";
VLOG(2) << "TSI handshake shutdown";
handle_response_done(client, TSI_HANDSHAKE_SHUTDOWN,
"TSI handshake shutdown", nullptr, 0, nullptr);
return;
}
// Check for failed grpc read.
if (!is_ok || client->inject_read_failure) {
LOG(INFO) << "read failed on grpc call to handshaker service";
VLOG(2) << "read failed on grpc call to handshaker service";
handle_response_done(client, TSI_INTERNAL_ERROR,
"read failed on grpc call to handshaker service",
nullptr, 0, nullptr);
Expand Down Expand Up @@ -470,10 +470,10 @@ static void on_status_received(void* arg, grpc_error_handle error) {
// status from the final ALTS message with the status here.
char* status_details =
grpc_slice_to_c_string(client->handshake_status_details);
LOG(INFO) << "alts_grpc_handshaker_client:" << client
<< " on_status_received status:" << client->handshake_status_code
<< " details:|" << status_details << "| error:|"
<< grpc_core::StatusToString(error) << "|";
VLOG(2) << "alts_grpc_handshaker_client:" << client
<< " on_status_received status:" << client->handshake_status_code
<< " details:|" << status_details << "| error:|"
<< grpc_core::StatusToString(error) << "|";
gpr_free(status_details);
}
maybe_complete_tsi_next(client, true /* receive_status_finished */,
Expand Down
6 changes: 3 additions & 3 deletions src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ static void on_handshaker_service_resp_recv(void* arg,
}
bool success = true;
if (!error.ok()) {
LOG(INFO) << "ALTS handshaker on_handshaker_service_resp_recv error: "
<< grpc_core::StatusToString(error);
VLOG(2) << "ALTS handshaker on_handshaker_service_resp_recv error: "
<< grpc_core::StatusToString(error);
success = false;
}
alts_handshaker_client_handle_response(client, success);
Expand Down Expand Up @@ -445,7 +445,7 @@ static tsi_result alts_tsi_handshaker_continue_handshaker_next(
CHECK_EQ(handshaker->client, nullptr);
handshaker->client = client;
if (handshaker->shutdown) {
LOG(INFO) << "TSI handshake shutdown";
VLOG(2) << "TSI handshake shutdown";
if (error != nullptr) *error = "TSI handshaker shutdown";
return TSI_HANDSHAKE_SHUTDOWN;
}
Expand Down
36 changes: 20 additions & 16 deletions src/core/tsi/ssl_transport_security.cc
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ static void init_openssl(void) {
CRYPTO_set_locking_callback(openssl_locking_cb);
CRYPTO_set_id_callback(openssl_thread_id_cb);
} else {
LOG(INFO) << "OpenSSL callback has already been set.";
GRPC_TRACE_LOG(tsi, INFO) << "OpenSSL callback has already been set.";
}
#endif
g_ssl_ctx_ex_factory_index =
Expand Down Expand Up @@ -337,7 +337,7 @@ static tsi_result peer_property_from_x509_subject(X509* cert,
bool is_verified_root_cert) {
X509_NAME* subject_name = X509_get_subject_name(cert);
if (subject_name == nullptr) {
LOG(INFO) << "Could not get subject name from certificate.";
GRPC_TRACE_LOG(tsi, INFO) << "Could not get subject name from certificate.";
return TSI_NOT_FOUND;
}
BIO* bio = BIO_new(BIO_s_mem());
Expand Down Expand Up @@ -893,8 +893,9 @@ static tsi_result build_alpn_protocol_name_list(
static int verify_cb(int ok, X509_STORE_CTX* ctx) {
int cert_error = X509_STORE_CTX_get_error(ctx);
if (cert_error == X509_V_ERR_UNABLE_TO_GET_CRL) {
LOG(INFO) << "Certificate verification failed to find relevant CRL file. "
"Ignoring error.";
GRPC_TRACE_LOG(tsi, INFO)
<< "Certificate verification failed to find relevant CRL file. "
"Ignoring error.";
return 1;
}
if (cert_error != 0) {
Expand Down Expand Up @@ -961,7 +962,8 @@ static int RootCertExtractCallback(X509_STORE_CTX* ctx, void* /*arg*/) {
int success =
SSL_set_ex_data(ssl, g_ssl_ex_verified_root_cert_index, root_cert);
if (success == 0) {
LOG(INFO) << "Could not set verified root cert in SSL's ex_data";
GRPC_TRACE_LOG(tsi, INFO)
<< "Could not set verified root cert in SSL's ex_data";
} else {
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
X509_up_ref(root_cert);
Expand All @@ -979,15 +981,16 @@ static grpc_core::experimental::CrlProvider* GetCrlProvider(
if (ssl_index < 0) {
char err_str[256];
ERR_error_string_n(ERR_get_error(), err_str, sizeof(err_str));
LOG(INFO)
GRPC_TRACE_LOG(tsi, INFO)
<< "error getting the SSL index from the X509_STORE_CTX while looking "
"up Crl: "
<< err_str;
return nullptr;
}
SSL* ssl = static_cast<SSL*>(X509_STORE_CTX_get_ex_data(ctx, ssl_index));
if (ssl == nullptr) {
LOG(INFO) << "error while fetching from CrlProvider. SSL object is null";
GRPC_TRACE_LOG(tsi, INFO)
<< "error while fetching from CrlProvider. SSL object is null";
return nullptr;
}
SSL_CTX* ssl_ctx = SSL_get_SSL_CTX(ssl);
Expand All @@ -1005,13 +1008,14 @@ static absl::StatusOr<X509_CRL*> GetCrlFromProvider(
}
absl::StatusOr<std::string> issuer_name = grpc_core::IssuerFromCert(cert);
if (!issuer_name.ok()) {
LOG(INFO) << "Could not get certificate issuer name";
GRPC_TRACE_LOG(tsi, INFO) << "Could not get certificate issuer name";
return absl::InvalidArgumentError(issuer_name.status().message());
}
absl::StatusOr<std::string> akid = grpc_core::AkidFromCertificate(cert);
std::string akid_to_use;
if (!akid.ok()) {
LOG(INFO) << "Could not get certificate authority key identifier.";
GRPC_TRACE_LOG(tsi, INFO)
<< "Could not get certificate authority key identifier.";
} else {
akid_to_use = *akid;
}
Expand Down Expand Up @@ -1174,8 +1178,8 @@ static tsi_result tsi_set_min_and_max_tls_versions(
SSL_CTX* ssl_context, tsi_tls_version min_tls_version,
tsi_tls_version max_tls_version) {
if (ssl_context == nullptr) {
LOG(INFO) << "Invalid nullptr argument to "
"|tsi_set_min_and_max_tls_versions|.";
GRPC_TRACE_LOG(tsi, INFO) << "Invalid nullptr argument to "
"|tsi_set_min_and_max_tls_versions|.";
return TSI_INVALID_ARGUMENT;
}
#if OPENSSL_VERSION_NUMBER >= 0x10100000
Expand All @@ -1196,7 +1200,7 @@ static tsi_result tsi_set_min_and_max_tls_versions(
break;
#endif
default:
LOG(INFO) << "TLS version is not supported.";
GRPC_TRACE_LOG(tsi, INFO) << "TLS version is not supported.";
return TSI_FAILED_PRECONDITION;
}

Expand All @@ -1215,7 +1219,7 @@ static tsi_result tsi_set_min_and_max_tls_versions(
#endif
break;
default:
LOG(INFO) << "TLS version is not supported.";
GRPC_TRACE_LOG(tsi, INFO) << "TLS version is not supported.";
return TSI_FAILED_PRECONDITION;
}
#endif
Expand Down Expand Up @@ -1836,9 +1840,9 @@ static tsi_result ssl_handshaker_next(tsi_handshaker* self,
reinterpret_cast<tsi_ssl_handshaker_result*>(*handshaker_result);
auto cipher = SSL_get_current_cipher(result->ssl);
if (cipher != nullptr) {
LOG(INFO) << absl::StrFormat("SSL Cipher Version: %s Name: %s",
SSL_CIPHER_get_version(cipher),
SSL_CIPHER_get_name(cipher));
GRPC_TRACE_LOG(tsi, INFO) << absl::StrFormat(
"SSL Cipher Version: %s Name: %s", SSL_CIPHER_get_version(cipher),
SSL_CIPHER_get_name(cipher));
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/core/xds/xds_client/xds_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1568,8 +1568,9 @@ XdsClient::XdsClient(
}
CHECK(bootstrap_ != nullptr);
if (bootstrap_->node() != nullptr) {
LOG(INFO) << "[xds_client " << this
<< "] xDS node ID: " << bootstrap_->node()->id();
GRPC_TRACE_LOG(xds_client, INFO)
<< "[xds_client " << this
<< "] xDS node ID: " << bootstrap_->node()->id();
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Pod::Spec.new do |s|
# exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed
# before them.
s.name = '!ProtoCompiler-gRPCCppPlugin'
v = '1.66.0-pre2'
v = '1.66.0-pre3'
s.version = v
s.summary = 'The gRPC ProtoC plugin generates C++ files from .proto services.'
s.description = <<-DESC
Expand Down
2 changes: 1 addition & 1 deletion src/objective-c/!ProtoCompiler-gRPCPlugin.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Pod::Spec.new do |s|
# exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed
# before them.
s.name = '!ProtoCompiler-gRPCPlugin'
v = '1.66.0-pre2'
v = '1.66.0-pre3'
s.version = v
s.summary = 'The gRPC ProtoC plugin generates Objective-C files from .proto services.'
s.description = <<-DESC
Expand Down
2 changes: 1 addition & 1 deletion src/objective-c/GRPCClient/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
// instead. This file can be regenerated from the template by running
// `tools/buildgen/generate_projects.sh`.

#define GRPC_OBJC_VERSION_STRING @"1.66.0-pre2"
#define GRPC_OBJC_VERSION_STRING @"1.66.0-pre3"

0 comments on commit 842f08d

Please sign in to comment.