diff options
author | Yawning Angel <yawning@schwanenlied.me> | 2014-05-15 19:08:03 +0000 |
---|---|---|
committer | Yawning Angel <yawning@schwanenlied.me> | 2014-05-15 19:08:03 +0000 |
commit | 6f875c99a9047d8a04a9ac2db9c6305dee3e2901 (patch) | |
tree | bcf25fc6f780c5138f800cb194b32c5e7229bc59 /obfs4.go | |
parent | f1b1dcdb106c00fef1acffe04caaeabb3a34239b (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.go | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -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 } |