Commit graph

29 commits

Author SHA1 Message Date
b667e1450b Make algs public
Some checks failed
Rust check / fmt (push) Has been cancelled
Rust check / test-default (push) Has been cancelled
Rust check / test-tls12 (push) Has been cancelled
Rust check / test-logging-tls12 (push) Has been cancelled
Rust check / test-mlkem (push) Has been cancelled
Rust check / test-mlkem-tls12 (push) Has been cancelled
Rust check / test-fips (push) Has been cancelled
Rust check / check-fips (push) Has been cancelled
2026-04-13 11:44:03 +02:00
Jan Rüth
b88c87235d Harden crypto provider error handling and FIPS reporting
Implement provider-wide FIPS semantics by filtering non-FIPS suites in provider_with_ciphers() and wiring fips() reporting across provider components, KX groups, AEADs, and signature verifiers.

Replace panic-prone hotpath behavior with error returns across TLS/QUIC AEAD setup and header protection, enforce HKDF output bounds, and remove shared HMAC context cloning to tighten runtime safety.

Rework signing and verification paths to support SEC1 EC key loading, curve-aware scheme selection, and consistent malformed-input error handling without panics.

Add comprehensive regression coverage for malformed KX shares, verifier inputs, AEAD truncation and constructor failures, plus a panic-surface test that scans runtime provider/additions code for new panic constructs unless explicitly allowlisted.

Update the example client to return Result and eliminate non-test unwrap-style exits.
2026-04-10 17:17:44 +02:00
Jan Rüth
bbd0ccf0b8 Harden key material zeroization paths
Reduce secret lifetime in HKDF and HMAC internals, avoid extra shared-secret copying in key exchange, and add SHA384 HMAC coverage to guard output sizing.
2026-04-10 15:46:44 +02:00
Jan Rüth
c71d5bbfd8 Drop X448, P-521, FFDHE2048 to match boring's default group list 2026-04-10 15:34:22 +02:00
Jan Rüth
fafbf296b1 Add X25519MLKEM768 post-quantum hybrid key exchange
Implement the X25519MLKEM768 hybrid key exchange group per
draft-ietf-tls-ecdhe-mlkem-00, combining ML-KEM-768 (FIPS 203) with
X25519 for post-quantum/classical hybrid key agreement.

- New mlkem feature gating X25519MLKEM768 via boring's mlkem module
- fips feature now implies mlkem so PQ is always available in FIPS mode
- X25519MLKEM768 is the preferred (first) group in both FIPS and
  non-FIPS configurations when mlkem is enabled
- Uses boring::mlkem for ML-KEM-768 and direct X25519 FFI for the
  classical component (no SPKI overhead)
- Overrides start_and_complete() for server-side KEM encapsulation
- Wire format: ML-KEM component first in all encodings (client share
  1216 bytes, server share 1120 bytes, shared secret 64 bytes)
- TLS 1.3 only (usable_for_version rejects TLS 1.2)
- Unit tests: hybrid round-trip, invalid share rejection, version
  and FIPS flag checks
- E2E tests: self-to-self PQ TLS handshake, FIPS group assertions
- Cloudflare interop tests (ignored): verify kex=X25519MLKEM768 via
  /cdn-cgi/trace for TLS 1.3, verify classical fallback for TLS 1.2
- Update README with PQ section, feature docs, and FIPS KX updates
2026-04-10 15:34:22 +02:00
Jan Rüth
271acbb315 Bump boring to v5, align FIPS to SP 800-52r2, clean up features
- Bump boring/boring-sys from v4 to v5 (zero API breaks)
- Merge fips/fips-only into a single fips feature that both enables
  FIPS-validated BoringSSL and restricts algorithms to SP 800-52r2
- Tighten FIPS KX groups to P-256 and P-384 only (aligned with
  boring's fips202205 compliance policy)
- Remove ECDSA_P521_SHA512 from FIPS signature verification set
- Simplify fips feature to forward boring/fips only (drop redundant
  boring-sys/fips)
- Add fips-precompiled as deprecated alias matching boring's naming
- Change default features to empty (TLS 1.2 now requires explicit
  tls12 feature opt-in)
- Gate TLS 1.2 code paths properly so the crate compiles and passes
  tests with default (TLS 1.3 only) features
- Update README to reflect current state: boring v5, feature docs,
  FIPS mode documentation, workspace structure
2026-04-10 12:38:26 +02:00
Jan Rüth
490340afa7 Bump and cleanup deps and fix lints 2025-10-07 18:44:13 +02:00
John Howard
aa6e1c36f8 Update to rustls 0.23 2024-03-27 08:34:11 +01:00
John Howard
03b48134ca Fix QUIC compilation and FIPS features
Fix a build issue due to lack of trait constraints.

Pass FIPS feature flag through and test it
2024-02-21 08:44:20 +01:00
Jan Rüth
b1188e2ef1 Update to v22 2023-12-08 13:38:17 +01:00
Jan Rüth
107b463b84 more tests 2023-11-30 23:18:09 +01:00
Jan Rüth
9af16cef17 update to alpha.6 2023-11-30 23:18:09 +01:00
Jan Rüth
b24ac52817 Implement QUIC traits (untested) 2023-11-30 00:29:31 +01:00
Jan Rüth
fa032e97d1 Consolidate rustls dependencies in workspace deps 2023-11-30 00:29:31 +01:00
Jan Rüth
d3f5d31ddd Update boring and allow settings fips 2023-11-30 00:29:31 +01:00
Jan Rüth
5ead01a5c7 Update to rustls = 0.22.0-alpha.5 2023-11-26 22:19:48 +01:00
Jan Rüth
7d7b1b3f99 RSA tests and fix chacha20 in tls 1.2 2023-11-26 22:19:48 +01:00
Jan Rüth
624eda8168 Fix TLS 1.2 crypto and add end-to-end tests 2023-11-26 19:49:01 +01:00
Jan Rüth
b597423237 Fix signer and add e2e tls13 test 2023-11-26 19:49:01 +01:00
Jan Rüth
31ed3963a6 Have Makefile that does same commands as CI 2023-11-25 15:30:39 +01:00
Jan Rüth
d38412a3bd Use boringssl prf for tls1.2 2023-11-25 15:26:58 +01:00
Jan Rüth
bd80bfc4d7 Enhance error handling and docs 2023-11-24 19:41:01 +01:00
Jan Rüth
6f1394e4b4 Clippy 2023-11-24 16:14:10 +01:00
Jan Rüth
dfda846989 Rework KeyExchange types 2023-11-24 16:14:10 +01:00
Jan
d538b5a4a7 Create ci.yml 2023-11-24 16:11:18 +01:00
Jan Rüth
aa74b45a0f * Move ffi type container to boring-additions
* Use boring::derive for EC and ED instead of own implementation
2023-11-24 10:32:33 +01:00
Jan Rüth
319029f2d4 Fix AES256 using wrong hash
Add TLS 1.2
Move aead crypter to boring-additions crate
2023-11-20 20:36:55 +01:00
Jan Rüth
5c45b9426b Initial dump for a boring-rustls-provider
This is just a dump of me figuring out how to interface with boring and rustls.
It works to establish a connection and exchange data but I haven't written real tests yet, nor did I cleanup the code or made the effort to make it look nice.
There is probably some code in here that should rather live in the `boring` crate.
2023-11-19 17:49:03 +01:00
Jan
db339f7161
Initial commit 2023-11-19 17:46:39 +01:00