summaryrefslogtreecommitdiff
path: root/obfs4proxy
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 /obfs4proxy
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 'obfs4proxy')
-rw-r--r--obfs4proxy/obfs4proxy.go20
1 files changed, 16 insertions, 4 deletions
diff --git a/obfs4proxy/obfs4proxy.go b/obfs4proxy/obfs4proxy.go
index e4a7a35..02873b9 100644
--- a/obfs4proxy/obfs4proxy.go
+++ b/obfs4proxy/obfs4proxy.go
@@ -31,7 +31,7 @@
//
// Client usage (in torrc):
// UseBridges 1
-// Bridge obfs4 X.X.X.X:YYYY public-key=<Base64 Bridge public key> node-id=<Base64 Bridge Node ID>
+// Bridge obfs4 X.X.X.X:YYYY <fingerprint> public-key=<Base64 Bridge public key> node-id=<Base64 Bridge Node ID>
// ClientTransportPlugin obfs4 exec obfs4proxy
//
// Server usage (in torrc):
@@ -176,10 +176,15 @@ func serverSetup() bool {
pt.SmethodError(bindaddr.MethodName, "needs a node-id option")
break
}
+ seed, ok := bindaddr.Options.Get("drbg-seed")
+ if !ok {
+ pt.SmethodError(bindaddr.MethodName, "needs a drbg-seed option")
+ break
+ }
// Initialize the listener.
ln, err := obfs4.Listen("tcp", bindaddr.Addr.String(), nodeID,
- privateKey)
+ privateKey, seed)
if err != nil {
pt.SmethodError(bindaddr.MethodName, err.Error())
break
@@ -345,16 +350,23 @@ func generateServerParams(id string) {
return
}
+ seed, err := obfs4.NewDrbgSeed()
+ if err != nil {
+ fmt.Println("Failed to generate DRBG seed:", err)
+ return
+ }
+
fmt.Println("Generated private-key:", keypair.Private().Base64())
fmt.Println("Generated public-key:", keypair.Public().Base64())
+ fmt.Println("Generated drbg-seed:", seed.Base64())
fmt.Println()
fmt.Println("Client config: ")
fmt.Printf(" Bridge obfs4 <IP Address:Port> %s node-id=%s public-key=%s\n",
id, parsedID.Base64(), keypair.Public().Base64())
fmt.Println()
fmt.Println("Server config:")
- fmt.Printf(" ServerTransportOptions obfs4 node-id=%s private-key=%s\n",
- parsedID.Base64(), keypair.Private().Base64())
+ fmt.Printf(" ServerTransportOptions obfs4 node-id=%s private-key=%s drbg-seed=%s\n",
+ parsedID.Base64(), keypair.Private().Base64(), seed.Base64())
}
func main() {