summaryrefslogtreecommitdiff
path: root/obfs4.go
diff options
context:
space:
mode:
authorYawning Angel <yawning@schwanenlied.me>2014-05-15 19:08:03 +0000
committerYawning Angel <yawning@schwanenlied.me>2014-05-15 19:08:03 +0000
commit6f875c99a9047d8a04a9ac2db9c6305dee3e2901 (patch)
treebcf25fc6f780c5138f800cb194b32c5e7229bc59 /obfs4.go
parentf1b1dcdb106c00fef1acffe04caaeabb3a34239b (diff)
Load the drbg-seed from the ServerTransportOptions args.
This also adds the drgb-seed option to the `-gen` obfs4proxy output.
Diffstat (limited to 'obfs4.go')
-rw-r--r--obfs4.go11
1 files changed, 4 insertions, 7 deletions
diff --git a/obfs4.go b/obfs4.go
index d3dfc38..17f8b3c 100644
--- a/obfs4.go
+++ b/obfs4.go
@@ -468,7 +468,7 @@ func Dial(network, address, nodeID, publicKey string) (net.Conn, error) {
}
// Generate the initial length obfuscation distribution.
- seed, err := newRandomDrbgSeed()
+ seed, err := NewDrbgSeed()
if err != nil {
return nil, err
}
@@ -498,7 +498,7 @@ type Obfs4Listener struct {
keyPair *ntor.Keypair
nodeID *ntor.NodeID
- seed *drbgSeed
+ seed *DrbgSeed
}
func (l *Obfs4Listener) Accept() (net.Conn, error) {
@@ -538,7 +538,7 @@ func (l *Obfs4Listener) PublicKey() string {
return l.keyPair.Public().Base64()
}
-func Listen(network, laddr, nodeID, privateKey string) (net.Listener, error) {
+func Listen(network, laddr, nodeID, privateKey, seed string) (net.Listener, error) {
var err error
// Decode node_id/private_key.
@@ -551,10 +551,7 @@ func Listen(network, laddr, nodeID, privateKey string) (net.Listener, error) {
if err != nil {
return nil, err
}
-
- // Generate the initial length obfuscation distribution.
- // XXX: Load this from args.
- l.seed, err = newRandomDrbgSeed()
+ l.seed, err = DrbgSeedFromBase64(seed)
if err != nil {
return nil, err
}