Add error on missing ssh key

This commit is contained in:
Bernd Schoolmann 2024-04-05 08:06:43 +02:00
parent 1e1ec95fe3
commit e087ffa422
No known key found for this signature in database

View File

@ -110,6 +110,10 @@ func (vaultAgent vaultAgent) SignWithFlags(key ssh.PublicKey, data []byte, flags
}
}
if sshKey == nil {
return nil, errors.New("key not found")
}
isGit := false
magicHeader := []byte("SSHSIG\x00\x00\x00\x03git")
if bytes.HasPrefix(data, magicHeader) {