summaryrefslogtreecommitdiff
path: root/authfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'authfile.c')
-rw-r--r--authfile.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/authfile.c b/authfile.c
index d09b700d2..57dcd808c 100644
--- a/authfile.c
+++ b/authfile.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: authfile.c,v 1.127 2017/07/01 13:50:45 djm Exp $ */ 1/* $OpenBSD: authfile.c,v 1.128 2018/02/23 15:58:37 markus Exp $ */
2/* 2/*
3 * Copyright (c) 2000, 2013 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000, 2013 Markus Friedl. All rights reserved.
4 * 4 *
@@ -191,6 +191,8 @@ sshkey_load_private_type(int type, const char *filename, const char *passphrase,
191 *perm_ok = 1; 191 *perm_ok = 1;
192 192
193 r = sshkey_load_private_type_fd(fd, type, passphrase, keyp, commentp); 193 r = sshkey_load_private_type_fd(fd, type, passphrase, keyp, commentp);
194 if (r == 0 && keyp && *keyp)
195 r = sshkey_set_filename(*keyp, filename);
194 out: 196 out:
195 close(fd); 197 close(fd);
196 return r; 198 return r;
@@ -249,6 +251,9 @@ sshkey_load_private(const char *filename, const char *passphrase,
249 (r = sshkey_parse_private_fileblob(buffer, passphrase, keyp, 251 (r = sshkey_parse_private_fileblob(buffer, passphrase, keyp,
250 commentp)) != 0) 252 commentp)) != 0)
251 goto out; 253 goto out;
254 if (keyp && *keyp &&
255 (r = sshkey_set_filename(*keyp, filename)) != 0)
256 goto out;
252 r = 0; 257 r = 0;
253 out: 258 out:
254 close(fd); 259 close(fd);
@@ -397,6 +402,7 @@ sshkey_load_private_cert(int type, const char *filename, const char *passphrase,
397 case KEY_ECDSA: 402 case KEY_ECDSA:
398#endif /* WITH_OPENSSL */ 403#endif /* WITH_OPENSSL */
399 case KEY_ED25519: 404 case KEY_ED25519:
405 case KEY_XMSS:
400 case KEY_UNSPEC: 406 case KEY_UNSPEC:
401 break; 407 break;
402 default: 408 default: