=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/Attic/scard.c,v retrieving revision 1.29.8.2 retrieving revision 1.30 diff -u -r1.29.8.2 -r1.30 --- src/usr.bin/ssh/Attic/scard.c 2006/11/08 00:17:14 1.29.8.2 +++ src/usr.bin/ssh/Attic/scard.c 2006/03/19 18:51:18 1.30 @@ -1,4 +1,3 @@ -/* $OpenBSD: scard.c,v 1.29.8.2 2006/11/08 00:17:14 brad Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. * @@ -24,17 +23,14 @@ */ #ifdef SMARTCARD +#include "includes.h" -#include - #include - #include -#include -#include "xmalloc.h" #include "key.h" #include "log.h" +#include "xmalloc.h" #include "misc.h" #include "scard.h" @@ -128,7 +124,7 @@ if (status == SCARD_ERROR_NOCARD) { return SCARD_ERROR_NOCARD; } - if (status < 0) { + if (status < 0 ) { error("sc_open failed"); return status; } @@ -218,7 +214,7 @@ olen = len = sw = 0; if (sc_fd < 0) { status = sc_init(); - if (status < 0) + if (status < 0 ) goto err; } if (padding != RSA_PKCS1_PADDING) @@ -258,7 +254,7 @@ len = sw = 0; if (sc_fd < 0) { status = sc_init(); - if (status < 0) + if (status < 0 ) goto err; } if (padding != RSA_PKCS1_PADDING) @@ -381,25 +377,23 @@ key_free(k); return NULL; } - if (status < 0) { + if (status < 0 ) { error("sc_read_pubkey failed"); key_free(k); return NULL; } - keys = xcalloc((nkeys+1), sizeof(Key *)); + keys = xmalloc((nkeys+1) * sizeof(Key *)); n = key_new(KEY_RSA1); - if ((BN_copy(n->rsa->n, k->rsa->n) == NULL) || - (BN_copy(n->rsa->e, k->rsa->e) == NULL)) - fatal("sc_get_keys: BN_copy failed"); + BN_copy(n->rsa->n, k->rsa->n); + BN_copy(n->rsa->e, k->rsa->e); RSA_set_method(n->rsa, sc_get_rsa()); n->flags |= KEY_FLAG_EXT; keys[0] = n; n = key_new(KEY_RSA); - if ((BN_copy(n->rsa->n, k->rsa->n) == NULL) || - (BN_copy(n->rsa->e, k->rsa->e) == NULL)) - fatal("sc_get_keys: BN_copy failed"); + BN_copy(n->rsa->n, k->rsa->n); + BN_copy(n->rsa->e, k->rsa->e); RSA_set_method(n->rsa, sc_get_rsa()); n->flags |= KEY_FLAG_EXT; keys[1] = n;