@@ -651,8 +651,6 @@ static int check_against_known_hosts(
651
651
return ret ;
652
652
}
653
653
654
- #define SSH_DEFAULT_PORT 22
655
-
656
654
/*
657
655
* Perform the check for the session's certificate against known hosts if
658
656
* possible and then ask the user if they have a callback.
@@ -750,29 +748,23 @@ static int check_certificate(
750
748
if (check_cb != NULL ) {
751
749
git_cert_hostkey * cert_ptr = & cert ;
752
750
git_error_state previous_error = {0 };
753
- const char * host_ptr = host ;
754
- git_str host_and_port = GIT_STR_INIT ;
755
-
756
- if (port != SSH_DEFAULT_PORT ) {
757
- git_str_printf (& host_and_port , "%s:%d" , host , port );
758
- host_ptr = host_and_port .ptr ;
759
- }
760
751
761
752
git_error_state_capture (& previous_error , error );
762
- error = check_cb ((git_cert * ) cert_ptr , cert_valid , host_ptr , check_cb_payload );
753
+ error = check_cb ((git_cert * ) cert_ptr , cert_valid , host , check_cb_payload );
763
754
if (error == GIT_PASSTHROUGH ) {
764
755
error = git_error_state_restore (& previous_error );
765
756
} else if (error < 0 && !git_error_last ()) {
766
757
git_error_set (GIT_ERROR_NET , "unknown remote host key" );
767
758
}
768
759
769
760
git_error_state_free (& previous_error );
770
- git_str_dispose (& host_and_port );
771
761
}
772
762
773
763
return error ;
774
764
}
775
765
766
+ #define SSH_DEFAULT_PORT "22"
767
+
776
768
static int _git_ssh_setup_conn (
777
769
ssh_subtransport * t ,
778
770
const char * url ,
0 commit comments