]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Test hostbased auth on github runners.
authorDarren Tucker <dtucker@dtucker.net>
Wed, 10 Aug 2022 07:35:52 +0000 (17:35 +1000)
committerDarren Tucker <dtucker@dtucker.net>
Wed, 10 Aug 2022 07:37:58 +0000 (17:37 +1000)
.github/run_test.sh
.github/workflows/c-cpp.yml

index adf2568ad1e254afd553b83f5198efa379db0868..7ea216b8c08181b1798d8c543237ce329875e237 100755 (executable)
@@ -6,6 +6,20 @@
 
 set -ex
 
+# If we want to test hostbased auth, set up the host for it.
+if [ ! -z "$SUDO" ] && [ ! -x "$TEST_SSH_HOSTBASED_AUTH" ]; then
+    sshconf=/usr/local/etc
+    hostname | $SUDO tee $sshconf/shosts.equiv >/dev/null
+    echo "EnableSSHKeysign yes" | $SUDO tee $sshconf/ssh_config >/dev/null
+    $SUDO mkdir -p $sshconf
+    $SUDO cp -p /etc/ssh/ssh_host*key* $sshconf
+    $SUDO make install
+    for key in $sshconf/ssh_host*key*.pub; do
+        echo `hostname` `cat $key` | \
+            $SUDO tee -a $sshconf/ssh_known_hosts >/dev/null
+    done
+fi
+
 output_failed_logs() {
     for i in regress/failed*; do
         if [ -f "$i" ]; then
index 8f6bd75e4d4811905b636d411ceb817e138d0bd1..0ff56f03c3570494fee0fb2d2f5e603deb62cc1b 100644 (file)
@@ -99,6 +99,7 @@ jobs:
       run: ./.github/run_test.sh ${{ matrix.configs }}
       env:
         TEST_SSH_UNSAFE_PERMISSIONS: 1
+        TEST_SSH_HOSTBASED_AUTH: yes
     - name: save logs
       if: failure()
       uses: actions/upload-artifact@v2