diff options
author | Yawning Angel <yawning@schwanenlied.me> | 2014-05-12 04:51:06 +0000 |
---|---|---|
committer | Yawning Angel <yawning@schwanenlied.me> | 2014-05-12 04:51:06 +0000 |
commit | 9712aec73b2b483a4426ca670ee208b44ad1bc25 (patch) | |
tree | 9f46805aa32166d627e8038ddfd308b2f078bf99 /utils.go | |
parent | 8a1f58cd5a1e2345b7321259c074c044a0ecbefd (diff) |
Preliminary support padding, log on panic.
This adds preliminary support for data padding by adding another layer
of encapsulation inside each AEAD frame containing a type and length.
For now, data is still sent unpadded, but the infrastructure for
supporting it is mostly there.
Additionally, use log.Panic[f]() instead of panic through out the code
so that some panics are logged.
Diffstat (limited to 'utils.go')
-rw-r--r-- | utils.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -29,13 +29,13 @@ package obfs4 import ( "crypto/rand" - "fmt" + "log" "math/big" ) func randRange(min, max int64) (int64, error) { if max < min { - panic(fmt.Sprintf("randRange: min > max (%d, %d)", min, max)) + log.Panicf("randRange: min > max (%d, %d)", min, max) } r := (max + 1) - min |