From acf50a4f980690bea33092e509ca9236d4e23085 Mon Sep 17 00:00:00 2001 From: Michele Giacomoli Date: Mon, 19 Sep 2022 18:09:38 +0200 Subject: [PATCH 1/2] Flush stdin after fingerprint confirmation --- cli-kex.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cli-kex.c b/cli-kex.c index c3b8846dc..2824edcf2 100644 --- a/cli-kex.c +++ b/cli-kex.c @@ -229,6 +229,8 @@ static void ask_to_confirm(const unsigned char* keyblob, unsigned int keybloblen fclose(tty); } else { response = getc(stdin); + // flush stdin buffer + while ((getchar()) != '\n'); } if (response == 'y') { From b36707ba4660bdf6ea996476eb7225156bc27b51 Mon Sep 17 00:00:00 2001 From: Michele Giacomoli Date: Mon, 19 Sep 2022 18:25:26 +0200 Subject: [PATCH 2/2] Fix comment style --- cli-kex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli-kex.c b/cli-kex.c index 2824edcf2..6cb75c27b 100644 --- a/cli-kex.c +++ b/cli-kex.c @@ -229,7 +229,7 @@ static void ask_to_confirm(const unsigned char* keyblob, unsigned int keybloblen fclose(tty); } else { response = getc(stdin); - // flush stdin buffer + /* flush stdin buffer */ while ((getchar()) != '\n'); }