From c0b930da056c7da5e68dde07780f67cbd55c73f1 Mon Sep 17 00:00:00 2001 From: Markus Stahl Date: Fri, 30 Aug 2024 17:27:14 +0200 Subject: [PATCH 1/3] set key length 2048 --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 5b857fc4f..962bdb749 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -30,7 +30,7 @@ jobs: sudo useradd -m testkey -s /bin/bash sudo -E su testkey -c "echo $'export PS1=\'\u@$HOSTNAME \W \$ \'' >> /home/testkey/.bashrc" sudo -E su testkey -c "mkdir -p /home/testkey/.ssh" - sudo -E su testkey -c "ssh-keygen -f /home/testkey/.ssh/id_rsa -t rsa -N ''" + sudo -E su testkey -c "ssh-keygen -f /home/testkey/.ssh/id_rsa -t rsa -b 2048 -N ''" sudo -E su testkey -c "cp /home/testkey/.ssh/id_rsa.pub /home/testkey/.ssh/authorized_keys" sudo -E su testkey -c "chmod 644 /home/testkey/.ssh/id_rsa" sudo -E su testkey -c "chmod 600 /home/testkey/.ssh/authorized_keys" From 9b8a390ff5a7c92ab16e76fafe489f87dbf5c742 Mon Sep 17 00:00:00 2001 From: Markus Stahl Date: Fri, 30 Aug 2024 17:39:07 +0200 Subject: [PATCH 2/3] error message is actually a feature --- atest/login.robot | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/atest/login.robot b/atest/login.robot index 6787f3483..527837d12 100644 --- a/atest/login.robot +++ b/atest/login.robot @@ -25,7 +25,9 @@ Login With Public Key When Valid Username And Key Login With Public Key ${KEY USERNAME} ${KEY} Login With Public Key When Invalid Username - Run Keyword And Expect Error Login with public key failed for user '${INVALID USERNAME}'. + [Documentation] A username that does not exist on the target machine leads to a rather misleading error message about key lengths. + ... See: https://github.com/fabric/fabric/issues/2182#issuecomment-1362940149 + Run Keyword And Expect Error ValueError: q must be exactly 160, 224, or 256 bits long ... Login With Public Key ${INVALID USERNAME} ${KEY} Login With Public Key When Invalid Key From 336ac8d680d90f4c72d983b0993b75ab32c54925 Mon Sep 17 00:00:00 2001 From: Markus Stahl Date: Fri, 30 Aug 2024 17:51:14 +0200 Subject: [PATCH 3/3] use valid username and invalid key for failed auth --- atest/connections.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atest/connections.robot b/atest/connections.robot index 7c0349a41..a3fedf0e8 100644 --- a/atest/connections.robot +++ b/atest/connections.robot @@ -119,7 +119,7 @@ Write In Teardown Should Not Hang If Auth Failed Write Bare In Teardown Should Not Hang If Auth Failed Open Connection ${HOST} - Run Keyword And Expect Error Login with public key failed* Login With Public Key invalid ${KEY} + Run Keyword And Expect Error Login with public key failed* Login With Public Key ${USERNAME} ${KEY}_invalid [Teardown] Run Keyword And Expect Error *Cannot open session, you need to establish a connection first. Write Bare ls Login With Agent