mirror of
https://github.com/securego/gosec.git
synced 2024-11-05 19:45:51 +00:00
Added another test case in order to increase code coverage
This commit is contained in:
parent
a6dd589bae
commit
a14ca4ac59
1 changed files with 23 additions and 0 deletions
|
@ -31,6 +31,29 @@ import (
|
||||||
"fmt"
|
"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() {
|
func main() {
|
||||||
|
|
||||||
block, _ := aes.NewCipher([]byte{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1})
|
block, _ := aes.NewCipher([]byte{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1})
|
||||||
|
|
Loading…
Reference in a new issue