From bf8756d6a2c42dc77b8a2de814a12e2ceb4487fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Mon, 15 Sep 2014 21:51:42 +0200 Subject: ssh: add test for host key Test that the certificate check callback gets the right fingerprint from the host we're connecting to. --- script/cibuild.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'script') diff --git a/script/cibuild.sh b/script/cibuild.sh index 981f95b7e..c7c341ce5 100755 --- a/script/cibuild.sh +++ b/script/cibuild.sh @@ -33,6 +33,9 @@ ssh-keygen -t rsa -f ~/.ssh/id_rsa -N "" -q cat ~/.ssh/id_rsa.pub >>~/.ssh/authorized_keys ssh-keyscan -t rsa localhost >>~/.ssh/known_hosts +# Get the fingerprint for localhost and remove the colons so we can parse it as a hex number +export GITTEST_REMOTE_SSH_FINGERPRINT=$(ssh-keygen -F localhost -l | tail -n 1 | cut -d ' ' -f 2 | tr -d ':') + export GITTEST_REMOTE_URL="ssh://localhost/$HOME/_temp/test.git" export GITTEST_REMOTE_USER=$USER export GITTEST_REMOTE_SSH_KEY="$HOME/.ssh/id_rsa" @@ -40,7 +43,7 @@ export GITTEST_REMOTE_SSH_PUBKEY="$HOME/.ssh/id_rsa.pub" export GITTEST_REMOTE_SSH_PASSPHRASE="" if [ -e ./libgit2_clar ]; then - ./libgit2_clar -sonline::push -sonline::clone::cred_callback && + ./libgit2_clar -sonline::push -sonline::clone::cred_callback -sonline::clone::ssh_cert && rm -rf $HOME/_temp/test.git && git init --bare $HOME/_temp/test.git && # create an empty one ./libgit2_clar -sonline::clone::ssh_with_paths -- cgit v1.2.1