summaryrefslogtreecommitdiff
path: root/scard.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2006-11-07 23:14:41 +1100
committerDarren Tucker <dtucker@zip.com.au>2006-11-07 23:14:41 +1100
commit0bc85579a9b5a106826169303dd2ee61c63c161e (patch)
treed98e767f275d45b4c62984fb73a3484a5b8e134f /scard.c
parentdf0e438a2e4efe0422f6e0deb732d819d5938437 (diff)
- markus@cvs.openbsd.org 2006/11/06 21:25:28
[auth-rsa.c kexgexc.c kexdhs.c key.c ssh-dss.c sshd.c kexgexs.c ssh-keygen.c bufbn.c moduli.c scard.c kexdhc.c sshconnect1.c dh.c rsa.c] add missing checks for openssl return codes; with & ok djm@
Diffstat (limited to 'scard.c')
-rw-r--r--scard.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/scard.c b/scard.c
index 328655edd..9fd3ca1b4 100644
--- a/scard.c
+++ b/scard.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: scard.c,v 1.35 2006/08/03 03:34:42 deraadt Exp $ */ 1/* $OpenBSD: scard.c,v 1.36 2006/11/06 21:25:28 markus Exp $ */
2/* 2/*
3 * Copyright (c) 2001 Markus Friedl. All rights reserved. 3 * Copyright (c) 2001 Markus Friedl. All rights reserved.
4 * 4 *
@@ -391,15 +391,17 @@ sc_get_keys(const char *id, const char *pin)
391 keys = xcalloc((nkeys+1), sizeof(Key *)); 391 keys = xcalloc((nkeys+1), sizeof(Key *));
392 392
393 n = key_new(KEY_RSA1); 393 n = key_new(KEY_RSA1);
394 BN_copy(n->rsa->n, k->rsa->n); 394 if ((BN_copy(n->rsa->n, k->rsa->n) == NULL) ||
395 BN_copy(n->rsa->e, k->rsa->e); 395 (BN_copy(n->rsa->e, k->rsa->e) == NULL))
396 fatal("sc_get_keys: BN_copy failed");
396 RSA_set_method(n->rsa, sc_get_rsa()); 397 RSA_set_method(n->rsa, sc_get_rsa());
397 n->flags |= KEY_FLAG_EXT; 398 n->flags |= KEY_FLAG_EXT;
398 keys[0] = n; 399 keys[0] = n;
399 400
400 n = key_new(KEY_RSA); 401 n = key_new(KEY_RSA);
401 BN_copy(n->rsa->n, k->rsa->n); 402 if ((BN_copy(n->rsa->n, k->rsa->n) == NULL) ||
402 BN_copy(n->rsa->e, k->rsa->e); 403 (BN_copy(n->rsa->e, k->rsa->e) == NULL))
404 fatal("sc_get_keys: BN_copy failed");
403 RSA_set_method(n->rsa, sc_get_rsa()); 405 RSA_set_method(n->rsa, sc_get_rsa());
404 n->flags |= KEY_FLAG_EXT; 406 n->flags |= KEY_FLAG_EXT;
405 keys[1] = n; 407 keys[1] = n;