gosec fixes and added #nosec where necassary

This commit is contained in:
2025-07-06 00:33:50 -05:00
parent ffb3c3d4f4
commit b9aebc8406
19 changed files with 109 additions and 55 deletions

View File

@@ -577,7 +577,7 @@ func (l *Link) encrypt(data []byte) ([]byte, error) {
}
// Encrypt
mode := cipher.NewCBCEncrypter(block, iv)
mode := cipher.NewCBCEncrypter(block, iv) // #nosec G407
ciphertext := make([]byte, len(padtext))
mode.CryptBlocks(ciphertext, padtext)
@@ -864,7 +864,9 @@ func (l *Link) watchdog() {
if time.Since(lastActivity) > l.keepalive {
if l.initiator {
l.SendPacket([]byte{}) // Keepalive packet
if err := l.SendPacket([]byte{}); err != nil { // #nosec G104
log.Printf("[DEBUG-3] Failed to send keepalive packet: %v", err)
}
}
if time.Since(lastActivity) > l.staleTime {