summaryrefslogtreecommitdiff
path: root/ntor/ntor.go
diff options
context:
space:
mode:
authorYawning Angel <yawning@schwanenlied.me>2014-05-24 04:47:10 +0000
committerYawning Angel <yawning@schwanenlied.me>2014-05-24 04:47:10 +0000
commitb3f0f51775ae2e19c62c70e15f77ef991ad4bb49 (patch)
tree0a779fe20ffead1e8a87ba209ac566829c7ce93a /ntor/ntor.go
parente77ddddf4d10dbd3387c2e4714c287c546c70512 (diff)
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.
Diffstat (limited to 'ntor/ntor.go')
-rw-r--r--ntor/ntor.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/ntor/ntor.go b/ntor/ntor.go
index eecf038..4483a6b 100644
--- a/ntor/ntor.go
+++ b/ntor/ntor.go
@@ -39,7 +39,6 @@ package ntor
import (
"bytes"
"crypto/hmac"
- "crypto/rand"
"crypto/sha256"
"crypto/subtle"
"encoding/base64"
@@ -50,6 +49,8 @@ import (
"code.google.com/p/go.crypto/hkdf"
"github.com/agl/ed25519/extra25519"
+
+ "github.com/yawning/obfs4/csrand"
)
const (
@@ -266,7 +267,7 @@ func NewKeypair(elligator bool) (*Keypair, error) {
// Generate a Curve25519 private key. Like everyone who does this,
// run the CSPRNG output through SHA256 for extra tinfoil hattery.
priv := keypair.private.Bytes()[:]
- _, err := rand.Read(priv)
+ err := csrand.Bytes(priv)
if err != nil {
return nil, err
}