summaryrefslogtreecommitdiff
path: root/ntor
diff options
context:
space:
mode:
authorYawning Angel <yawning@schwanenlied.me>2014-05-12 23:04:39 +0000
committerYawning Angel <yawning@schwanenlied.me>2014-05-12 23:04:39 +0000
commit51a8dd5a86eeca744e0add680b1f4796c4babe2b (patch)
tree94fa1900ae3a230a23460df57151b618183b0b24 /ntor
parentc3acefb7e5aa5ef4cd65fc77ad4caa917efda130 (diff)
Fix logging again.
On second thought instead of using log.Panicf(), panic() and do the logging with recover(). This somewhat centralizes logging in obfs4proxy, which will be easier to change when I invariably decide to do logging differently in the future.
Diffstat (limited to 'ntor')
-rw-r--r--ntor/ntor.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/ntor/ntor.go b/ntor/ntor.go
index b19c4a1..9dbed7f 100644
--- a/ntor/ntor.go
+++ b/ntor/ntor.go
@@ -45,7 +45,6 @@ import (
"encoding/base64"
"fmt"
"io"
- "log"
"code.google.com/p/go.crypto/curve25519"
"code.google.com/p/go.crypto/hkdf"
@@ -422,9 +421,9 @@ func Kdf(keySeed []byte, okmLen int) []byte {
okm := make([]byte, okmLen)
n, err := io.ReadFull(kdf, okm)
if err != nil {
- log.Panicf("BUG: Failed HKDF: %s", err.Error())
+ panic(fmt.Sprintf("BUG: Failed HKDF: %s", err.Error()))
} else if n != len(okm) {
- log.Panicf("BUG: Got truncated HKDF output: %d", n)
+ panic(fmt.Sprintf("BUG: Got truncated HKDF output: %d", n))
}
return okm