From 27d98b6a5e571befdb09a32c6504e20c079b2fbe Mon Sep 17 00:00:00 2001 From: Pontus Freyhult Date: Thu, 7 Mar 2024 08:51:15 +0100 Subject: [PATCH] Linter fixes --- model/headers/headers.go | 1 + model/headers/headers_test.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/model/headers/headers.go b/model/headers/headers.go index 6cbadc7..3558965 100644 --- a/model/headers/headers.go +++ b/model/headers/headers.go @@ -282,6 +282,7 @@ func EncryptedSegmentSize(header []byte, readerPrivateKey [chacha20poly1305.KeyS return 0, fmt.Errorf("different data encryption methods are not supported") } } + return firstDataEncryptionParametersHeader.EncryptedSegmentSize, nil } diff --git a/model/headers/headers_test.go b/model/headers/headers_test.go index 3bde2f7..0ba973c 100644 --- a/model/headers/headers_test.go +++ b/model/headers/headers_test.go @@ -322,12 +322,12 @@ func TestEncryptedSegmentSize(t *testing.T) { t.Errorf("EncryptedSegmentSize returned unexpected size %d (expected 65564)", size) } - size, err = EncryptedSegmentSize(header, ([32]byte)(make([]byte, 32))) + _, err = EncryptedSegmentSize(header, ([32]byte)(make([]byte, 32))) if err == nil { t.Errorf("EncryptedSegmentSize worked where it should fail: %v", err) } - size, err = EncryptedSegmentSize(make([]byte, 2), readerSecretKey) + _, err = EncryptedSegmentSize(make([]byte, 2), readerSecretKey) if err == nil { t.Errorf("EncryptedSegmentSize worked where it should fail: %v", err) }