#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 <openssl/engine.h>
#include <sectok.h>
/* interface to libsectok */
-static int
+static int
sc_open(void)
{
int sw;
return sc_fd;
}
-static int
+static int
sc_enable_applet(void)
{
static u_char aid[] = {0xfc, 0x53, 0x73, 0x68, 0x2e, 0x62, 0x69, 0x6e};
return 0;
}
-static int
+static int
sc_init(void)
{
int status;
return 0;
}
-static int
+static int
sc_read_pubkey(Key * k)
{
u_char buf[2], *n;
/* 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;
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));
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));
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");