diff options
author | djm@openbsd.org <djm@openbsd.org> | 2020-01-25 23:02:13 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2020-01-26 10:18:42 +1100 |
commit | 99aa8035554ddb976348d2a9253ab3653019728d (patch) | |
tree | 195dc658a883d04305334be9658ba7b9eba55e94 /ssh-add.c | |
parent | 065064fcf455778b0918f783033b374d4ba37a92 (diff) |
upstream: factor out reading/writing sshbufs to dedicated
functions; feedback and ok markus@
OpenBSD-Commit-ID: dc09e5f1950b7acc91b8fdf8015347782d2ecd3d
Diffstat (limited to 'ssh-add.c')
-rw-r--r-- | ssh-add.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh-add.c,v 1.150 2020/01/17 20:13:47 naddy Exp $ */ | 1 | /* $OpenBSD: ssh-add.c,v 1.151 2020/01/25 23:02:13 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -224,9 +224,7 @@ add_file(int agent_fd, const char *filename, int key_only, int qflag, | |||
224 | return -1; | 224 | return -1; |
225 | } | 225 | } |
226 | } | 226 | } |
227 | if ((keyblob = sshbuf_new()) == NULL) | 227 | if ((r = sshbuf_load_fd(fd, &keyblob)) != 0) { |
228 | fatal("%s: sshbuf_new failed", __func__); | ||
229 | if ((r = sshkey_load_file(fd, keyblob)) != 0) { | ||
230 | fprintf(stderr, "Error loading key \"%s\": %s\n", | 228 | fprintf(stderr, "Error loading key \"%s\": %s\n", |
231 | filename, ssh_err(r)); | 229 | filename, ssh_err(r)); |
232 | sshbuf_free(keyblob); | 230 | sshbuf_free(keyblob); |