Commit Graph

  • 0770d92f72 Use direct key in config remove-circl Fangliding 2026-09-21 13:30:30 +08:00
  • 1cb42ad809 Remove circl Fangliding 2026-09-10 09:53:30 +08:00
  • 3c98159dee Sync upstream Go 1.27+; Add "[REALITY] SECTION" comments (#30) main yuhan6665 2026-09-20 23:57:37 +00:00
  • f6eb30fc0e Use newConstantTimeHash for MAC update yuhan6665 2026-09-20 19:22:30 -04:00
  • 9124ee149d Sync upstream Go 1.27+; Add "[REALITY] SECTION" comments (#30) yuhan6665 2026-09-20 21:57:26 +00:00
  • 8cdf7bf9c7 REALITY protocol: Reject outdated/strange Client Hello that doesn't have X25519MLKEM768 before optional X25519 RPRX 2026-09-08 06:21:03 +00:00
  • e1986a4d31 fix: DetectPostHandshakeRecordsLens background probe bugs (panic, leak, race) (#36) hexonaland风扇滑翔翼 2026-09-08 00:58:12 -04:00
  • 393f8de3ee Increase REALITY target TLS record buffer to 17 KiB (#33) fan yang 2026-09-08 12:29:18 +08:00
  • 8530a57042 Try pass RST underlying-rst Fangliding 2026-08-28 02:33:02 +08:00
  • a912046c74 Prevent panic bad-conn Fangliding 2026-06-23 22:20:22 +08:00
  • 4379845b08 Output ClientHello read err ClientHelloReadErr Fangliding 2026-05-01 17:48:11 +08:00
  • 9234c772ba Add maxUselessRecords (ChangeCipherSpec, etc.) detection (#29) 风扇滑翔翼 2026-03-22 17:59:12 +08:00
  • ad4fbafc4b fix(record_detect): use configured network type instead of hardcoded tcp (#26) 易安 2026-03-21 22:01:11 +08:00
  • cd53f7d502 Close target when client closed 风扇滑翔翼 2025-10-21 15:10:59 +00:00
  • e4eec45205 Add detailed error reporting for REALITY invalid connections (#24) JesusandRPRX 2025-10-14 23:56:29 +04:00
  • dab26e77fc go.mod & go.sum: Upgrade direct dependencies RPRX 2025-10-14 19:45:36 +00:00
  • 431b6ff8c6 README.md: Update Donation & NFTs RPRX 2025-09-04 21:47:05 +00:00
  • 046fad5ab6 README.md: Update Donation & NFTs RPRX 2025-08-28 04:45:27 +00:00
  • de3bb4d08f Update readme yuhan6665 2025-07-27 18:37:21 -04:00
  • 5b52a03d4f Fix sending Server Hello in an unexpected way for fixing edge cases RPRX 2025-07-25 14:20:56 +00:00
  • c6320729d9 README.md: Add REALITY NFT's image & link RPRX 2025-07-23 12:10:14 +00:00
  • 00881f6740 README.md: Add "mldsa65Seed" and "mldsa65Verify" to example RPRX 2025-07-23 02:23:38 +00:00
  • 4eaf7927f3 REALITY protocol: Add optional Post-Quantum ML-DSA-65 signature to cert's ExtraExtensions RPRX 2025-07-22 04:56:54 +00:00
  • ebbbf46ec3 REALITY protocol: Use X25519MLKEM768's data if X25519 doesn't exist in Client Hello RPRX 2025-07-22 04:56:14 +00:00
  • 05a351a645 Three types of ALPN for post-handshake records detection & imitation RPRX 2025-07-15 05:57:25 +00:00
  • 5eeac447fe Delay and detect H2 settings frame delay yuhan6665 2025-07-13 21:13:17 -04:00
  • 7e74211727 Add more fingerprints identification fingerprint-probe yuhan6665 2025-07-01 22:45:46 -04:00
  • 6219e43643 Simple method for IdentifyModernFingerprint yuhan6665 2025-06-28 23:23:49 -04:00
  • e62c4aed0d Refactor post-handshake records detection & imitation again RPRX 2025-06-27 14:14:58 +00:00
  • dc28cce21c Fix missing config.Show check before printing len(postHandshakeRecord) (#18) wyx2685 2025-06-27 19:39:29 +08:00
  • 49f5025763 Record packet length with time yuhan6665 2025-06-22 23:59:42 -04:00
  • 6833ba5445 Fix a bug when multiple inbounds defined with same sni yuhan6665 2025-06-15 17:11:51 -04:00
  • f13edcc98b Fix hanging issue for some randomized fingerprints yuhan6665 2025-06-15 00:30:40 -04:00
  • 0d942695e3 Fix bug yuhan6665 2025-06-09 10:21:50 -04:00
  • cb47a5839c Add probe for all modern fingerprint yuhan6665 2025-06-08 17:17:34 -04:00
  • 50752aec6b Some small changes 2025-06-08 13:21:14 +00:00
  • 4fd34dd4eb feat: Add rate limiting to fallback handling via token bucket (#12) MeowandRPRX 2025-06-08 21:11:45 +08:00
  • 90e738a94c Refine GlobalPostHandshakeRecordsLens' locker RPRX 2025-06-07 10:56:25 +00:00
  • 88910695ec Use Chrome's fingerprint to trigger target's post-handshake records RPRX 2025-06-07 08:21:47 +00:00
  • 21af070492 Refactor post-handshake records detection & imitation RPRX 2025-06-06 06:46:02 +00:00
  • 967adadcc7 Add post-handshake records detection (#17) 风扇滑翔翼 2025-06-06 09:44:11 +08:00
  • e679ef7bb1 crypto/tls: signature_algorithms in CertificateRequest can't be empty Change-Id: I6a6a4656ab97e1f247df35b2589cd73461b4ac76 Reviewed-on: https://go-review.googlesource.com/c/go/+/675917 Auto-Submit: Filippo Valsorda <filippo@golang.org> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Daniel McCarney <daniel@binaryparadox.net> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> yuhan6665 2025-05-25 16:05:54 -04:00
  • c169f1395b crypto/tls: reject duplicate TLS 1.3 EncryptedExtensions When a TLS 1.3 client processes the server's encryptedExtensionsMsg it should reject instances that contain duplicate extension types. yuhan6665 2025-05-25 16:04:50 -04:00
  • 3c80a18847 crypto/tls: use decode alert for handshake msg unmarshal err Previously if instances of the handshakeMessage interface returned false from unmarshal(), indicating an umarshalling error, the crypto/tls package would emit an unexpected_message alert. This commit changes to use a decode_error alert for this condition instead. yuhan6665 2025-05-25 16:02:24 -04:00
  • 5a0e0628ae crypto/tls: disable SHA-1 signature algorithms in TLS 1.2 This implements RFC 9155 by removing support for SHA-1 algorithms: yuhan6665 2025-05-25 16:00:59 -04:00
  • 5938152cb0 crypto/tls: don't advertise TLS 1.2-only sigAlgs in TLS 1.3 If a ClientHello only supports TLS 1.3, or if a CertificateRequest is sent after selecting TLS 1.3, we should not advertise TLS 1.2-only signature_algorithms like PKCS#1 v1.5 or SHA-1. yuhan6665 2025-05-25 15:48:10 -04:00
  • a74700bdda crypto/tls: match compression method alert across versions When a pre-TLS 1.3 server processes a client hello message that indicates compression methods that don't include the null compression method, send an illegal parameter alert. yuhan6665 2025-05-25 15:37:45 -04:00
  • 84df3a70da crypto/tls: delete dead code curveIDForCurve This unexported function has no call-sites. yuhan6665 2025-05-25 15:36:55 -04:00
  • 792d6c1166 crypto/tls: verify server chooses advertised curve When a crypto/tls client using TLS < 1.3 sends supported elliptic_curves in a client hello message the server must limit itself to choosing one of the supported options from our message. If we process a server key exchange message that chooses an unadvertised curve, abort the handshake w/ an error. yuhan6665 2025-05-25 15:36:12 -04:00
  • 6648c3b5a7 crypto/tls: have servers prefer TLS 1.3 when supported Previously the common Config.mutualVersion() code prioritized the selected version based on the provided peerVersions being sent in peer preference order. yuhan6665 2025-05-25 15:34:38 -04:00
  • 8ef3e8ca6d crypto/tls: add GetEncryptedClientHelloKeys This allows servers to rotate their ECH keys without needing to restart the server. yuhan6665 2025-05-25 15:32:29 -04:00
  • 176e7bdccb crypto/tls: replace custom intern cache with weak cache Uses the new weak package to replace the existing custom intern cache with a map of weak.Pointers instead. This simplifies the cache, and means we don't need to store a slice of handles on the Conn anymore. yuhan6665 2025-05-25 15:27:31 -04:00
  • 28a42c2be7 Use public module for AES GCM yuhan6665 2025-05-25 15:15:36 -04:00
  • a66a2f0ccf Expose EchConfig for xray core client config yuhan6665 2025-05-18 22:08:21 -04:00
  • 1292b8ce43 Update dependencies Pk-web6936 2025-05-19 10:20:04 +00:00
  • 4df2ec9a5b REALITY protocol: Remove ChaCha20-Poly1305 support for REALITY's session id auth RPRX 2025-05-16 07:07:13 +00:00
  • 514f8647ea More fixes for AES block yuhan6665 2025-05-13 08:52:09 -04:00
  • 2ea7e5619e Fix https://github.com/XTLS/Xray-core/pull/3813#issuecomment-2874943277 RPRX 2025-05-13 04:53:25 +00:00
  • f07c896f71 REALITY practice: Support X25519MLKEM768 for TLS' communication RPRX 2025-05-12 20:18:51 +00:00
  • ce2747b9b0 Merge pull request #14 from XTLS/go124 RPRX 2025-05-12 17:55:31 +00:00
  • 20f151b00a crypto/tls: handle client hello version too high If the client hello legacy version is >= TLS 1.3, and no supported_versions extension is sent, negotiate TLS 1.2 or lower when supported. yuhan6665 2025-05-10 23:50:17 -04:00
  • db7cbf40cc crypto/tls: fix TLS <1.3 client cert required alert Previously for protocol versions older than TLS 1.3 our server handshake implementation sent an alertBadCertificate alert in the case where the server TLS config indicates a client cert is required and none was received. yuhan6665 2025-05-10 23:49:02 -04:00
  • b5e214e5fe crypto/tls: err for unsupported point format configs If a client or server explicitly offers point formats, and the point formats don't include the uncompressed format, then error. This matches BoringSSL and Rustls behaviour and allows enabling the PointFormat-Client-MissingUncompressed bogo test. yuhan6665 2025-05-10 23:46:21 -04:00
  • eef41364b3 crypto/tls: update TLS 1.3 client compression validation Unlike in earlier TLS versions, in TLS 1.3 when processing a server hello the legacy_compression_method MUST have the value 0. It is no longer a parameter that offers a choice of compression method. yuhan6665 2025-05-10 23:41:59 -04:00
  • ce70d0748e crypto/tls: use illegal param alert for bad compression Previously if the clientHandshakeState for the TLS 1.2 client code encountered a server helo message that contained a compression method other than compressionNone, we would emit an unexpected message alert. yuhan6665 2025-05-10 23:39:22 -04:00
  • 69ea598173 crypto/tls: use runtime.AddCleanup instead of runtime.SetFinalizer Replace the usage of runtime.SetFinalizer with runtime.AddCleanup in the certificate cache. yuhan6665 2025-05-10 23:37:34 -04:00
  • 5b2edd4705 crypto/tls: add offered cipher suites to the handshake error This change makes debugging easier if the server handshake fails because the client only offers unsupported algorithms. yuhan6665 2025-05-10 23:33:34 -04:00
  • 5052e9a93c crypto/tls: use crypto/hkdf For consistency, prefer crypto/hkdf over crypto/internal/fips140/hkdf. Both should have the same behavior given the constrained use of HKDF in TLS. yuhan6665 2025-05-10 23:30:06 -04:00
  • 989cf77b4e crypto/tls: add missing RUnlock in ticketKeys If GetConfigForClient returns a tls.Config that has SessionTicketsDisabled set, the TLS server handshake currently leaves the Config's internal RWMutex read locked after calculating the ticketKeys to use for the handshake. yuhan6665 2025-05-10 23:12:35 -04:00
  • fd9059aef1 crypto/tls: fix ECH compatibility Previously, the code only checked supportedVersions[0] for TLS 1.3 However, Chromium-based browsers may list TLS 1.3 at different positions, causing ECH failures. This fix: Iterates through supportedVersions to accept connections as long as TLS 1.3 is present. Improves ECH compatibility, ensuring Chrome, Edge, and other browsers work properly. yuhan6665 2025-05-10 23:11:32 -04:00
  • a2893060d9 crypto/tls: relax native FIPS 140-3 mode We are going to stick to BoringSSL's policy for Go+BoringCrypto, but when using the native FIPS 140-3 module we can allow Ed25519, ML-KEM, and P-521. yuhan6665 2025-05-10 23:09:16 -04:00
  • 45b1647aeb crypto/tls: clean up supported/default/allowed parameters Cleaned up a lot of the plumbing to make it consistently follow this logic: clone the preference order; filter by user preference; filter by FIPS policy. There should be no behavior changes. yuhan6665 2025-05-10 17:13:05 -04:00
  • 12fa20f9e0 crypto/tls: add ConnectionState.CurveID This required adding a new field to SessionState for TLS 1.0–1.2, since the key exchange is not repeated on resumption. The additional field is unfortunately not backwards compatible because current Go versions check that the encoding has no extra data at the end, but will cause cross-version tickets to be ignored. Relaxed that so we can add fields in a backwards compatible way the next time. yuhan6665 2025-05-10 16:53:52 -04:00
  • cffe49f981 crypto/tls: allow P-521 in FIPS 140-3 mode and Go+BoringCrypto Partially reverts CL 587296, restoring the Go+BoringCrypto 1.23 behavior in terms of supported curves. yuhan6665 2025-05-10 15:48:12 -04:00
  • dce8d41932 crypto/tls: reject TLS 1.3 compat session ID in TLS 1.2 If we weren't resuming an existing session, and we constructed a TLS 1.3 compatible client hello, ensure the server doesn't echo back the made up compatibility session ID if we end up handshaking for TLS 1.2. yuhan6665 2025-05-10 15:44:05 -04:00
  • b0d0891092 crypto/tls: align cert decode alert w/ BSSL For malformed client/server certificates in a TLS handshake send a decode_error alert, matching BoringSSL behaviour. yuhan6665 2025-05-10 15:42:49 -04:00
  • 399f0e1408 crypto/tls: ignore TLS 1.3 user canceled alerts When encountering alertUserCanceled in a TLS 1.3 handshake, ignore the alert and retry reading a record. This matches existing logic for how TLS 1.2 alertLevelWarning alerts are handled. yuhan6665 2025-05-10 15:41:07 -04:00
  • 7433b09af0 crypto/tls: reject empty TLS 1.3 session ticket While not clearly motivated by normative language in RFC 8446 it seems clear that an empty opaque ticket value is non-operable, and so we should reject it with an appropriate alert/error. yuhan6665 2025-05-10 15:39:46 -04:00
  • f1ede5e6ea crypto/tls: require EMS in FIPS 140-3 mode See Implementation Guidance D.Q. yuhan6665 2025-05-10 15:37:22 -04:00
  • 82d61a9469 crypto/tls: improve ech parsing errors Make the errors we return when parsing an ECHConfig slightly more verbose. yuhan6665 2025-05-10 15:33:25 -04:00
  • 6244b56531 crypto/tls: fix incorrect EncryptedClientHelloKey comment Updates #71706 yuhan6665 2025-05-10 15:29:33 -04:00
  • 9caf3f4dfc crypto/tls: document FIPS 140-3 mode behavior Change-Id: I6a6a465612cf76d148b9758ee3fcdc8606497830 Reviewed-on: https://go-review.googlesource.com/c/go/+/648835 Reviewed-by: Daniel McCarney <daniel@binaryparadox.net> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Filippo Valsorda <filippo@golang.org> Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> yuhan6665 2025-05-10 15:28:42 -04:00
  • 34e6b086a0 all: use slices.Contains to simplify code Change-Id: I9ef075bbb0e3c65f3c2a9d49e599ef50b18aa9be Reviewed-on: https://go-review.googlesource.com/c/go/+/639535 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> yuhan6665 2025-05-10 15:25:00 -04:00
  • c25bcef61f crypto/tls: send illegal_parameter on invalid ECHClientHello.type The spec indicates that if a client sends an invalid ECHClientHello.type in ClientHelloOuter, the server will abort the handshake with a decode_error alert. yuhan6665 2025-05-10 15:23:34 -04:00
  • 84d21a0006 crypto/tls: properly return ECH retry configs When ECH is rejected, properly take retry configs from the encrypted extensions message. Also fix the bogo shim to properly test for this behavior. yuhan6665 2025-05-10 15:17:34 -04:00
  • 670d92937c crypto/tls: fix misspelling in comment Change-Id: Ie36a19ed6d6922e68f98e43745a417a24f8a7828 GitHub-Last-Rev: 6fb32e3 GitHub-Pull-Request: #71060 Reviewed-on: https://go-review.googlesource.com/c/go/+/639215 Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Roland Shoemaker <roland@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com> yuhan6665 2025-05-10 15:14:04 -04:00
  • ca2258490f crypto/mlkem: swap order of return values of Encapsulate Per FIPS 203 (https://csrc.nist.gov/pubs/fips/203/final), the order of return values should be sharedKey, ciphertext. This commit simply swaps those return values and updates any consumers of the Encapsulate() method to respect the new order. yuhan6665 2025-05-10 15:11:17 -04:00
  • 4711d35b15 crypto/tls: normalize spelling of "ClientHello" in comments Change-Id: I2b62fb37ae390c42682354eaa2a9d03159563b6d Reviewed-on: https://go-review.googlesource.com/c/go/+/637179 Reviewed-by: Daniel McCarney <daniel@binaryparadox.net> Reviewed-by: Roland Shoemaker <roland@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Filippo Valsorda <filippo@golang.org> Reviewed-by: David Chase <drchase@google.com> yuhan6665 2025-05-10 15:08:48 -04:00
  • a102c2f5af crypto/tls: fix a broken link Change-Id: I5d4baa454487a810f138334b613b412a5273311e Reviewed-on: https://go-review.googlesource.com/c/go/+/631875 Reviewed-by: Filippo Valsorda <filippo@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Roland Shoemaker <roland@golang.org> Auto-Submit: Filippo Valsorda <filippo@golang.org> Reviewed-by: Russ Cox <rsc@golang.org> yuhan6665 2025-05-10 15:07:07 -04:00
  • cedab7cc24 crypto/tls: implement X25519MLKEM768 This makes three related changes that work particularly well together and would require significant extra work to do separately: it replaces X25519Kyber768Draft00 with X25519MLKEM768, it makes CurvePreferences ordering crypto/tls-selected, and applies a preference to PQ key exchange methods over key shares (to mitigate downgrades). yuhan6665 2025-05-10 15:06:04 -04:00
  • c3f6b7dc5f crypto/internal/hpke: rename Receipient to Recipient receipient -> recipient yuhan6665 2025-05-10 14:34:55 -04:00
  • cfe61417e9 crypto/tls: add server-side ECH Adds support for server-side ECH. yuhan6665 2025-05-10 14:31:47 -04:00
  • 32d3673ce6 Simplify with public modules yuhan6665 2025-05-05 00:12:49 -04:00
  • 02afebcf30 Update hpye.go to 760f228 yuhan6665 2025-05-04 23:20:28 -04:00
  • c14471f843 all: fix some function names and typos in comment Change-Id: I07e7c8eaa5bd4bac0d576b2f2f4cd3f81b0b77a4 Reviewed-on: https://go-review.googlesource.com/c/go/+/630055 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Commit-Queue: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Russ Cox <rsc@golang.org> Auto-Submit: Ian Lance Taylor <iant@google.com> yuhan6665 2025-05-04 23:11:48 -04:00
  • 9cb8914b9f crypto/tls: FIPS 140-3 mode Consolidates handling of FIPS 140-3 considerations for the tls package. Considerations specific to certificates are now handled in tls instead of x509 to limit the area-of-effect of FIPS as much as possible. Boringcrypto specific prefixes are renamed as appropriate. yuhan6665andFilippo Valsorda 2025-05-04 23:10:11 -04:00
  • 0f3d0f2e71 internal/byteorder: use canonical Go casing in names If Be and Le stand for big-endian and little-endian, then they should be BE and LE. yuhan6665 2025-05-04 22:35:51 -04:00
  • 6c71b461ee crypto/internal/fips/tls12: implement TLS 1.2 KDF For #69536 yuhan6665 2025-05-04 22:15:27 -04:00
  • 3833e8e2cb crypto/internal/mlkem768: move to crypto/internal/fips/mlkem In the process, replace out-of-module imports with their FIPS versions. yuhan6665 2025-05-04 21:47:49 -04:00
  • f63b058d4a crypto/internal/mlkem768: add -768 suffix to all exported identifiers In preparation for introducing ML-KEM-1024. yuhan6665 2025-05-04 17:07:26 -04:00