diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2001-08-06 21:25:38 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2001-08-06 21:25:38 +0000 |
commit | 94baf30d14ec1fb5b483ccca983d9faf3ef0ae2e (patch) | |
tree | 5a7ed97340f2910f74904800bf38d08f0ee86b8b /scard.c | |
parent | 0256e8b93c79b3eb4e9c69a3c550a209ca2018f7 (diff) | |
download | openssh-git-94baf30d14ec1fb5b483ccca983d9faf3ef0ae2e.tar.gz |
- jakob@cvs.openbsd.org 2001/07/31 08:41:10
[scard.c]
do not complain about missing smartcards. ok markus@
Diffstat (limited to 'scard.c')
-rw-r--r-- | scard.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -24,7 +24,7 @@ #ifdef SMARTCARD #include "includes.h" -RCSID("$OpenBSD: scard.c,v 1.8 2001/07/30 16:06:07 jakob Exp $"); +RCSID("$OpenBSD: scard.c,v 1.9 2001/07/31 08:41:10 jakob Exp $"); #include <openssl/engine.h> #include <sectok.h> @@ -62,7 +62,7 @@ sc_open(void) return SCARD_ERROR_FAIL; } if (! sectok_cardpresent(sc_fd)) { - error("smartcard in reader %d not present, skipping", + debug("smartcard in reader %d not present, skipping", sc_reader_num); return SCARD_ERROR_NOCARD; } @@ -328,13 +328,19 @@ Key * sc_get_key(int num) { Key *k; + int status; sc_reader_num = num; k = key_new(KEY_RSA); if (k == NULL) { return NULL; } - if (sc_read_pubkey(k) < 0) { + status = sc_read_pubkey(k); + if (status == SCARD_ERROR_NOCARD) { + key_free(k); + return NULL; + } + if (status < 0 ) { error("sc_read_pubkey failed"); key_free(k); return NULL; |