File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -468,7 +468,7 @@ func TestExportCertificate(t *testing.T) {
468468
469469 t .Run ("export to existing file" , func (t * testing.T ) {
470470 exportPath := filepath .Join (localTestingDir , "existing.pem" )
471- err := os .WriteFile (exportPath , []byte ("existing" ), 0644 )
471+ err := os .WriteFile (exportPath , []byte ("existing" ), 0600 )
472472 assert .Nil (err )
473473
474474 err = exportCertificate ("test" , exportPath )
Original file line number Diff line number Diff line change @@ -170,6 +170,7 @@ func TestDetectKeyType(t *testing.T) {
170170 assert := assert .New (t )
171171
172172 t .Run ("detect PKCS1 key" , func (t * testing.T ) {
173+ // #nosec G101 -- This is a test string, not actual credentials
173174 key := "-----BEGIN RSA PRIVATE KEY-----\n MIIEpAIBAAKCAQEA...\n -----END RSA PRIVATE KEY-----"
174175 keyType , err := detectKeyType (key )
175176 assert .Nil (err )
@@ -202,7 +203,7 @@ func TestDetectKeyType(t *testing.T) {
202203 // This will panic with index out of range due to missing PEM markers
203204 // The function should be improved to handle this case gracefully
204205 assert .Panics (func () {
205- detectKeyType (key )
206+ _ , _ = detectKeyType (key )
206207 })
207208 })
208209}
@@ -352,6 +353,7 @@ func TestGetUnlockedKeyring(t *testing.T) {
352353 })
353354
354355 t .Run ("unlock keyring with invalid key" , func (t * testing.T ) {
356+ // #nosec G101 -- This is a test string, not actual credentials
355357 invalidKey := "-----BEGIN PGP PRIVATE KEY BLOCK-----\n invalid\n -----END PGP PRIVATE KEY BLOCK-----"
356358 passphrase := []byte ("test" )
357359
You can’t perform that action at this time.
0 commit comments