|
|
@@ -7,10 +7,8 @@ import (
|
|
7
|
7
|
"crypto/sha256"
|
|
8
|
8
|
"encoding/binary"
|
|
9
|
9
|
"io"
|
|
10
|
|
- "math"
|
|
11
|
10
|
rnd "math/rand/v2"
|
|
12
|
11
|
|
|
13
|
|
- "github.com/9seconds/mtg/v2/mtglib/internal/doppel"
|
|
14
|
12
|
"github.com/9seconds/mtg/v2/mtglib/internal/tls"
|
|
15
|
13
|
"golang.org/x/crypto/curve25519"
|
|
16
|
14
|
)
|
|
|
@@ -127,8 +125,7 @@ func generateChangeCipherValue(buf *bytes.Buffer) {
|
|
127
|
125
|
}
|
|
128
|
126
|
|
|
129
|
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
|
130
|
if _, err := rand.Read(data[:]); err != nil {
|
|
134
|
131
|
panic(err)
|