Просмотр исходного кода

Fix: golang.org/x/crypto merge errors

Rod Hynes 7 лет назад
Родитель
Сommit
b0bdbc8586

+ 1 - 1
psiphon/common/crypto/chacha20poly1305/chacha20poly1305_amd64.go

@@ -9,7 +9,7 @@ package chacha20poly1305
 import (
 	"encoding/binary"
 
-	"github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/crypto/subtle"
+	"github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/crypto/internal/subtle"
 	"golang.org/x/sys/cpu"
 )
 

+ 2 - 2
psiphon/common/crypto/ssh/channel.go

@@ -482,8 +482,8 @@ func (ch *channel) handlePacket(packet []byte) error {
 		// - Use a smaller initial/max channel window size.
 		// - See comments above channelWindowSize definition.
 
-		//c.remoteWin.add(msg.MyWindow)
-		c.remoteWin.add(min(msg.MyWindow, getChannelWindowSize(c.chanType)))
+		//ch.remoteWin.add(msg.MyWindow)
+		ch.remoteWin.add(min(msg.MyWindow, getChannelWindowSize(ch.chanType)))
 
 		ch.msg <- msg
 	case *windowAdjustMsg:

+ 8 - 3
psiphon/common/crypto/ssh/mux_test.go

@@ -11,6 +11,11 @@ import (
 	"testing"
 )
 
+// PSIPHON
+// =======
+// See comment in channel.go
+var testChannelWindowSize = getChannelWindowSize("")
+
 func muxPair() (*mux, *mux) {
 	a, b := memPipe()
 
@@ -139,7 +144,7 @@ func TestMuxChannelOverflow(t *testing.T) {
 
 	wDone := make(chan int, 1)
 	go func() {
-		if _, err := writer.Write(make([]byte, channelWindowSize)); err != nil {
+		if _, err := writer.Write(make([]byte, testChannelWindowSize)); err != nil {
 			t.Errorf("could not fill window: %v", err)
 		}
 		writer.Write(make([]byte, 1))
@@ -171,7 +176,7 @@ func TestMuxChannelCloseWriteUnblock(t *testing.T) {
 
 	wDone := make(chan int, 1)
 	go func() {
-		if _, err := writer.Write(make([]byte, channelWindowSize)); err != nil {
+		if _, err := writer.Write(make([]byte, testChannelWindowSize)); err != nil {
 			t.Errorf("could not fill window: %v", err)
 		}
 		if _, err := writer.Write(make([]byte, 1)); err != io.EOF {
@@ -193,7 +198,7 @@ func TestMuxConnectionCloseWriteUnblock(t *testing.T) {
 
 	wDone := make(chan int, 1)
 	go func() {
-		if _, err := writer.Write(make([]byte, channelWindowSize)); err != nil {
+		if _, err := writer.Write(make([]byte, testChannelWindowSize)); err != nil {
 			t.Errorf("could not fill window: %v", err)
 		}
 		if _, err := writer.Write(make([]byte, 1)); err != io.EOF {