summaryrefslogtreecommitdiff
path: root/ssh-keygen.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2020-05-29 03:11:54 +0000
committerDamien Miller <djm@mindrot.org>2020-05-29 13:28:47 +1000
commit224418cf55611869a4ace1b8b07bba0dff77a9c3 (patch)
tree0b0020aeac971d17a0ff15f5e983fd4073cb22f8 /ssh-keygen.c
parent1001dd148ed7c57bccf56afb40cb77482ea343a6 (diff)
upstream: fix exit status for downloading of FIDO resident keys;
from Pedro Martelletto, ok markus@ OpenBSD-Commit-ID: 0da77dc24a1084798eedd83c39a002a9d231faef
Diffstat (limited to 'ssh-keygen.c')
-rw-r--r--ssh-keygen.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ssh-keygen.c b/ssh-keygen.c
index 405903319..bdc29e00a 100644
--- a/ssh-keygen.c
+++ b/ssh-keygen.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-keygen.c,v 1.411 2020/05/18 04:29:35 djm Exp $ */ 1/* $OpenBSD: ssh-keygen.c,v 1.412 2020/05/29 03:11:54 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -2938,7 +2938,7 @@ do_download_sk(const char *skprovider, const char *device)
2938{ 2938{
2939 struct sshkey **keys; 2939 struct sshkey **keys;
2940 size_t nkeys, i; 2940 size_t nkeys, i;
2941 int r, ok = -1; 2941 int r, ret = -1;
2942 char *fp, *pin = NULL, *pass = NULL, *path, *pubpath; 2942 char *fp, *pin = NULL, *pass = NULL, *path, *pubpath;
2943 const char *ext; 2943 const char *ext;
2944 2944
@@ -3022,13 +3022,13 @@ do_download_sk(const char *skprovider, const char *device)
3022 } 3022 }
3023 3023
3024 if (i >= nkeys) 3024 if (i >= nkeys)
3025 ok = 0; /* success */ 3025 ret = 0; /* success */
3026 if (pass != NULL) 3026 if (pass != NULL)
3027 freezero(pass, strlen(pass)); 3027 freezero(pass, strlen(pass));
3028 for (i = 0; i < nkeys; i++) 3028 for (i = 0; i < nkeys; i++)
3029 sshkey_free(keys[i]); 3029 sshkey_free(keys[i]);
3030 free(keys); 3030 free(keys);
3031 return ok ? 0 : -1; 3031 return ret;
3032} 3032}
3033 3033
3034static void 3034static void