summaryrefslogtreecommitdiff
path: root/transports/obfs4/obfs4.go
diff options
context:
space:
mode:
authorYawning Angel <yawning@torproject.org>2014-08-23 05:33:23 +0000
committerYawning Angel <yawning@torproject.org>2014-08-23 05:33:23 +0000
commit1e574942d586bb26f659f9ebee9ec90d778ecb97 (patch)
tree57fc5d280550da67d710c1dd0a3740a6274f73d0 /transports/obfs4/obfs4.go
parent596cc8507340a1233defe5bf88e6e2a400cc7f9f (diff)
Change all the arguments to use base16 from base64.
WARNING: THIS BREAKS BACKWARD COMPATIBILITY. This is primarily to work around bug #12930. Base16 was chosen over unpadded Base64 because the go runtime Base64 decoder does not handle omitting the padding. May $deity have mercy on anyone who needs to hand-enter an obfs4 bridge line because I will not.
Diffstat (limited to 'transports/obfs4/obfs4.go')
-rw-r--r--transports/obfs4/obfs4.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/transports/obfs4/obfs4.go b/transports/obfs4/obfs4.go
index fbfea27..f9b02ad 100644
--- a/transports/obfs4/obfs4.go
+++ b/transports/obfs4/obfs4.go
@@ -117,8 +117,8 @@ func (t *Transport) ServerFactory(stateDir string, args *pt.Args) (base.ServerFa
// Store the arguments that should appear in our descriptor for the clients.
ptArgs := pt.Args{}
- ptArgs.Add(nodeIDArg, st.nodeID.Base64())
- ptArgs.Add(publicKeyArg, st.identityKey.Public().Base64())
+ ptArgs.Add(nodeIDArg, st.nodeID.Hex())
+ ptArgs.Add(publicKeyArg, st.identityKey.Public().Hex())
// Initialize the replay filter.
filter, err := replayfilter.New(replayTTL)
@@ -154,7 +154,7 @@ func (cf *obfs4ClientFactory) ParseArgs(args *pt.Args) (interface{}, error) {
return nil, fmt.Errorf("missing argument '%s'", nodeIDArg)
}
var nodeID *ntor.NodeID
- if nodeID, err = ntor.NodeIDFromBase64(nodeIDStr); err != nil {
+ if nodeID, err = ntor.NodeIDFromHex(nodeIDStr); err != nil {
return nil, err
}
@@ -163,7 +163,7 @@ func (cf *obfs4ClientFactory) ParseArgs(args *pt.Args) (interface{}, error) {
return nil, fmt.Errorf("missing argument '%s'", publicKeyArg)
}
var publicKey *ntor.PublicKey
- if publicKey, err = ntor.PublicKeyFromBase64(publicKeyStr); err != nil {
+ if publicKey, err = ntor.PublicKeyFromHex(publicKeyStr); err != nil {
return nil, err
}