Browse Source

Check for nil seeds instead of allowing panic

Rod Hynes 7 năm trước cách đây
mục cha
commit
81ae963828

+ 4 - 0
vendor/github.com/Psiphon-Labs/tls-tris/handshake_client.go

@@ -54,6 +54,10 @@ func makeClientHello(config *Config) (*clientHelloMsg, error) {
 		return nil, errors.New("tls: NextProtos values too large")
 	}
 
+	if config.ClientHelloPRNGSeed == nil {
+		return nil, errors.New("tls: missing Config.ClientHelloPRNGSeed")
+	}
+
 	hello := &clientHelloMsg{
 		vers:                         config.maxVersion(),
 		compressionMethods:           []uint8{compressionNone},

+ 3 - 0
vendor/github.com/Psiphon-Labs/utls/u_parrots.go

@@ -511,6 +511,9 @@ func (uconn *UConn) parrotRandomizedALPN() error {
 func (uconn *UConn) parrotRandomizedNoALPN() error {
 
 	// [Psiphon]
+	if uconn.clientHelloPRNGSeed == nil {
+		return errors.New("missing UConn.clientHelloPRNGSeed")
+	}
 	PRNG := prng.NewPRNGWithSeed(uconn.clientHelloPRNGSeed)
 
 	hello := uconn.HandshakeState.Hello