[plasma/ksshaskpass] /: Support unknown RSA when it has a colon
Kai Uwe Broulik <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit ea9cbf68120892b7b6955f872246be44ee741a19 by Kai Uwe Broulik.
Committed on 17/08/2026 at 14:09.
Pushed by broulik into branch 'master'.
Support unknown RSA when it has a colon
Apparently the prompt might include "key fingerprint is:" with a colon
BUG: 444862
M +8 -0 autotests/tst_prompt.cpp
M +1 -1 src/prompt.cpp
https://invent.kde.org/plasma/ksshaskpass/-/commit/ea9cbf68120892b7b6955f872246be44ee741a19
diff --git a/autotests/tst_prompt.cpp b/autotests/tst_prompt.cpp
index fa838a8..b7f3545 100644
--- a/autotests/tst_prompt.cpp
+++ b/autotests/tst_prompt.cpp
@@ -116,6 +116,14 @@ void PromptTest::testPrompt_data()
"This key is not known by any other names.\n"
"Are you sure you want to continue connecting (yes/no/[fingerprint])? ")
<< QString() << DisplayType::UnknownSshHost << true;
+
+ QTest::newRow("unknown-host-colon") << PromptType::Entry
+ << QStringLiteral(
+ "The authenticity of host 'invent.kde.org (1.2.3.4)' can't be established.\n"
+ "ED25519 key fingerprint is: SHA256:1234567890abcdef.\n"
+ "This key is not known by any other names.\n"
+ "Are you sure you want to continue connecting (yes/no/[fingerprint])? ")
+ << QString() << DisplayType::UnknownSshHost << true;
}
void PromptTest::testPrompt()
diff --git a/src/prompt.cpp b/src/prompt.cpp
index 2573768..a3b890f 100644
--- a/src/prompt.cpp
+++ b/src/prompt.cpp
@@ -178,7 +178,7 @@ void parsePrompt(PromptType promptType, const QString &prompt, QString &identifi
// Case: unknown SSH host
match = QRegularExpression(QStringLiteral("^The authenticity of host '([^']+)(?: \\(([^)]+)\\))?' can't be established\\.\n"
- "([A-Z0-9_-]+) key fingerprint is ([A-Za-z0-9:+/=]+)\\.\n"
+ "([A-Z0-9_-]+) key fingerprint is:? ([A-Za-z0-9:+/=]+)\\.\n"
"This key is not known by any other names\\.\n"
"Are you sure you want to continue connecting \\(yes/no/\\[fingerprint\\]\\)\\?\\s*$"))
.match(prompt);