summaryrefslogtreecommitdiff
path: root/ssh-add.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2020-01-25 23:02:13 +0000
committerDamien Miller <djm@mindrot.org>2020-01-26 10:18:42 +1100
commit99aa8035554ddb976348d2a9253ab3653019728d (patch)
tree195dc658a883d04305334be9658ba7b9eba55e94 /ssh-add.c
parent065064fcf455778b0918f783033b374d4ba37a92 (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.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/ssh-add.c b/ssh-add.c
index 980caa467..f3b666c93 100644
--- a/ssh-add.c
+++ b/ssh-add.c
@@ -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);