Repository navigation
Fix Validate and bound TLS and QUIC certificate probes - #213
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Certificate fingerprint discovery in
FetchTlsCertSha256andFetchQuicCertSha256had inconsistent timeout and input handling. In QUIC, DNS could outlive the request deadline, a zero or omitted timeout expired the request immediately, and a DNS name could reach the server without SNI. Bracketed IPv6 addresses also failed to dial. Malformed fields could reach DNS or the transport before they were rejected.Fix
0selects443, timeout0selects five seconds, and the maximum timeout is 60 seconds.Related v2rayNG PR
The app PR preserves the profile's hostname as SNI when Android DNS resolves it to an IP or leaves lookup to the native resolver. It also rejects invalid explicit ports before DNS. 2dust/v2rayNG#6553
Passing the hostname from the app matters because JNI may already receive only an IP address. This library PR can infer SNI when the native request still contains a hostname. Its DNS deadline, IPv6 handling, and input validation also apply to other native callers. Each patch was tested with the other project's official version and can be merged independently.
Verification
go vetpassed. The test fixture was supplied by an external overlay.libv2ray_certSha256.go. Its production source matches the tested revision byte for byte.