outline-sdk icon indicating copy to clipboard operation
outline-sdk copied to clipboard

Update golang crypto library

Open ohnorobo opened this issue 6 months ago • 2 comments

run go get -u golang.org/x/crypto in sdk and in /x

This is to fix the error

E  panic: tls: ConnectionState is not equal to tls.ConnectionState: struct field count mismatch: 17 vs 16

Someone was seeing this while trying to use mobileproxy in an android app. Due to a new field being added in crypto/tls Conn.ConnectionState

ohnorobo avatar Aug 21 '25 12:08 ohnorobo

Yeah, I'm not yet convinced this fixes the issue (it's still in draft) and I'm suspicious of how dramatic the changes it makes are. We would want to test something like this very carefully.

The user found that compiling with go 1.24.6 fixed their issue, so it's definitely some kind of library version mismatch, presumably of x/crypto. Where the seam is exactly (psiphon and mobileproxy? the mobileproxy aar and the user's app?) I'm not sure.

By the error message, this unsafe reflection code in psiphon is also involved.

ohnorobo avatar Aug 21 '25 15:08 ohnorobo

It seems like they are hacking the TLS library. Perhaps we need to update the psiphon dependencies instead.

The reflection is concerning. I hope they are not doing any function calls with reflection (field lookup is ok), because that would disable dead code removal and bloat any code we build.

fortuna avatar Aug 21 '25 16:08 fortuna