From 0936a5bb7267b0c0d688c2692224ba571caa8a0d Mon Sep 17 00:00:00 2001 From: Ben Lindstrom Date: Tue, 26 Mar 2002 03:17:42 +0000 Subject: - markus@cvs.openbsd.org 2002/03/25 17:34:27 [scard.c scard.h ssh-agent.c ssh-keygen.c ssh.c] change sc_get_key to sc_get_keys and hide smartcard details in scard.c --- ssh-keygen.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'ssh-keygen.c') diff --git a/ssh-keygen.c b/ssh-keygen.c index 7d3629365..1a8a73129 100644 --- a/ssh-keygen.c +++ b/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 #include @@ -416,14 +416,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 */ -- cgit v1.2.3