Skip to content

Commit 8270633

Browse files
committed
example, tests: fix ssh2 to correctly return failure
Before this patch ssh2 and test_ssh2 returned success even if the session failed at `libssh2_session_handshake()` or after. This patch depends on cda41f7, that fixed running test_ssh2 on Windows via sshd_fixture. Cherry-picked from libssh2#1017
1 parent 0a29a63 commit 8270633

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

example/ssh2.c

+2
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ int main(int argc, char *argv[])
137137
goto shutdown;
138138
}
139139

140+
rc = 1;
141+
140142
/* At this point we have not yet authenticated. The first thing to do
141143
* is check the hostkey's fingerprint against our known hosts Your app
142144
* may have it hard coded, may go to a file, may present it to the

tests/test_ssh2.c

+2
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ int main(int argc, char *argv[])
157157
} while(1);
158158
}
159159

160+
rc = 1;
161+
160162
/* At this point we have not yet authenticated. The first thing to do
161163
* is check the hostkey's fingerprint against our known hosts Your app
162164
* may have it hard coded, may go to a file, may present it to the

0 commit comments

Comments
 (0)