--- authfile.c | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/authfile.c b/authfile.c index 50fa48e4a3b6..6867c326d8f0 100644 --- a/authfile.c +++ b/authfile.c @@ -161,37 +161,12 @@ sshkey_load_private_type_fd(int fd, int type, const char *passphrase, return r; } -/* XXX this is almost identical to sshkey_load_private_type() */ +/* This is identical to sshkey_load_private_type() with KEY_UNSPEC as type */ int sshkey_load_private(const char *filename, const char *passphrase, struct sshkey **keyp, char **commentp) { - struct sshbuf *buffer = NULL; - int r, fd; - - if (keyp != NULL) - *keyp = NULL; - if (commentp != NULL) - *commentp = NULL; - - if ((fd = open(filename, O_RDONLY)) == -1) - return SSH_ERR_SYSTEM_ERROR; - if (sshkey_perm_ok(fd, filename) != 0) { - r = SSH_ERR_KEY_BAD_PERMISSIONS; - goto out; - } - if ((r = sshbuf_load_fd(fd, &buffer)) != 0 || - (r = sshkey_parse_private_fileblob(buffer, passphrase, keyp, - commentp)) != 0) - goto out; - if (keyp && *keyp && - (r = sshkey_set_filename(*keyp, filename)) != 0) - goto out; - r = 0; - out: - close(fd); - sshbuf_free(buffer); - return r; + return sshkey_load_private_type(KEY_UNSPEC, filename, passphrase, keyp, commentp);; } /* Load a pubkey from the unencrypted envelope of a new-format private key */ -- 2.17.1 _______________________________________________ openssh-unix-dev mailing list openssh-unix-dev@xxxxxxxxxxx https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev