summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-08-06 21:25:38 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-08-06 21:25:38 +0000
commit94baf30d14ec1fb5b483ccca983d9faf3ef0ae2e (patch)
tree5a7ed97340f2910f74904800bf38d08f0ee86b8b
parent0256e8b93c79b3eb4e9c69a3c550a209ca2018f7 (diff)
- jakob@cvs.openbsd.org 2001/07/31 08:41:10
[scard.c] do not complain about missing smartcards. ok markus@
-rw-r--r--ChangeLog5
-rw-r--r--scard.c12
2 files changed, 13 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 0ddd6786d..4ad73258c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -72,6 +72,9 @@
72 >I am not sure which version of my old code you are using but I am 72 >I am not sure which version of my old code you are using but I am
73 >happy for the notice above to be substituted for my existing copyright 73 >happy for the notice above to be substituted for my existing copyright
74 >intent if this meets your purpose. 74 >intent if this meets your purpose.
75 - jakob@cvs.openbsd.org 2001/07/31 08:41:10
76 [scard.c]
77 do not complain about missing smartcards. ok markus@
75 78
7620010803 7920010803
77 - (djm) Fix interrupted read in entropy gatherer. Spotted by markus@ on 80 - (djm) Fix interrupted read in entropy gatherer. Spotted by markus@ on
@@ -6182,4 +6185,4 @@
6182 - Wrote replacements for strlcpy and mkdtemp 6185 - Wrote replacements for strlcpy and mkdtemp
6183 - Released 1.0pre1 6186 - Released 1.0pre1
6184 6187
6185$Id: ChangeLog,v 1.1444 2001/08/06 21:24:11 mouring Exp $ 6188$Id: ChangeLog,v 1.1445 2001/08/06 21:25:38 mouring Exp $
diff --git a/scard.c b/scard.c
index 951d868c8..9f22fdf39 100644
--- a/scard.c
+++ b/scard.c
@@ -24,7 +24,7 @@
24 24
25#ifdef SMARTCARD 25#ifdef SMARTCARD
26#include "includes.h" 26#include "includes.h"
27RCSID("$OpenBSD: scard.c,v 1.8 2001/07/30 16:06:07 jakob Exp $"); 27RCSID("$OpenBSD: scard.c,v 1.9 2001/07/31 08:41:10 jakob Exp $");
28 28
29#include <openssl/engine.h> 29#include <openssl/engine.h>
30#include <sectok.h> 30#include <sectok.h>
@@ -62,7 +62,7 @@ sc_open(void)
62 return SCARD_ERROR_FAIL; 62 return SCARD_ERROR_FAIL;
63 } 63 }
64 if (! sectok_cardpresent(sc_fd)) { 64 if (! sectok_cardpresent(sc_fd)) {
65 error("smartcard in reader %d not present, skipping", 65 debug("smartcard in reader %d not present, skipping",
66 sc_reader_num); 66 sc_reader_num);
67 return SCARD_ERROR_NOCARD; 67 return SCARD_ERROR_NOCARD;
68 } 68 }
@@ -328,13 +328,19 @@ Key *
328sc_get_key(int num) 328sc_get_key(int num)
329{ 329{
330 Key *k; 330 Key *k;
331 int status;
331 332
332 sc_reader_num = num; 333 sc_reader_num = num;
333 k = key_new(KEY_RSA); 334 k = key_new(KEY_RSA);
334 if (k == NULL) { 335 if (k == NULL) {
335 return NULL; 336 return NULL;
336 } 337 }
337 if (sc_read_pubkey(k) < 0) { 338 status = sc_read_pubkey(k);
339 if (status == SCARD_ERROR_NOCARD) {
340 key_free(k);
341 return NULL;
342 }
343 if (status < 0 ) {
338 error("sc_read_pubkey failed"); 344 error("sc_read_pubkey failed");
339 key_free(k); 345 key_free(k);
340 return NULL; 346 return NULL;