From 2c19231cfebe00a9ba9428571ed7bd388acf8dcb Mon Sep 17 00:00:00 2001
From: kayrus <kay.diam@gmail.com>
Date: Mon, 12 Jul 2021 21:06:26 +0200
Subject: [PATCH] Properly check the key password requirement

---
 main.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/main.go b/main.go
index 978e942..d0fd7b9 100644
--- a/main.go
+++ b/main.go
@@ -91,7 +91,7 @@ var RootCmd = &cobra.Command{
 			// Parse the pem key
 			privateKey, err = ssh.ParseRawPrivateKey(key)
 			if err != nil {
-				if err.Error() != "ssh: no key found" {
+				if _, ok := err.(*ssh.PassphraseMissingError); ok {
 					// If the key is encrypted, decrypt it
 					pass, err := getKeyPass(quiet)
 					if err != nil {
-- 
GitLab