Skip to content

Commit dc2e83f

Browse files
committed
Move to common.RandInt
1 parent 5988b43 commit dc2e83f

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

internal/server/TLS.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"errors"
66
"fmt"
77
"io"
8-
"math/rand"
98
"net"
109

1110
"github.com/cbeuw/Cloak/internal/common"
@@ -46,8 +45,7 @@ func (TLS) makeResponder(clientHelloSessionId []byte, sharedSecret [32]byte) Res
4645
// the cert length needs to be the same for all handshakes belonging to the same session
4746
// we can use sessionKey as a seed here to ensure consistency
4847
possibleCertLengths := []int{42, 27, 68, 59, 36, 44, 46}
49-
rand.Seed(int64(sessionKey[0]))
50-
cert := make([]byte, possibleCertLengths[rand.Intn(len(possibleCertLengths))])
48+
cert := make([]byte, possibleCertLengths[common.RandInt(len(possibleCertLengths))])
5149
common.RandRead(randSource, cert)
5250

5351
var nonce [12]byte

0 commit comments

Comments
 (0)