From 29f7adb6563ddec6365dd7d753b1e85fea1168c5 Mon Sep 17 00:00:00 2001 From: Morten Linderud Date: Fri, 9 Aug 2024 00:07:16 +0200 Subject: [PATCH] ssh-tpm-add: ensure we can add keys Signed-off-by: Morten Linderud --- cmd/ssh-tpm-add/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/ssh-tpm-add/main.go b/cmd/ssh-tpm-add/main.go index 3c3c35a..b79003c 100644 --- a/cmd/ssh-tpm-add/main.go +++ b/cmd/ssh-tpm-add/main.go @@ -47,7 +47,7 @@ func main() { flag.StringVar(&user, "user", "", "remote ssh user") flag.Parse() - if (caURL == "" || host == "" || user == "") || len(os.Args) == 1 { + if (caURL == "" || host == "" || user == "") && len(os.Args) == 1 { fmt.Println(usage) return } @@ -89,7 +89,7 @@ func main() { fmt.Printf("Identity added from CA authority: %s\n", caURL) } - if len(os.Args) == 1 { + if len(os.Args) != 1 { path := os.Args[1] b, err := os.ReadFile(path)