From 51a8dd5a86eeca744e0add680b1f4796c4babe2b Mon Sep 17 00:00:00 2001 From: Yawning Angel Date: Mon, 12 May 2014 23:04:39 +0000 Subject: 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. --- ntor/ntor.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'ntor') 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 -- cgit v1.2.3