aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorilnaz <ilnaz@ydb.tech>2022-07-12 13:05:20 +0300
committerilnaz <ilnaz@ydb.tech>2022-07-12 13:05:20 +0300
commit8024ad9845857b76925a9179c32ab7b955e87f17 (patch)
tree0123a4ed5de9d7dfd8856dca4c647ca9368b3260 /contrib
parenteeebfbedb3ea4cab5c0aac178b683b7dd26b0bf6 (diff)
downloadydb-8024ad9845857b76925a9179c32ab7b955e87f17.tar.gz
Change queue metrics
Diffstat (limited to 'contrib')
-rw-r--r--contrib/restricted/aws/aws-c-io/include/aws/io/io.h1
-rw-r--r--contrib/restricted/aws/aws-c-io/include/aws/io/tls_channel_handler.h18
-rw-r--r--contrib/restricted/aws/aws-c-io/source/io.c5
-rw-r--r--contrib/restricted/aws/aws-c-io/source/s2n/s2n_tls_channel_handler.c48
4 files changed, 41 insertions, 31 deletions
diff --git a/contrib/restricted/aws/aws-c-io/include/aws/io/io.h b/contrib/restricted/aws/aws-c-io/include/aws/io/io.h
index 9dc5039389..9c6e4614ed 100644
--- a/contrib/restricted/aws/aws-c-io/include/aws/io/io.h
+++ b/contrib/restricted/aws/aws-c-io/include/aws/io/io.h
@@ -241,6 +241,7 @@ enum aws_io_errors {
AWS_ERROR_IO_PINNED_EVENT_LOOP_MISMATCH,
AWS_ERROR_PKCS11_ENCODING_ERROR,
+ AWS_IO_TLS_ERROR_DEFAULT_TRUST_STORE_NOT_FOUND,
AWS_IO_ERROR_END_RANGE = AWS_ERROR_ENUM_END_RANGE(AWS_C_IO_PACKAGE_ID),
AWS_IO_INVALID_FILE_HANDLE = AWS_ERROR_INVALID_FILE_HANDLE,
diff --git a/contrib/restricted/aws/aws-c-io/include/aws/io/tls_channel_handler.h b/contrib/restricted/aws/aws-c-io/include/aws/io/tls_channel_handler.h
index 9e1c9d436c..1c19c59b58 100644
--- a/contrib/restricted/aws/aws-c-io/include/aws/io/tls_channel_handler.h
+++ b/contrib/restricted/aws/aws-c-io/include/aws/io/tls_channel_handler.h
@@ -24,11 +24,19 @@ enum aws_tls_versions {
enum aws_tls_cipher_pref {
AWS_IO_TLS_CIPHER_PREF_SYSTEM_DEFAULT = 0,
- AWS_IO_TLS_CIPHER_PREF_KMS_PQ_TLSv1_0_2019_06 = 1,
- AWS_IO_TLS_CIPHER_PREF_KMS_PQ_SIKE_TLSv1_0_2019_11 = 2,
- AWS_IO_TLS_CIPHER_PREF_KMS_PQ_TLSv1_0_2020_02 = 3,
- AWS_IO_TLS_CIPHER_PREF_KMS_PQ_SIKE_TLSv1_0_2020_02 = 4,
- AWS_IO_TLS_CIPHER_PREF_KMS_PQ_TLSv1_0_2020_07 = 5,
+
+ /* Deprecated */ AWS_IO_TLS_CIPHER_PREF_KMS_PQ_TLSv1_0_2019_06 = 1,
+ /* Deprecated */ AWS_IO_TLS_CIPHER_PREF_KMS_PQ_SIKE_TLSv1_0_2019_11 = 2,
+ /* Deprecated */ AWS_IO_TLS_CIPHER_PREF_KMS_PQ_TLSv1_0_2020_02 = 3,
+ /* Deprecated */ AWS_IO_TLS_CIPHER_PREF_KMS_PQ_SIKE_TLSv1_0_2020_02 = 4,
+ /* Deprecated */ AWS_IO_TLS_CIPHER_PREF_KMS_PQ_TLSv1_0_2020_07 = 5,
+
+ /*
+ * This TLS cipher preference list contains post-quantum key exchange algorithms that have been submitted to NIST
+ * for potential future standardization. Support for this preference list, or PQ algorithms present in it, may be
+ * removed at any time in the future. PQ algorithms in this preference list will be used in hybrid mode, and always
+ * combined with a classical ECDHE key exchange.
+ */
AWS_IO_TLS_CIPHER_PREF_PQ_TLSv1_0_2021_05 = 6,
AWS_IO_TLS_CIPHER_PREF_END_RANGE = 0xFFFF
diff --git a/contrib/restricted/aws/aws-c-io/source/io.c b/contrib/restricted/aws/aws-c-io/source/io.c
index 55b9d0eb13..82145c996f 100644
--- a/contrib/restricted/aws/aws-c-io/source/io.c
+++ b/contrib/restricted/aws/aws-c-io/source/io.c
@@ -282,6 +282,11 @@ static struct aws_error_info s_errors[] = {
AWS_DEFINE_ERROR_INFO_IO(
AWS_ERROR_PKCS11_ENCODING_ERROR,
"A PKCS#11 (Cryptoki) library function was unable to ASN.1 (DER) encode a data structure. See log for more details."),
+ AWS_DEFINE_ERROR_INFO_IO(
+ AWS_IO_TLS_ERROR_DEFAULT_TRUST_STORE_NOT_FOUND,
+ "Default TLS trust store not found on this system."
+ " Trusted CA certificates must be installed,"
+ " or \"override default trust store\" must be used while creating the TLS context."),
};
/* clang-format on */
diff --git a/contrib/restricted/aws/aws-c-io/source/s2n/s2n_tls_channel_handler.c b/contrib/restricted/aws/aws-c-io/source/s2n/s2n_tls_channel_handler.c
index e0e776361a..5c3561154d 100644
--- a/contrib/restricted/aws/aws-c-io/source/s2n/s2n_tls_channel_handler.c
+++ b/contrib/restricted/aws/aws-c-io/source/s2n/s2n_tls_channel_handler.c
@@ -189,11 +189,19 @@ void aws_tls_init_static_state(struct aws_allocator *alloc) {
s_default_ca_dir = s_determine_default_pki_dir();
s_default_ca_file = s_determine_default_pki_ca_file();
- AWS_LOGF_DEBUG(
- AWS_LS_IO_TLS,
- "ctx: Based on OS, we detected the default PKI path as %s, and ca file as %s",
- s_default_ca_dir,
- s_default_ca_file);
+ if (s_default_ca_dir || s_default_ca_file) {
+ AWS_LOGF_DEBUG(
+ AWS_LS_IO_TLS,
+ "ctx: Based on OS, we detected the default PKI path as %s, and ca file as %s",
+ s_default_ca_dir,
+ s_default_ca_file);
+ } else {
+ AWS_LOGF_WARN(
+ AWS_LS_IO_TLS,
+ "Default TLS trust store not found on this system."
+ " TLS connections will fail unless trusted CA certificates are installed,"
+ " or \"override default trust store\" is used while creating the TLS context.");
+ }
}
void aws_tls_clean_up_static_state(void) {
@@ -210,11 +218,6 @@ bool aws_tls_is_cipher_pref_supported(enum aws_tls_cipher_pref cipher_pref) {
return true;
/* PQ Crypto no-ops on android for now */
#ifndef ANDROID
- case AWS_IO_TLS_CIPHER_PREF_KMS_PQ_TLSv1_0_2019_06:
- case AWS_IO_TLS_CIPHER_PREF_KMS_PQ_SIKE_TLSv1_0_2019_11:
- case AWS_IO_TLS_CIPHER_PREF_KMS_PQ_TLSv1_0_2020_02:
- case AWS_IO_TLS_CIPHER_PREF_KMS_PQ_SIKE_TLSv1_0_2020_02:
- case AWS_IO_TLS_CIPHER_PREF_KMS_PQ_TLSv1_0_2020_07:
case AWS_IO_TLS_CIPHER_PREF_PQ_TLSv1_0_2021_05:
return true;
#endif
@@ -1369,21 +1372,6 @@ static struct aws_tls_ctx *s_tls_ctx_new(
case AWS_IO_TLS_CIPHER_PREF_SYSTEM_DEFAULT:
/* No-Op, if the user configured a minimum_tls_version then a version-specific Cipher Preference was set */
break;
- case AWS_IO_TLS_CIPHER_PREF_KMS_PQ_TLSv1_0_2019_06:
- s2n_config_set_cipher_preferences(s2n_ctx->s2n_config, "KMS-PQ-TLS-1-0-2019-06");
- break;
- case AWS_IO_TLS_CIPHER_PREF_KMS_PQ_SIKE_TLSv1_0_2019_11:
- s2n_config_set_cipher_preferences(s2n_ctx->s2n_config, "PQ-SIKE-TEST-TLS-1-0-2019-11");
- break;
- case AWS_IO_TLS_CIPHER_PREF_KMS_PQ_TLSv1_0_2020_02:
- s2n_config_set_cipher_preferences(s2n_ctx->s2n_config, "KMS-PQ-TLS-1-0-2020-02");
- break;
- case AWS_IO_TLS_CIPHER_PREF_KMS_PQ_SIKE_TLSv1_0_2020_02:
- s2n_config_set_cipher_preferences(s2n_ctx->s2n_config, "PQ-SIKE-TEST-TLS-1-0-2020-02");
- break;
- case AWS_IO_TLS_CIPHER_PREF_KMS_PQ_TLSv1_0_2020_07:
- s2n_config_set_cipher_preferences(s2n_ctx->s2n_config, "KMS-PQ-TLS-1-0-2020-07");
- break;
case AWS_IO_TLS_CIPHER_PREF_PQ_TLSv1_0_2021_05:
s2n_config_set_cipher_preferences(s2n_ctx->s2n_config, "PQ-TLS-1-0-2021-05-26");
break;
@@ -1507,7 +1495,7 @@ static struct aws_tls_ctx *s_tls_ctx_new(
goto cleanup_s2n_config;
}
}
- } else {
+ } else if (s_default_ca_file || s_default_ca_dir) {
/* User wants to use the system's default trust store.
*
* Note that s2n's trust store always starts with libcrypto's default locations.
@@ -1522,6 +1510,14 @@ static struct aws_tls_ctx *s_tls_ctx_new(
AWS_LS_IO_TLS, "Failed to set ca_path: %s and ca_file %s\n", s_default_ca_dir, s_default_ca_file);
goto cleanup_s2n_config;
}
+ } else {
+ /* Cannot find system's trust store */
+ aws_raise_error(AWS_IO_TLS_ERROR_DEFAULT_TRUST_STORE_NOT_FOUND);
+ AWS_LOGF_ERROR(
+ AWS_LS_IO_TLS,
+ "Default TLS trust store not found on this system."
+ " Install CA certificates, or \"override default trust store\".");
+ goto cleanup_s2n_config;
}
if (mode == S2N_SERVER && s2n_config_set_client_auth_type(s2n_ctx->s2n_config, S2N_CERT_AUTH_REQUIRED)) {