Skip to content

Commit f70dd51

Browse files
jellymartinpitt
authored andcommitted
cockpit: adjust key fingerprint matching for openssh-10.2p1
The regex adjustment in 93122ef wasn't enough, it matches to broadly for openssh-10.2p1 as the host key no longer ends with an dot but with an newline. New prompt: ``` ED25519 key fingerprint is: SHA256:xD6UcDvVDpRNIKew3CVJtajlPujToVumgISXdunBUfY This key is not known by any other names. ``` Old prompt: ``` ED25519 key fingerprint is SHA256:YDOcdZxLSmDEM2xGgyAs5lFUbUXK2F8zi0yRbpiA2oo. This key is not known by any other names. ```
1 parent a45ce20 commit f70dd51

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/cockpit/beiboot.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,10 @@ async def do_askpass(self, messages: str, prompt: str, hint: str) -> Optional[st
171171

172172
# FIXME: is this a host key prompt? This should be handled more elegantly,
173173
# see https://github.com/cockpit-project/cockpit/pull/19668
174-
fp_match = re.search(r'\n(\w+) key fingerprint is:? ([^.]+)\.', prompt)
174+
# Since openssh 10.2p1-1 the host key prompt changed:
175+
# - now includes a colon after "key fingerprint is"
176+
# - does not end on a dot but a newline (likely for easier copy-pasting
177+
fp_match = re.search(r'\n(\w+) key fingerprint is:? ([^.\n]+)', prompt)
175178
# let ssh resolve aliases, don't use our original "destination"
176179
host_match = re.search(r"authenticity of host '([^ ]+) ", prompt)
177180
args = {}

0 commit comments

Comments
 (0)