aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2018-06-25 14:00:55 +0200
committerToni Uhlig <matzeton@googlemail.com>2018-06-25 14:02:00 +0200
commit977dac9cf4de095215d35b5716955f2b68fba9fb (patch)
treedfc1666052a180d703ba46dcf0f42247a2b1fc2f /src
parent4bc4a786e8a4107494070d033cec0550bfd08085 (diff)
fixed long-term libssh pki-keygen bug, EMPTY PASSPHRASE is NOT an EMPTY STRING ("") instead it is a NULL-Pointer if libssh version >0.7.3
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src')
-rw-r--r--src/protocol_ssh.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/protocol_ssh.c b/src/protocol_ssh.c
index bc33e66..baa1548 100644
--- a/src/protocol_ssh.c
+++ b/src/protocol_ssh.c
@@ -87,12 +87,13 @@ int ssh_init_cb(protocol_ctx *ctx)
if (ssh_version(SSH_VERSION_INT(0,7,3)) == NULL)
{
W("%s", "Unsupported libssh version < 0.7.3");
+ return 1;
}
- if (ssh_version(SSH_VERSION_INT(0,7,4)) != NULL ||
- ssh_version(SSH_VERSION_INT(0,7,90)) != NULL)
+ if (ssh_version(SSH_VERSION_INT(0,7,4)) == NULL &&
+ ssh_version(SSH_VERSION_INT(0,7,90)) == NULL)
{
W("%s",
- "libssh versions > 0.7.3 may suffer "
+ "libssh versions <= 0.7.3 may suffer "
"from problems with the pki key generation/export");
}
version_logged = 1;
@@ -341,7 +342,7 @@ static int gen_export_sshkey(enum ssh_keytypes_e type, int length, const char *p
W2("Generating %s key failed: %d", type_str, s);
return 1;
}
- s = ssh_pki_export_privkey_file(priv_key, "", NULL,
+ s = ssh_pki_export_privkey_file(priv_key, NULL, NULL,
NULL, path);
ssh_key_free(priv_key);