mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2024-09-11 21:17:40 +03:00
Use crypto_rand() everywhere
This commit is contained in:
parent
24a301b1af
commit
03c6f92a5f
@ -5,7 +5,6 @@
|
||||
crypto_rand "crypto/rand"
|
||||
"crypto/sha512"
|
||||
"errors"
|
||||
"math/rand"
|
||||
|
||||
"github.com/jedisct1/dlog"
|
||||
"github.com/jedisct1/xsecretbox"
|
||||
@ -102,7 +101,7 @@ func (proxy *Proxy) Encrypt(
|
||||
minQuestionSize = Max(proxy.questionSizeEstimator.MinQuestionSize(), minQuestionSize)
|
||||
} else {
|
||||
var xpad [1]byte
|
||||
rand.Read(xpad[:])
|
||||
crypto_rand.Read(xpad[:])
|
||||
minQuestionSize += int(xpad[0])
|
||||
}
|
||||
paddedLength := Min(MaxDNSUDPPacketSize, (Max(minQuestionSize, QueryOverhead)+1+63) & ^63)
|
||||
|
Loading…
Reference in New Issue
Block a user