From ea01123b87ec70cd056a2927cbcdc7ba2b5c7a98 Mon Sep 17 00:00:00 2001 From: Russ Magee Date: Wed, 12 Dec 2018 00:34:23 -0800 Subject: [PATCH] GoReporter recommended cleanup --- hkexnet/hkexnet.go | 4 ++-- hkexsh/hkexsh.go | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hkexnet/hkexnet.go b/hkexnet/hkexnet.go index 776d90e..4d86971 100644 --- a/hkexnet/hkexnet.go +++ b/hkexnet/hkexnet.go @@ -285,7 +285,7 @@ func (r randReader) Read(b []byte) (n int, e error) { return } -func KyberDialSetup(c net.Conn, hc *Conn) (err error) { +func KyberDialSetup(c io.ReadWriter /*net.Conn*/, hc *Conn) (err error) { // Send hkexnet.Conn parameters to remote side // Alice, step 1: Generate a key pair. @@ -335,7 +335,7 @@ func KyberDialSetup(c net.Conn, hc *Conn) (err error) { return } -func HKExDialSetup(c net.Conn, hc *Conn) (err error) { +func HKExDialSetup(c io.ReadWriter /*net.Conn*/, hc *Conn) (err error) { var h *hkex.HerraduraKEx switch hc.kex { case KEX_HERRADURA256: diff --git a/hkexsh/hkexsh.go b/hkexsh/hkexsh.go index ff1ef01..366f0cb 100755 --- a/hkexsh/hkexsh.go +++ b/hkexsh/hkexsh.go @@ -43,7 +43,7 @@ var ( //////////////////////////////////////////////////// -const Bob = string("\r\n\r\n" + +const bob = string("\r\n\r\n" + "@@@@@@@^^~~~~~~~~~~~~~~~~~~~~^@@@@@@@@@\r\n" + "@@@@@@^ ~^ @ @@ @ @ @ I ~^@@@@@@\r\n" + "@@@@@ ~ ~~ ~I @@@@@\r\n" + @@ -70,8 +70,8 @@ const Bob = string("\r\n\r\n" + "\r\n") type ( - EscHandler func(io.Writer) - EscSeqs map[byte]EscHandler + escHandler func(io.Writer) + escSeqs map[byte]escHandler ) // Copy copies from src to dst until either EOF is reached @@ -117,10 +117,10 @@ func copyBuffer(dst io.Writer, src io.Reader, buf []byte) (written int64, err er // outlive individual copyBuffer calls). // (Note that since this custom copyBuffer func is used only by // the hkexsh client, it should eventually be moved to client.) - escs := EscSeqs{ + escs := escSeqs{ 'i': func(io.Writer) { os.Stdout.Write([]byte("\x1b[s\x1b[2;1H\x1b[1;31m[HKEXSH]\x1b[39;49m\x1b[u")) }, 't': func(io.Writer) { os.Stdout.Write([]byte("\x1b[1;32m[HKEXSH]\x1b[39;49m")) }, - 'B': func(io.Writer) { os.Stdout.Write([]byte("\x1b[1;32m" + Bob + "\x1b[39;49m")) }, + 'B': func(io.Writer) { os.Stdout.Write([]byte("\x1b[1;32m" + bob + "\x1b[39;49m")) }, } /*