diff --git a/cross_language_tests/aes_cross_test.go b/cross_language_tests/aes_cross_test.go index ed449ee..296e053 100644 --- a/cross_language_tests/aes_cross_test.go +++ b/cross_language_tests/aes_cross_test.go @@ -40,7 +40,7 @@ func TestAesRuby(t *testing.T) { {AuthData: mkrand(t, 32), Plaintext: mkrand(t, 1024)}, } - //#nosec G306 -- Need readable files + // #nosec G306 -- Need readable files for _, tt := range tests { tt := tt t.Run("", func(t *testing.T) { @@ -60,7 +60,7 @@ func TestAesRuby(t *testing.T) { b, err := msgpack.Marshal(tt) require.NoError(t, err) - //#nosec G306 -- Need readable files + // #nosec G306 -- Need readable files require.NoError(t, os.WriteFile(testfile, []byte(base64.StdEncoding.EncodeToString(b)), 0644)) }) diff --git a/cross_language_tests/boxer_cross_test.go b/cross_language_tests/boxer_cross_test.go index 058d32d..e1bc9a8 100644 --- a/cross_language_tests/boxer_cross_test.go +++ b/cross_language_tests/boxer_cross_test.go @@ -70,7 +70,7 @@ func TestBoxerRuby(t *testing.T) { } // Ruby Decrypt Tests - //#nosec G306 -- Need readable files + // #nosec G306 -- Need readable files for _, message := range testMessages { message := message @@ -93,7 +93,7 @@ func TestBoxerRuby(t *testing.T) { b, err := msgpack.Marshal(rubyCommand) require.NoError(t, err) - //#nosec G306 -- Need readable files + // #nosec G306 -- Need readable files require.NoError(t, os.WriteFile(rubyInFile, []byte(base64.StdEncoding.EncodeToString(b)), 0644)) ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second) @@ -161,7 +161,7 @@ func TestBoxerRuby(t *testing.T) { var png bytes.Buffer pngFile := path.Join(dir, ulid.New()+".png") require.NoError(t, aliceBoxer.EncodePng(responseTo, message, &png)) - //#nosec G306 -- Need readable files + // #nosec G306 -- Need readable files require.NoError(t, os.WriteFile(pngFile, png.Bytes(), 0644)) tests := []boxerCrossTestCase{ @@ -202,13 +202,13 @@ func TestBoxerRuby(t *testing.T) { // b, err := msgpack.Marshal(tt) require.NoError(t, err) - //#nosec G306 -- Need readable files + // #nosec G306 -- Need readable files require.NoError(t, os.WriteFile(testfile, []byte(base64.StdEncoding.EncodeToString(b)), 0644)) ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second) defer cancel() - //#nosec G204 -- No taint on hardcoded input + // #nosec G204 -- No taint on hardcoded input cmd := exec.CommandContext(ctx, "ruby", boxerRB, tt.cmd, testfile, rubyout) out, err := cmd.CombinedOutput() @@ -384,7 +384,7 @@ func TestBoxerMaxSize(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second) defer cancel() - //#nosec G204 -- No taint on hardcoded input + // #nosec G204 -- No taint on hardcoded input cmd := exec.CommandContext(ctx, "ruby", boxerRB, tt.cmd, testfile, rubyout) out, err := cmd.CombinedOutput() diff --git a/cross_language_tests/rsa_cross_test.go b/cross_language_tests/rsa_cross_test.go index c85b701..cf32839 100644 --- a/cross_language_tests/rsa_cross_test.go +++ b/cross_language_tests/rsa_cross_test.go @@ -37,7 +37,7 @@ func TestRsaRuby(t *testing.T) { {Plaintext: mkrand(t, 128)}, } - //#nosec G306 -- Need readable files + // #nosec G306 -- Need readable files for _, tt := range tests { tt := tt t.Run("", func(t *testing.T) { diff --git a/rsa.go b/rsa.go index b7fe4bd..fe9c0fc 100644 --- a/rsa.go +++ b/rsa.go @@ -4,7 +4,7 @@ import ( "crypto" "crypto/rand" "crypto/rsa" - "crypto/sha1" //#nosec G505 -- Need compatibility + "crypto/sha1" // #nosec G505 -- Need compatibility "crypto/sha256" "crypto/x509" "encoding/pem" @@ -18,7 +18,7 @@ func RsaEncrypt(key *rsa.PublicKey, secretMessage []byte) ([]byte, error) { return nil, errors.New("Cannot encrypt with a nil key") } - //#nosec G401 -- Need compatibility + // #nosec G401 -- Need compatibility return rsa.EncryptOAEP(sha1.New(), rand.Reader, key, secretMessage, nil) } @@ -27,7 +27,7 @@ func RsaDecrypt(key *rsa.PrivateKey, ciphertext []byte) ([]byte, error) { return nil, errors.New("Cannot decrypt with a nil key") } - //#nosec G401 -- Need compatibility + // #nosec G401 -- Need compatibility return rsa.DecryptOAEP(sha1.New(), rand.Reader, key, ciphertext, nil) }