From 48bdf71bea42dac42bed5360f1a5b2b9d22fd8eb Mon Sep 17 00:00:00 2001 From: Lindsay Stewart Date: Tue, 30 Jul 2024 23:37:22 -0700 Subject: [PATCH 01/10] docs: add pq to usage guide --- bin/s2nc.c | 1 + bin/s2nd.c | 1 + bindings/rust/s2n-tls/src/security.rs | 5 + docs/usage-guide/topics/SUMMARY.md | 1 + docs/usage-guide/topics/ch15-post-quantum.md | 107 +++++++++++++++++++ tests/unit/s2n_security_policies_test.c | 22 ++++ tls/s2n_security_policies.c | 15 +++ 7 files changed, 152 insertions(+) create mode 100644 docs/usage-guide/topics/ch15-post-quantum.md diff --git a/bin/s2nc.c b/bin/s2nc.c index 5781948e2e3..4aaa762c297 100644 --- a/bin/s2nc.c +++ b/bin/s2nc.c @@ -591,6 +591,7 @@ int main(int argc, char *const *argv) } GUARD_EXIT(s2n_init(), "Error running s2n_init()"); + printf("libcrypto: %s\n", SSLeay_version(SSLEAY_VERSION)); if ((r = getaddrinfo(host, port, &hints, &ai_list)) != 0) { fprintf(stderr, "error: %s\n", gai_strerror(r)); diff --git a/bin/s2nd.c b/bin/s2nd.c index 77733899e7a..24913ae40b5 100644 --- a/bin/s2nd.c +++ b/bin/s2nd.c @@ -565,6 +565,7 @@ int main(int argc, char *const *argv) } GUARD_EXIT(s2n_init(), "Error running s2n_init()"); + printf("libcrypto: %s\n", SSLeay_version(SSLEAY_VERSION)); printf("Listening on %s:%s\n", host, port); diff --git a/bindings/rust/s2n-tls/src/security.rs b/bindings/rust/s2n-tls/src/security.rs index e3684a67336..8b23307c1cd 100644 --- a/bindings/rust/s2n-tls/src/security.rs +++ b/bindings/rust/s2n-tls/src/security.rs @@ -87,9 +87,14 @@ pub const DEFAULT_TLS13: Policy = policy!("default_tls13"); #[cfg(feature = "pq")] pub const TESTING_PQ: Policy = policy!("PQ-TLS-1-0-2021-05-26"); +#[cfg(feature = "pq")] +pub const DEFAULT_PQ: Policy = policy!("default_pq"); + pub const ALL_POLICIES: &[Policy] = &[ DEFAULT, DEFAULT_TLS13, #[cfg(feature = "pq")] TESTING_PQ, + #[cfg(feature = "pq")] + DEFAULT_PQ, ]; diff --git a/docs/usage-guide/topics/SUMMARY.md b/docs/usage-guide/topics/SUMMARY.md index b365246a4ca..308864e4cec 100644 --- a/docs/usage-guide/topics/SUMMARY.md +++ b/docs/usage-guide/topics/SUMMARY.md @@ -15,3 +15,4 @@ - [Offloading Private Key Operations](./ch12-private-key-ops.md) - [Pre-shared Keys](./ch13-preshared-keys.md) - [Early Data](./ch14-early-data.md) +- [Post Quantum Support](./ch15-post-quantum.md) diff --git a/docs/usage-guide/topics/ch15-post-quantum.md b/docs/usage-guide/topics/ch15-post-quantum.md new file mode 100644 index 00000000000..ef6394db494 --- /dev/null +++ b/docs/usage-guide/topics/ch15-post-quantum.md @@ -0,0 +1,107 @@ +# Post Quantum (PQ) Support + +s2n-tls supports post-quantum key exchange for TLS1.3. Currently, only [Kyber](https://pq-crystals.org/kyber/) is supported. + +Specifically, s2n-tls supports hybrid key exchange. s2n-tls uses both classic and post-quantum key exchange algorithms at the same time, combining the two secrets. If one of the algorithms is compromised, either because advances in quantum computing make the classic algorithm insecure or because cryptographers find a flaw in the relatively new post-quantum algorithm, the secret is still secure. Hybrid post-quantum key exchange is more secure than standard key exchange, but slower and more expensive. + +Careful: if an s2n-tls server is configured to support post-quantum key exchange, the server will require that any client that advertises support ultimately uses post-quantum key exchange. That will result in a retry and an extra round trip if the client does not intially provide a post-quantum key share. + +## Requirements + +### AWS-LC + +s2n-tls must be built with aws-lc to use post-quantum key exchange. See the [s2n-tls build documentation](https://github.com/aws/s2n-tls/blob/main/docs/BUILD.md#building-with-a-specific-libcrypto) for how to build with aws-lc. + +If you're unsure what cryptography library s2n-tls is built against, trying running s2nd or s2nc: +``` +> s2nd localhost 8000 +libcrypto: AWS-LC +Listening on localhost:8000 +``` +If you built s2n-tls with the [cmake build instructions](https://github.com/aws/s2n-tls/blob/main/docs/BUILD.md#building-s2n-tls), s2nd and s2nc can be found in `build/bin`. + +### Security Policy + +Post-quantum key exchange is enabled by configuring a security policy (see [Security Policies](./ch06-security-policies.md)) that supports post-quantum key exchange algorithms. + +"default_pq" is the equivalent of "default_tls13", but with PQ support. Like the other default policies, "default_pq" may change as a result of library updates. The fixed, numbered equivalent of "default_pq" is currently "20240730". For previous defaults, see the "Default Policy History" section below. + +Other available PQ policies are compared in the tables below. + +### Chart: Security Policy Version To PQ Hybrid Key Exchange Methods + +| Version | secp256r1+kyber768 | x25519+kyber768 | secp384r1+kyber768 | secp521r1+kyber1024 | secp256r1+kyber512 | x25519+kyber512 | +|-----------------------|--------------------|-----------------|--------------------|---------------------|--------------------|-----------------| +| default_pq / 20240730 | X | X | X | X | X | X | +| PQ-TLS-1-2-2023-12-15 | X | | X | X | X | | +| PQ-TLS-1-2-2023-12-14 | X | | X | X | X | | +| PQ-TLS-1-2-2023-12-13 | X | | X | X | X | | +| PQ-TLS-1-2-2023-10-10 | X | X | X | X | X | X | +| PQ-TLS-1-2-2023-10-09 | X | X | X | X | X | X | +| PQ-TLS-1-2-2023-10-08 | X | X | X | X | X | X | +| PQ-TLS-1-2-2023-10-07 | X | X | X | X | X | X | +| PQ-TLS-1-3-2023-06-01 | X | X | X | X | X | X | + +### Chart: Security Policy Version To Classic Key Exchange + +If the peer doesn't support a PQ hybrid key exchange method, s2n-tls will fall back to a classical option. + +| Version | secp256r1 | x25519 | secp384r1 | secp521r1 | DHE | RSA | +|-----------------------|-----------|--------|-----------|-----------|-----|-----| +| default_pq / 20240730 | X | X | X | X | | | +| PQ-TLS-1-2-2023-12-15 | X | | X | X | X | | +| PQ-TLS-1-2-2023-12-14 | X | | X | X | | | +| PQ-TLS-1-2-2023-12-13 | X | | X | X | | X | +| PQ-TLS-1-2-2023-10-10 | X | X | X | | X | X | +| PQ-TLS-1-2-2023-10-09 | X | X | X | | X | | +| PQ-TLS-1-2-2023-10-08 | X | X | X | | X | X | +| PQ-TLS-1-2-2023-10-07 | X | X | X | | | X | +| PQ-TLS-1-3-2023-06-01 | X | | X | X | X | X | + +### Chart: Security Policy Version To Ciphers + +| Version | AES-CBC | AES-GCM | CHACHAPOLY | 3DES | +|-----------------------|---------|---------|------------|------| +| default_pq / 20240730 | X | X | X | | +| PQ-TLS-1-2-2023-12-15 | X | X | | | +| PQ-TLS-1-2-2023-12-14 | X | X | | | +| PQ-TLS-1-2-2023-12-13 | X | X | | | +| PQ-TLS-1-2-2023-10-10 | X | X | X* | X | +| PQ-TLS-1-2-2023-10-09 | X | X | X* | X | +| PQ-TLS-1-2-2023-10-08 | X | X | X* | X | +| PQ-TLS-1-2-2023-10-07 | X | X | X* | | +| PQ-TLS-1-3-2023-06-01 | X | X | X* | X | +* only for TLS1.3 + +### Chart: Security Policy Version To Signature Schemes + +| Version | ECDSA | RSA | RSA-PSS | Legacy SHA1 | +|-----------------------|---------|-----|---------|-------------| +| default_pq / 20240730 | X | X | X | | +| PQ-TLS-1-2-2023-12-15 | X | X | X | | +| PQ-TLS-1-2-2023-12-14 | X | X | X | | +| PQ-TLS-1-2-2023-12-13 | X | X | X | | +| PQ-TLS-1-2-2023-10-10 | X | X | X | X | +| PQ-TLS-1-2-2023-10-09 | X | X | X | X | +| PQ-TLS-1-2-2023-10-08 | X | X | X | X | +| PQ-TLS-1-2-2023-10-07 | X | X | X | X | +| PQ-TLS-1-3-2023-06-01 | X | X | X | X | + +### Chart: Security Policy Version To TLS Protocol Version + +| Version | 1.2 | 1.3 | +|-----------------------|-----|-----| +| default_pq / 20240730 | X | X | +| PQ-TLS-1-2-2023-12-15 | X | X | +| PQ-TLS-1-2-2023-12-14 | X | X | +| PQ-TLS-1-2-2023-12-13 | X | X | +| PQ-TLS-1-2-2023-10-10 | X | X | +| PQ-TLS-1-2-2023-10-09 | X | X | +| PQ-TLS-1-2-2023-10-08 | X | X | +| PQ-TLS-1-2-2023-10-07 | X | X | +| PQ-TLS-1-3-2023-06-01 | X | X | + +#### Default Policy History +| Version | "default_pq" | +|------------|--------------| +| v1.4.19 | 20240730 | diff --git a/tests/unit/s2n_security_policies_test.c b/tests/unit/s2n_security_policies_test.c index 6f3e2b27ced..1672ca883e2 100644 --- a/tests/unit/s2n_security_policies_test.c +++ b/tests/unit/s2n_security_policies_test.c @@ -1090,5 +1090,27 @@ int main(int argc, char **argv) }; }; + /* Test that default_pq always matches default_tls13 */ + { + const struct s2n_security_policy *default_pq = NULL; + EXPECT_SUCCESS(s2n_find_security_policy_from_version("default_pq", &default_pq)); + EXPECT_NOT_EQUAL(default_pq->kem_preferences, &kem_preferences_null); + + const struct s2n_security_policy *default_tls13 = NULL; + EXPECT_SUCCESS(s2n_find_security_policy_from_version("default_tls13", &default_tls13)); + EXPECT_EQUAL(default_tls13->kem_preferences, &kem_preferences_null); + + /* If we ignore kem preferences, the two policies match */ + EXPECT_EQUAL(default_pq->minimum_protocol_version, default_tls13->minimum_protocol_version); + EXPECT_EQUAL(default_pq->cipher_preferences, default_tls13->cipher_preferences); + EXPECT_EQUAL(default_pq->signature_preferences, default_tls13->signature_preferences); + EXPECT_EQUAL(default_pq->certificate_signature_preferences, + default_tls13->certificate_signature_preferences); + EXPECT_EQUAL(default_pq->ecc_preferences, default_tls13->ecc_preferences); + EXPECT_EQUAL(default_pq->certificate_key_preferences, default_tls13->certificate_key_preferences); + EXPECT_EQUAL(default_pq->certificate_preferences_apply_locally, + default_tls13->certificate_preferences_apply_locally); + }; + END_TEST(); } diff --git a/tls/s2n_security_policies.c b/tls/s2n_security_policies.c index c36515bd3c1..d6a833ab2f8 100644 --- a/tls/s2n_security_policies.c +++ b/tls/s2n_security_policies.c @@ -59,6 +59,19 @@ const struct s2n_security_policy security_policy_20240503 = { }, }; +/* PQ default as of 07/24 */ +const struct s2n_security_policy security_policy_20240730 = { + .minimum_protocol_version = S2N_TLS12, + .cipher_preferences = &cipher_preferences_cloudfront_tls_1_2_2019, + .kem_preferences = &kem_preferences_pq_tls_1_3_2023_06, + .signature_preferences = &s2n_signature_preferences_20240501, + .certificate_signature_preferences = &s2n_certificate_signature_preferences_20201110, + .ecc_preferences = &s2n_ecc_preferences_20240501, + .rules = { + [S2N_PERFECT_FORWARD_SECRECY] = true, + }, +}; + const struct s2n_security_policy security_policy_20240603 = { .minimum_protocol_version = S2N_TLS12, .cipher_preferences = &cipher_preferences_20240603, @@ -1124,6 +1137,7 @@ struct s2n_security_policy_selection security_policy_selection[] = { { .version = "default", .security_policy = &security_policy_20240501, .ecc_extension_required = 0, .pq_kem_extension_required = 0 }, { .version = "default_tls13", .security_policy = &security_policy_20240503, .ecc_extension_required = 0, .pq_kem_extension_required = 0 }, { .version = "default_fips", .security_policy = &security_policy_20240502, .ecc_extension_required = 0, .pq_kem_extension_required = 0 }, + { .version = "default_pq", .security_policy = &security_policy_20240730, .ecc_extension_required = 0, .pq_kem_extension_required = 0 }, { .version = "20240501", .security_policy = &security_policy_20240501, .ecc_extension_required = 0, .pq_kem_extension_required = 0 }, { .version = "20240502", .security_policy = &security_policy_20240502, .ecc_extension_required = 0, .pq_kem_extension_required = 0 }, { .version = "20240503", .security_policy = &security_policy_20240503, .ecc_extension_required = 0, .pq_kem_extension_required = 0 }, @@ -1131,6 +1145,7 @@ struct s2n_security_policy_selection security_policy_selection[] = { { .version = "20240331", .security_policy = &security_policy_20240331, .ecc_extension_required = 0, .pq_kem_extension_required = 0 }, { .version = "20240417", .security_policy = &security_policy_20240417, .ecc_extension_required = 0, .pq_kem_extension_required = 0 }, { .version = "20240416", .security_policy = &security_policy_20240416, .ecc_extension_required = 0, .pq_kem_extension_required = 0 }, + { .version = "20240730", .security_policy = &security_policy_20240730, .ecc_extension_required = 0, .pq_kem_extension_required = 0 }, { .version = "ELBSecurityPolicy-TLS-1-0-2015-04", .security_policy = &security_policy_elb_2015_04, .ecc_extension_required = 0, .pq_kem_extension_required = 0 }, /* Not a mistake. TLS-1-0-2015-05 and 2016-08 are equivalent */ { .version = "ELBSecurityPolicy-TLS-1-0-2015-05", .security_policy = &security_policy_elb_2016_08, .ecc_extension_required = 0, .pq_kem_extension_required = 0 }, From acc53992aa4a3a5d8707528f98e9ecd3024ad50c Mon Sep 17 00:00:00 2001 From: Lindsay Stewart Date: Wed, 31 Jul 2024 01:02:43 -0700 Subject: [PATCH 02/10] Fix asterisk --- docs/usage-guide/topics/ch15-post-quantum.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage-guide/topics/ch15-post-quantum.md b/docs/usage-guide/topics/ch15-post-quantum.md index ef6394db494..62dff547c23 100644 --- a/docs/usage-guide/topics/ch15-post-quantum.md +++ b/docs/usage-guide/topics/ch15-post-quantum.md @@ -71,7 +71,7 @@ If the peer doesn't support a PQ hybrid key exchange method, s2n-tls will fall b | PQ-TLS-1-2-2023-10-08 | X | X | X* | X | | PQ-TLS-1-2-2023-10-07 | X | X | X* | | | PQ-TLS-1-3-2023-06-01 | X | X | X* | X | -* only for TLS1.3 +\* only for TLS1.3 ### Chart: Security Policy Version To Signature Schemes From 02c0b01b2d016d6bed1bb5f638aeaf3f848383fd Mon Sep 17 00:00:00 2001 From: Lindsay Stewart Date: Wed, 31 Jul 2024 23:46:19 -0700 Subject: [PATCH 03/10] PR feedback --- docs/usage-guide/topics/ch15-post-quantum.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage-guide/topics/ch15-post-quantum.md b/docs/usage-guide/topics/ch15-post-quantum.md index 62dff547c23..d0c40c6645a 100644 --- a/docs/usage-guide/topics/ch15-post-quantum.md +++ b/docs/usage-guide/topics/ch15-post-quantum.md @@ -2,7 +2,7 @@ s2n-tls supports post-quantum key exchange for TLS1.3. Currently, only [Kyber](https://pq-crystals.org/kyber/) is supported. -Specifically, s2n-tls supports hybrid key exchange. s2n-tls uses both classic and post-quantum key exchange algorithms at the same time, combining the two secrets. If one of the algorithms is compromised, either because advances in quantum computing make the classic algorithm insecure or because cryptographers find a flaw in the relatively new post-quantum algorithm, the secret is still secure. Hybrid post-quantum key exchange is more secure than standard key exchange, but slower and more expensive. +Specifically, s2n-tls supports hybrid key exchange. PQ hybrid key exchange involves performing both classic ECDH key exchange and post-quantum Kyber key exchange, then combining the two resultant secrets. This strategy combines the high assurance of the classical key exchange algorithms with the quantum-resistance of the new post-quantum key exchange algorithms. If one of the two algorithms is compromised, either because advances in quantum computing make the classic algorithms insecure or because cryptographers find a flaw in the relatively new post-quantum algorithms, the secret is still secure. Hybrid post-quantum key exchange is more secure than standard key exchange, but is slower and requires more processing and more network bandwidth. Careful: if an s2n-tls server is configured to support post-quantum key exchange, the server will require that any client that advertises support ultimately uses post-quantum key exchange. That will result in a retry and an extra round trip if the client does not intially provide a post-quantum key share. From fdd34fd7ac91061f098313b5f75ccccef0db1915 Mon Sep 17 00:00:00 2001 From: Lindsay Stewart Date: Thu, 1 Aug 2024 00:09:21 -0700 Subject: [PATCH 04/10] PR comments: update build docs instead of pq docs --- docs/BUILD.md | 4 ++++ docs/usage-guide/topics/ch15-post-quantum.md | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/BUILD.md b/docs/BUILD.md index a47ccc681d8..7c2640411ae 100644 --- a/docs/BUILD.md +++ b/docs/BUILD.md @@ -68,6 +68,10 @@ cmake --install build Note that we currently do not support building on Windows. See https://github.com/aws/s2n-tls/issues/497 for more information. +Using the commands above, the libraries and headers will be located in the `s2n-tls-install` directory. + +The s2nc and s2nd test utilities are not installed by default, but can be found in the `build/bin` directory. To also install s2nc and s2nd, add `-DS2N_INSTALL_S2NC_S2ND=1` to the cmake command. + ## Consuming s2n-tls via CMake s2n-tls ships with modern CMake finder scripts if CMake is used for the build. To take advantage of this from your CMake script, all you need to do to compile and link against s2n-tls in your project is: diff --git a/docs/usage-guide/topics/ch15-post-quantum.md b/docs/usage-guide/topics/ch15-post-quantum.md index d0c40c6645a..0e654f79cd7 100644 --- a/docs/usage-guide/topics/ch15-post-quantum.md +++ b/docs/usage-guide/topics/ch15-post-quantum.md @@ -18,7 +18,6 @@ If you're unsure what cryptography library s2n-tls is built against, trying runn libcrypto: AWS-LC Listening on localhost:8000 ``` -If you built s2n-tls with the [cmake build instructions](https://github.com/aws/s2n-tls/blob/main/docs/BUILD.md#building-s2n-tls), s2nd and s2nc can be found in `build/bin`. ### Security Policy From 68bfe944f4c9bf88bf9409ce7d9d980dadd45cf1 Mon Sep 17 00:00:00 2001 From: Lindsay Stewart Date: Thu, 1 Aug 2024 13:22:09 -0700 Subject: [PATCH 05/10] PR comments: add IETF link --- docs/usage-guide/topics/ch15-post-quantum.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage-guide/topics/ch15-post-quantum.md b/docs/usage-guide/topics/ch15-post-quantum.md index 0e654f79cd7..b74129d9f22 100644 --- a/docs/usage-guide/topics/ch15-post-quantum.md +++ b/docs/usage-guide/topics/ch15-post-quantum.md @@ -1,6 +1,6 @@ # Post Quantum (PQ) Support -s2n-tls supports post-quantum key exchange for TLS1.3. Currently, only [Kyber](https://pq-crystals.org/kyber/) is supported. +s2n-tls supports post-quantum key exchange for TLS1.3. Currently, only [Kyber](https://pq-crystals.org/kyber/) is supported. See the draft IETF standard: https://datatracker.ietf.org/doc/html/draft-ietf-tls-hybrid-design Specifically, s2n-tls supports hybrid key exchange. PQ hybrid key exchange involves performing both classic ECDH key exchange and post-quantum Kyber key exchange, then combining the two resultant secrets. This strategy combines the high assurance of the classical key exchange algorithms with the quantum-resistance of the new post-quantum key exchange algorithms. If one of the two algorithms is compromised, either because advances in quantum computing make the classic algorithms insecure or because cryptographers find a flaw in the relatively new post-quantum algorithms, the secret is still secure. Hybrid post-quantum key exchange is more secure than standard key exchange, but is slower and requires more processing and more network bandwidth. From 4488d5383259e6dede83096ffd1cc8ae78a6eb8a Mon Sep 17 00:00:00 2001 From: Lindsay Stewart Date: Fri, 2 Aug 2024 11:33:09 -0700 Subject: [PATCH 06/10] Fix build --- bin/s2nc.c | 1 + bin/s2nd.c | 1 + 2 files changed, 2 insertions(+) diff --git a/bin/s2nc.c b/bin/s2nc.c index 4aaa762c297..6adb8b8d410 100644 --- a/bin/s2nc.c +++ b/bin/s2nc.c @@ -33,6 +33,7 @@ #include "api/unstable/npn.h" #include "api/unstable/renegotiate.h" #include "common.h" +#include "crypto/s2n_openssl.h" #include "error/s2n_errno.h" #include "tls/s2n_connection.h" diff --git a/bin/s2nd.c b/bin/s2nd.c index 24913ae40b5..b5541b7a233 100644 --- a/bin/s2nd.c +++ b/bin/s2nd.c @@ -34,6 +34,7 @@ #include "api/s2n.h" #include "api/unstable/npn.h" #include "common.h" +#include "crypto/s2n_openssl.h" #include "utils/s2n_safety.h" #define MAX_CERTIFICATES 50 From b2e043d9a2f3b1dbcc2ebd574b10b453c305036d Mon Sep 17 00:00:00 2001 From: Lindsay Stewart Date: Fri, 2 Aug 2024 12:25:38 -0700 Subject: [PATCH 07/10] Just delete TESTING_PQ --- bindings/rust/s2n-tls/src/security.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/bindings/rust/s2n-tls/src/security.rs b/bindings/rust/s2n-tls/src/security.rs index 8b23307c1cd..3289c779edb 100644 --- a/bindings/rust/s2n-tls/src/security.rs +++ b/bindings/rust/s2n-tls/src/security.rs @@ -84,9 +84,6 @@ pub const DEFAULT: Policy = policy!("default"); /// pub const DEFAULT_TLS13: Policy = policy!("default_tls13"); -#[cfg(feature = "pq")] -pub const TESTING_PQ: Policy = policy!("PQ-TLS-1-0-2021-05-26"); - #[cfg(feature = "pq")] pub const DEFAULT_PQ: Policy = policy!("default_pq"); @@ -94,7 +91,5 @@ pub const ALL_POLICIES: &[Policy] = &[ DEFAULT, DEFAULT_TLS13, #[cfg(feature = "pq")] - TESTING_PQ, - #[cfg(feature = "pq")] DEFAULT_PQ, ]; From f7ec1f1a9cbc304c5a34f4fdd63d6ca19e86c2a6 Mon Sep 17 00:00:00 2001 From: Lindsay Stewart Date: Fri, 2 Aug 2024 13:00:48 -0700 Subject: [PATCH 08/10] Revert "Just delete TESTING_PQ" This reverts commit 6a57e5de538cd39deba29bf47996e8b67d3efd63. --- bindings/rust/s2n-tls/src/security.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bindings/rust/s2n-tls/src/security.rs b/bindings/rust/s2n-tls/src/security.rs index 3289c779edb..8b23307c1cd 100644 --- a/bindings/rust/s2n-tls/src/security.rs +++ b/bindings/rust/s2n-tls/src/security.rs @@ -84,6 +84,9 @@ pub const DEFAULT: Policy = policy!("default"); /// pub const DEFAULT_TLS13: Policy = policy!("default_tls13"); +#[cfg(feature = "pq")] +pub const TESTING_PQ: Policy = policy!("PQ-TLS-1-0-2021-05-26"); + #[cfg(feature = "pq")] pub const DEFAULT_PQ: Policy = policy!("default_pq"); @@ -91,5 +94,7 @@ pub const ALL_POLICIES: &[Policy] = &[ DEFAULT, DEFAULT_TLS13, #[cfg(feature = "pq")] + TESTING_PQ, + #[cfg(feature = "pq")] DEFAULT_PQ, ]; From 25904bf03fc103c088a91a1e06b32ce016407ba1 Mon Sep 17 00:00:00 2001 From: Lindsay Stewart Date: Mon, 5 Aug 2024 16:56:01 -0700 Subject: [PATCH 09/10] Actually fix build The interned builds were failing because the binaries couldn't access the libcrypto method to check the version. I tried conditional compilation, but different versions of libcrypto alias the version method to different methods and the check was getting too messy. So instead, I'm just going to call an s2n-tls method. s2nc and s2nd shouldn't do that, but they do that all over the place anyway. --- bin/s2nc.c | 4 ++-- bin/s2nd.c | 4 ++-- crypto/s2n_libcrypto.c | 2 +- crypto/s2n_libcrypto.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/s2nc.c b/bin/s2nc.c index 6adb8b8d410..ff15b66c887 100644 --- a/bin/s2nc.c +++ b/bin/s2nc.c @@ -33,7 +33,7 @@ #include "api/unstable/npn.h" #include "api/unstable/renegotiate.h" #include "common.h" -#include "crypto/s2n_openssl.h" +#include "crypto/s2n_libcrypto.h" #include "error/s2n_errno.h" #include "tls/s2n_connection.h" @@ -592,7 +592,7 @@ int main(int argc, char *const *argv) } GUARD_EXIT(s2n_init(), "Error running s2n_init()"); - printf("libcrypto: %s\n", SSLeay_version(SSLEAY_VERSION)); + printf("libcrypto: %s\n", s2n_libcrypto_get_version_name()); if ((r = getaddrinfo(host, port, &hints, &ai_list)) != 0) { fprintf(stderr, "error: %s\n", gai_strerror(r)); diff --git a/bin/s2nd.c b/bin/s2nd.c index b5541b7a233..08109807d79 100644 --- a/bin/s2nd.c +++ b/bin/s2nd.c @@ -34,7 +34,7 @@ #include "api/s2n.h" #include "api/unstable/npn.h" #include "common.h" -#include "crypto/s2n_openssl.h" +#include "crypto/s2n_libcrypto.h" #include "utils/s2n_safety.h" #define MAX_CERTIFICATES 50 @@ -566,7 +566,7 @@ int main(int argc, char *const *argv) } GUARD_EXIT(s2n_init(), "Error running s2n_init()"); - printf("libcrypto: %s\n", SSLeay_version(SSLEAY_VERSION)); + printf("libcrypto: %s\n", s2n_libcrypto_get_version_name()); printf("Listening on %s:%s\n", host, port); diff --git a/crypto/s2n_libcrypto.c b/crypto/s2n_libcrypto.c index 9e40500da6e..166e3bf86e3 100644 --- a/crypto/s2n_libcrypto.c +++ b/crypto/s2n_libcrypto.c @@ -55,7 +55,7 @@ * symbol OpenSSL_version binded to at link-time. This can be used as * verification at run-time that s2n linked against the expected libcrypto. */ -static const char *s2n_libcrypto_get_version_name(void) +const char *s2n_libcrypto_get_version_name(void) { return SSLeay_version(SSLEAY_VERSION); } diff --git a/crypto/s2n_libcrypto.h b/crypto/s2n_libcrypto.h index 9e7aff882b8..7ec83557eaf 100644 --- a/crypto/s2n_libcrypto.h +++ b/crypto/s2n_libcrypto.h @@ -18,5 +18,5 @@ #include "utils/s2n_result.h" S2N_RESULT s2n_libcrypto_validate_runtime(void); - +const char *s2n_libcrypto_get_version_name(void); bool s2n_libcrypto_supports_flag_no_check_time(); From d96ed33cf6985d48e02386e6b53484d38933e60e Mon Sep 17 00:00:00 2001 From: Lindsay Stewart Date: Fri, 9 Aug 2024 10:20:26 -0700 Subject: [PATCH 10/10] Update docs/usage-guide/topics/ch15-post-quantum.md Co-authored-by: maddeleine <59030281+maddeleine@users.noreply.github.com> --- docs/usage-guide/topics/ch15-post-quantum.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage-guide/topics/ch15-post-quantum.md b/docs/usage-guide/topics/ch15-post-quantum.md index b74129d9f22..c9076876a4c 100644 --- a/docs/usage-guide/topics/ch15-post-quantum.md +++ b/docs/usage-guide/topics/ch15-post-quantum.md @@ -103,4 +103,4 @@ If the peer doesn't support a PQ hybrid key exchange method, s2n-tls will fall b #### Default Policy History | Version | "default_pq" | |------------|--------------| -| v1.4.19 | 20240730 | +| v1.5.0 | 20240730 |