Add error on missing ssh key
This commit is contained in:
parent
1e1ec95fe3
commit
e087ffa422
1 changed files with 4 additions and 0 deletions
|
|
@ -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
|
isGit := false
|
||||||
magicHeader := []byte("SSHSIG\x00\x00\x00\x03git")
|
magicHeader := []byte("SSHSIG\x00\x00\x00\x03git")
|
||||||
if bytes.HasPrefix(data, magicHeader) {
|
if bytes.HasPrefix(data, magicHeader) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue