From 635b362ca034a9fcac87b56369294a794558d5b0 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Wed, 23 Feb 2022 08:03:45 -0800 Subject: [PATCH] tcp: send error on fail --- src/tcp/tcp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tcp/tcp.go b/src/tcp/tcp.go index d271756b..51901670 100644 --- a/src/tcp/tcp.go +++ b/src/tcp/tcp.go @@ -226,7 +226,7 @@ func (s *server) clientCommunication(port string, c *comm.Comm) (room string, er } if strings.TrimSpace(string(passwordBytes)) != s.password { err = fmt.Errorf("bad password") - enc, _ := crypt.Decrypt([]byte(err.Error()), strongKeyForEncryption) + enc, _ := crypt.Encrypt([]byte(err.Error()), strongKeyForEncryption) if err := c.Send(enc); err != nil { return "", fmt.Errorf("send error: %w", err) }