From cac5952847e561b1278538d041eb8db5fd8db8a4 Mon Sep 17 00:00:00 2001 From: Mikkel Krautz Date: Sat, 15 Oct 2016 19:06:05 +0200 Subject: [PATCH] Fix a few typos in pkg/cryptstate. Thanks to @GEverding for mentioning this in mumble-voip/grumble#9 --- pkg/cryptstate/cryptstate.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cryptstate/cryptstate.go b/pkg/cryptstate/cryptstate.go index b2f2d15..3ce84a0 100644 --- a/pkg/cryptstate/cryptstate.go +++ b/pkg/cryptstate/cryptstate.go @@ -194,7 +194,7 @@ func (cs *CryptState) Decrypt(dst, src []byte) error { return errors.New("cryptstate: no matching ivbyte") } - if cs.decryptHistory[cs.DecryptIV[0]] == cs.DecryptIV[0] { + if cs.decryptHistory[cs.DecryptIV[0]] == cs.DecryptIV[1] { cs.DecryptIV = saveiv } } @@ -205,7 +205,7 @@ func (cs *CryptState) Decrypt(dst, src []byte) error { return errors.New("cryptstate: tag mismatch") } - cs.decryptHistory[cs.DecryptIV[0]] = cs.DecryptIV[0] + cs.decryptHistory[cs.DecryptIV[0]] = cs.DecryptIV[1] if restore { cs.DecryptIV = saveiv