1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-30 13:01:23 +03:00

misc: Differentiate between client and server in ssh_analyze_banner.

This commit is contained in:
Andreas Schneider
2010-09-29 12:11:43 +02:00
parent 30e22fed6e
commit 1b471256d4
4 changed files with 11 additions and 5 deletions

View File

@@ -688,6 +688,7 @@ char *ssh_path_expand_escape(ssh_session session, const char *s) {
* server.
*
* @param session The session to analyze the banner from.
* @param server 0 means we are a client, 1 a server.
* @param ssh1 The variable which is set if it is a SSHv1 server.
* @param ssh2 The variable which is set if it is a SSHv2 server.
*
@@ -695,10 +696,15 @@ char *ssh_path_expand_escape(ssh_session session, const char *s) {
*
* @see ssh_get_banner()
*/
int ssh_analyze_banner(ssh_session session, int *ssh1, int *ssh2) {
const char *banner = session->clientbanner;
int ssh_analyze_banner(ssh_session session, int server, int *ssh1, int *ssh2) {
const char *banner;
const char *openssh;
if (server) {
banner = session->clientbanner;
} else {
banner = session->serverbanner;
}
if (banner == NULL ||
strlen(banner) <= 4 ||