From b3f0f51775ae2e19c62c70e15f77ef991ad4bb49 Mon Sep 17 00:00:00 2001 From: Yawning Angel Date: Sat, 24 May 2014 04:47:10 +0000 Subject: Move utils.go to csrand/csrand.go, and clean up the interface. All of the obfs4 code except unit tests now uses the csrand wrapper routines. --- replay_filter.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'replay_filter.go') diff --git a/replay_filter.go b/replay_filter.go index 5e98b89..9556ef4 100644 --- a/replay_filter.go +++ b/replay_filter.go @@ -29,11 +29,12 @@ package obfs4 import ( "container/list" - "crypto/rand" "encoding/binary" "sync" "github.com/dchest/siphash" + + "github.com/yawning/obfs4/csrand" ) // maxFilterSize is the maximum capacity of the replay filter. The busiest @@ -63,7 +64,7 @@ type filterEntry struct { func newReplayFilter() (filter *replayFilter, err error) { // Initialize the SipHash-2-4 instance with a random key. var key [16]byte - _, err = rand.Read(key[:]) + err = csrand.Bytes(key[:]) if err != nil { return } -- cgit v1.2.3