summaryrefslogtreecommitdiff
path: root/utils.go
diff options
context:
space:
mode:
authorYawning Angel <yawning@schwanenlied.me>2014-05-12 04:51:06 +0000
committerYawning Angel <yawning@schwanenlied.me>2014-05-12 04:51:06 +0000
commit9712aec73b2b483a4426ca670ee208b44ad1bc25 (patch)
tree9f46805aa32166d627e8038ddfd308b2f078bf99 /utils.go
parent8a1f58cd5a1e2345b7321259c074c044a0ecbefd (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.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils.go b/utils.go
index ae7bc41..f8a394a 100644
--- a/utils.go
+++ b/utils.go
@@ -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