summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/ssh-keygen.c
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2002-03-25 17:34:27 +0000
committermarkus <markus@openbsd.org>2002-03-25 17:34:27 +0000
commit7704e0f52a776b4691206931422cfbf2ae887f41 (patch)
treec179d9b65791a443650a5aede4e8fca984aea091 /usr.bin/ssh/ssh-keygen.c
parentWarn user to remove old applet and keys (diff)
downloadwireguard-openbsd-7704e0f52a776b4691206931422cfbf2ae887f41.tar.xz
wireguard-openbsd-7704e0f52a776b4691206931422cfbf2ae887f41.zip
change sc_get_key to sc_get_keys and hide smartcard details in scard.c
Diffstat (limited to 'usr.bin/ssh/ssh-keygen.c')
-rw-r--r--usr.bin/ssh/ssh-keygen.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/usr.bin/ssh/ssh-keygen.c b/usr.bin/ssh/ssh-keygen.c
index a0f0c9a7fb1..f2b73ade3a6 100644
--- a/usr.bin/ssh/ssh-keygen.c
+++ b/usr.bin/ssh/ssh-keygen.c
@@ -12,7 +12,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: ssh-keygen.c,v 1.96 2002/03/21 21:54:34 rees Exp $");
+RCSID("$OpenBSD: ssh-keygen.c,v 1.97 2002/03/25 17:34:27 markus Exp $");
#include <openssl/evp.h>
#include <openssl/pem.h>
@@ -412,14 +412,18 @@ do_upload(struct passwd *pw, const char *sc_reader_id)
static void
do_download(struct passwd *pw, const char *sc_reader_id)
{
- Key *pub = NULL;
+ Key **keys = NULL;
+ int i;
- pub = sc_get_key(sc_reader_id, NULL);
- if (pub == NULL)
+ keys = sc_get_keys(sc_reader_id, NULL);
+ if (keys == NULL)
fatal("cannot read public key from smartcard");
- key_write(pub, stdout);
- key_free(pub);
- fprintf(stdout, "\n");
+ for (i = 0; keys[i]; i++) {
+ key_write(keys[i], stdout);
+ key_free(keys[i]);
+ fprintf(stdout, "\n");
+ }
+ xfree(keys);
exit(0);
}
#endif /* SMARTCARD */