From a38f93bf06beb06952847953b8f8380f56552439 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Thu, 1 May 2014 10:36:41 -0500 Subject: [PATCH] use fastsha256 in rpcwebsocket.go. While this is not performance critical code, there is no need to import another package into the final binary. --- rpcwebsocket.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpcwebsocket.go b/rpcwebsocket.go index 3e71991c..b78e0371 100644 --- a/rpcwebsocket.go +++ b/rpcwebsocket.go @@ -9,7 +9,6 @@ import ( "code.google.com/p/go.crypto/ripemd160" "code.google.com/p/go.net/websocket" "container/list" - "crypto/sha256" "crypto/subtle" "encoding/base64" "encoding/hex" @@ -21,6 +20,7 @@ import ( "github.com/conformal/btcutil" "github.com/conformal/btcwire" "github.com/conformal/btcws" + "github.com/conformal/fastsha256" "io" "sync" "time" @@ -942,7 +942,7 @@ func (c *wsClient) handleMessage(msg string) { // Check credentials. login := authCmd.Username + ":" + authCmd.Passphrase auth := "Basic " + base64.StdEncoding.EncodeToString([]byte(login)) - authSha := sha256.Sum256([]byte(auth)) + authSha := fastsha256.Sum256([]byte(auth)) cmp := subtle.ConstantTimeCompare(authSha[:], c.server.authsha[:]) if cmp != 1 { rpcsLog.Warnf("Auth failure.")