0
0
mirror of https://github.com/XTLS/REALITY.git synced 2025-08-22 14:38:35 +00:00
Commit Graph

9 Commits

Author SHA1 Message Date
yuhan6665
8bde0136fd crypto/tls: support QUIC as a transport
Add a QUICConn type for use by QUIC implementations.

A QUICConn provides unencrypted handshake bytes and connection
secrets to the QUIC layer, and receives handshake bytes.

For #44886

Change-Id: I859dda4cc6d466a1df2fb863a69d3a2a069110d5
Reviewed-on: https://go-review.googlesource.com/c/go/+/493655
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Run-TryBot: Damien Neil <dneil@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Marten Seemann <martenseemann@gmail.com>
2023-11-12 12:08:30 -05:00
yuhan6665
275ea81328 crypto/tls: replace all usages of BytesOrPanic
Message marshalling makes use of BytesOrPanic a lot, under the
assumption that it will never panic. This assumption was incorrect, and
specifically crafted handshakes could trigger panics. Rather than just
surgically replacing the usages of BytesOrPanic in paths that could
panic, replace all usages of it with proper error returns in case there
are other ways of triggering panics which we didn't find.

In one specific case, the tree routed by expandLabel, we replace the
usage of BytesOrPanic, but retain a panic. This function already
explicitly panicked elsewhere, and returning an error from it becomes
rather painful because it requires changing a large number of APIs.
The marshalling is unlikely to ever panic, as the inputs are all either
fixed length, or already limited to the sizes required. If it were to
panic, it'd likely only be during development. A close inspection shows
no paths for a user to cause a panic currently.

This patches ends up being rather large, since it requires routing
errors back through functions which previously had no error returns.
Where possible I've tried to use helpers that reduce the verbosity
of frequently repeated stanzas, and to make the diffs as minimal as
possible.

Thanks to Marten Seemann for reporting this issue.

Fixes #58001
Fixes CVE-2022-41724

Change-Id: Ieb55867ef0a3e1e867b33f09421932510cb58851
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1679436
Reviewed-by: Julie Qiu <julieqiu@google.com>
TryBot-Result: Security TryBots <security-trybots@go-security-trybots.iam.gserviceaccount.com>
Run-TryBot: Roland Shoemaker <bracewell@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/468125
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Michael Pratt <mpratt@google.com>
2023-11-12 12:08:30 -05:00
RPRX
870716f6af Sync upstream Go 1.20
Excluding `boring` or test files
2023-11-12 12:08:30 -05:00
RPRX
dc9a7cef8e
crypto/tls: set const maxUselessRecords to 32 (the same with OpenSSL)
https://github.com/golang/go/pull/58913
2023-03-07 15:20:57 +00:00
世界
f90825ddae
Fix config clone (#3) 2023-02-28 11:51:37 +00:00
世界
14f5d5380b
Add DialContext (#1)
Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
2023-02-26 06:43:27 +00:00
RPRX
5e6719eaf3
REALITY is REALITY now
Thank @yuhan6665 for testing
2023-02-09 11:59:09 +08:00
RPRX
fb7fc93023
Prepare for REALITY protocol 2023-01-29 14:32:27 +00:00
RPRX
c3c05667a5
Package tls in Go 1.19.5
Excluding `boring` or test files
2023-01-29 14:31:01 +00:00