From a14ca4ac59d9b519d1b195afe6098ff13d574d32 Mon Sep 17 00:00:00 2001 From: Dimitar Banchev Date: Fri, 30 Aug 2024 12:08:26 +0200 Subject: [PATCH] Added another test case in order to increase code coverage --- testutils/g407_samples.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/testutils/g407_samples.go b/testutils/g407_samples.go index 85054bb..461fa7c 100644 --- a/testutils/g407_samples.go +++ b/testutils/g407_samples.go @@ -31,6 +31,29 @@ import ( "fmt" ) +func encrypt(nonce []byte) { + block, _ := aes.NewCipher([]byte{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}) + aesOFB := cipher.NewOFB(block, nonce) + var output = make([]byte, 16) + aesOFB.XORKeyStream(output, []byte("Very Cool thing!")) + fmt.Println(string(output)) +} + +func main() { + + var nonce = []byte("ILoveMyNonceAlot") + encrypt(nonce) +} +`}, 1, gosec.NewConfig()}, + + {[]string{`package main + +import ( + "crypto/aes" + "crypto/cipher" + "fmt" +) + func main() { block, _ := aes.NewCipher([]byte{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1})