Explorar el Código

Have a noise of variable size

tags/v2.2.0^2^2
9seconds hace 1 mes
padre
commit
7adfc0352e
Se han modificado 1 ficheros con 1 adiciones y 4 borrados
  1. 1
    4
      mtglib/internal/tls/fake/server_side.go

+ 1
- 4
mtglib/internal/tls/fake/server_side.go Ver fichero

7
 	"crypto/sha256"
7
 	"crypto/sha256"
8
 	"encoding/binary"
8
 	"encoding/binary"
9
 	"io"
9
 	"io"
10
-	"math"
11
 	rnd "math/rand/v2"
10
 	rnd "math/rand/v2"
12
 
11
 
13
-	"github.com/9seconds/mtg/v2/mtglib/internal/doppel"
14
 	"github.com/9seconds/mtg/v2/mtglib/internal/tls"
12
 	"github.com/9seconds/mtg/v2/mtglib/internal/tls"
15
 	"golang.org/x/crypto/curve25519"
13
 	"golang.org/x/crypto/curve25519"
16
 )
14
 )
127
 }
125
 }
128
 
126
 
129
 func generateNoise(buf *bytes.Buffer) {
127
 func generateNoise(buf *bytes.Buffer) {
130
-	minSize := int(math.Round(0.75 * float64(doppel.TLSRecordSizeMax)))
131
-	data := make([]byte, minSize+rnd.IntN(doppel.TLSRecordSizeMax-minSize))
128
+	data := make([]byte, int64(1024+rnd.IntN(3092)))
132
 
129
 
133
 	if _, err := rand.Read(data[:]); err != nil {
130
 	if _, err := rand.Read(data[:]); err != nil {
134
 		panic(err)
131
 		panic(err)

Loading…
Cancelar
Guardar