Skip to content

Commit 5be6003

Browse files
committed
Merge remote-tracking branch 'origin/pull/94'
* origin/pull/94: handle keyring returning ENOENT
2 parents 0eb7353 + 799365e commit 5be6003

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

cmd/ssh-tpm-agent/main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,11 @@ func main() {
259259
slog.Debug("providing cached userauth for key", slog.String("fp", key.Fingerprint()))
260260
// TODO: This is not great, but easier for now
261261
return auth.Read(), nil
262-
} else if errors.Is(err, syscall.ENOKEY) || errors.Is(err, syscall.EACCES) {
262+
} else if errors.Is(err, syscall.ENOKEY) || errors.Is(err, syscall.EACCES) || errors.Is(err, syscall.ENOENT) {
263+
if errors.Is(err, syscall.ENOENT) {
264+
slog.Warn("kernel is missing the keyctl executable helpers. Please install the keyutils package to use the agent with caching.")
265+
}
266+
263267
keyInfo := fmt.Sprintf("Enter passphrase for (%s): ", key.GetDescription())
264268
// TODOt kjk: askpass should box the byte slice
265269
userauth, err := askpass.ReadPassphrase(keyInfo, askpass.RP_USE_ASKPASS)

0 commit comments

Comments
 (0)