diff --git a/transport/internet/reality/reality.go b/transport/internet/reality/reality.go index de8a6ac60179..75a668c90913 100644 --- a/transport/internet/reality/reality.go +++ b/transport/internet/reality/reality.go @@ -136,7 +136,10 @@ func UClient(c net.Conn, config *Config, ctx context.Context, dest net.Destinati if config.Show { newError(fmt.Sprintf("REALITY localAddr: %v\thello.SessionId[:16]: %v\n", localAddr, hello.SessionId[:16])).WriteToLog(session.ExportIDToError(ctx)) } - publicKey, _ := ecdh.X25519().NewPublicKey(config.PublicKey) + publicKey, err := ecdh.X25519().NewPublicKey(config.PublicKey) + if err != nil { + return nil, errors.New("REALITY: publicKey == nil") + } uConn.AuthKey, _ = uConn.HandshakeState.State13.EcdheKey.ECDH(publicKey) if uConn.AuthKey == nil { return nil, errors.New("REALITY: SharedKey == nil")