X-Git-Url: http://andersk.mit.edu/gitweb/gssapi-openssh.git/blobdiff_plain/1e608e420beaca67ca6bc6bef308f9f9f6132a66..99a781071582d870e3aa172c8f3564914b0eeb75:/openssh/scard.c diff --git a/openssh/scard.c b/openssh/scard.c index e831931..251e5d3 100644 --- a/openssh/scard.c +++ b/openssh/scard.c @@ -24,7 +24,7 @@ #include "includes.h" #ifdef SMARTCARD -RCSID("$OpenBSD: scard.c,v 1.17 2001/12/27 18:22:16 markus Exp $"); +RCSID("$OpenBSD: scard.c,v 1.15 2001/09/28 09:49:31 djm Exp $"); #include #include @@ -48,7 +48,7 @@ static int cla = 0x00; /* class */ /* interface to libsectok */ -static int +static int sc_open(void) { int sw; @@ -79,7 +79,7 @@ sc_open(void) return sc_fd; } -static int +static int sc_enable_applet(void) { static u_char aid[] = {0xfc, 0x53, 0x73, 0x68, 0x2e, 0x62, 0x69, 0x6e}; @@ -95,7 +95,7 @@ sc_enable_applet(void) return 0; } -static int +static int sc_init(void) { int status; @@ -115,7 +115,7 @@ sc_init(void) return 0; } -static int +static int sc_read_pubkey(Key * k) { u_char buf[2], *n; @@ -133,7 +133,7 @@ sc_read_pubkey(Key * k) /* get key size */ sectok_apdu(sc_fd, CLA_SSH, INS_GET_KEYLENGTH, 0, 0, 0, NULL, - sizeof(buf), buf, &sw); + sizeof(buf), buf, &sw); if (!sectok_swOK(sw)) { error("could not obtain key length: %s", sectok_get_sw(sw)); goto err; @@ -204,7 +204,7 @@ sc_private_decrypt(int flen, u_char *from, u_char *to, RSA *rsa, int padding) goto err; } sectok_apdu(sc_fd, CLA_SSH, INS_GET_RESPONSE, 0, 0, 0, NULL, - len, padded, &sw); + len, padded, &sw); if (!sectok_swOK(sw)) { error("sc_private_decrypt: INS_GET_RESPONSE failed: %s", sectok_get_sw(sw)); @@ -249,7 +249,7 @@ sc_private_encrypt(int flen, u_char *from, u_char *to, RSA *rsa, int padding) goto err; } sectok_apdu(sc_fd, CLA_SSH, INS_GET_RESPONSE, 0, 0, 0, NULL, - len, to, &sw); + len, to, &sw); if (!sectok_swOK(sw)) { error("sc_private_decrypt: INS_GET_RESPONSE failed: %s", sectok_get_sw(sw)); @@ -320,8 +320,7 @@ sc_get_engine(void) smart_rsa.rsa_sign = def->rsa_sign; smart_rsa.rsa_verify = def->rsa_verify; - if ((smart_engine = ENGINE_new()) == NULL) - fatal("ENGINE_new failed"); + smart_engine = ENGINE_new(); ENGINE_set_id(smart_engine, "sectok"); ENGINE_set_name(smart_engine, "libsectok");