aboutsummaryrefslogblamecommitdiffstats
path: root/community/gitea/fix-tests-ssh-hostkeys.patch
blob: 69f28d1c5d1da8f9f5008fd724d5f45c93685b6b (plain) (tree)
1
2
3
4
5
6
7
8
9








                                                                      
                                                                                                              
                                 




                                                                                           
                                                                            
                                                                                                                                                     
                                                                                                                                                                                                                                 









                                                                                                                                                                                               


      
From 0ee335c74b16afa30c50f0f0a7cea4946f512334 Mon Sep 17 00:00:00 2001
From: 6543 <6543@obermui.de>
Date: Sun, 6 Feb 2022 19:57:13 +0100
Subject: [PATCH] fix tests ssh hostkeys

---
 integrations/git_helper_for_declarative_test.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/integrations/git_helper_for_declarative_test.go b/integrations/git_helper_for_declarative_test.go
index 05a3e8777..6d3c52ec8 100644
--- a/integrations/git_helper_for_declarative_test.go
+++ b/integrations/git_helper_for_declarative_test.go
@@ -40,13 +40,13 @@ func withKeyFile(t *testing.T, keyname string, callback func(string)) {
 	assert.NoError(t, err)
 
 	err = os.WriteFile(path.Join(tmpDir, "ssh"), []byte("#!/bin/bash\n"+
-		"ssh -o \"UserKnownHostsFile=/dev/null\" -o \"StrictHostKeyChecking=no\" -o \"IdentitiesOnly=yes\" -i \""+keyFile+"\" \"$@\""), 0700)
+		"ssh -o \"UserKnownHostsFile=/dev/null\" -o \"StrictHostKeyChecking=no\" -o \"HostkeyAlgorithms=+ssh-rsa\" -o \"PubkeyAcceptedAlgorithms=+ssh-rsa\" -o \"IdentitiesOnly=yes\" -i \""+keyFile+"\" \"$@\""), 0o700)
 	assert.NoError(t, err)
 
 	//Setup ssh wrapper
 	os.Setenv("GIT_SSH", path.Join(tmpDir, "ssh"))
 	os.Setenv("GIT_SSH_COMMAND",
-		"ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -i \""+keyFile+"\"")
+		"ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -o  HostkeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa -i \""+keyFile+"\"")
 	os.Setenv("GIT_SSH_VARIANT", "ssh")
 
 	callback(keyFile)
-- 
2.35.1