unbreak ssh_add_hostkey(): sshkey_read() returns 0 on sucess

This commit is contained in:
Markus Friedl
2012-01-13 16:04:02 +01:00
parent 585db2baab
commit b720702ef3

View File

@@ -128,7 +128,7 @@ ssh_add_hostkey(struct ssh* ssh, char *key)
/* Parse public key */
if ((parsed_key = sshkey_new(KEY_UNSPEC)) == NULL)
return -1;
if (sshkey_read(parsed_key, &key) != 0) {
if (sshkey_read(parsed_key, &key) == 0) {
k = xmalloc(sizeof(*k));
k->key = parsed_key;
TAILQ_INSERT_TAIL(&ssh->public_keys, k, next);