summaryrefslogtreecommitdiff
path: root/scard.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2001-12-21 14:45:46 +1100
committerDamien Miller <djm@mindrot.org>2001-12-21 14:45:46 +1100
commit9f0f5c64bc4b6144e3fed6a7f538f7c21819a492 (patch)
treef79317ab211f59181a61b526f566e9c8cfe70c73 /scard.c
parent89681214ca2f50a1b1ed6164c3afe1ce14995ffc (diff)
- deraadt@cvs.openbsd.org 2001/12/19 07:18:56
[auth1.c auth2.c auth2-chall.c auth-bsdauth.c auth.c authfile.c auth.h] [auth-krb4.c auth-rhosts.c auth-skey.c bufaux.c canohost.c channels.c] [cipher.c clientloop.c compat.c compress.c deattack.c key.c log.c mac.c] [match.c misc.c nchan.c packet.c readconf.c rijndael.c rijndael.h scard.c] [servconf.c servconf.h serverloop.c session.c sftp.c sftp-client.c] [sftp-glob.c sftp-int.c sftp-server.c ssh-add.c ssh-agent.c ssh.c] [sshconnect1.c sshconnect2.c sshconnect.c sshd.8 sshd.c sshd_config] [ssh-keygen.c sshlogin.c sshpty.c sshtty.c ttymodes.c uidswap.c] basic KNF done while i was looking for something else
Diffstat (limited to 'scard.c')
-rw-r--r--scard.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/scard.c b/scard.c
index 251e5d30a..19d0e2a4c 100644
--- a/scard.c
+++ b/scard.c
@@ -24,7 +24,7 @@
24 24
25#include "includes.h" 25#include "includes.h"
26#ifdef SMARTCARD 26#ifdef SMARTCARD
27RCSID("$OpenBSD: scard.c,v 1.15 2001/09/28 09:49:31 djm Exp $"); 27RCSID("$OpenBSD: scard.c,v 1.16 2001/12/19 07:18:56 deraadt Exp $");
28 28
29#include <openssl/engine.h> 29#include <openssl/engine.h>
30#include <sectok.h> 30#include <sectok.h>
@@ -48,7 +48,7 @@ static int cla = 0x00; /* class */
48 48
49/* interface to libsectok */ 49/* interface to libsectok */
50 50
51static int 51static int
52sc_open(void) 52sc_open(void)
53{ 53{
54 int sw; 54 int sw;
@@ -79,7 +79,7 @@ sc_open(void)
79 return sc_fd; 79 return sc_fd;
80} 80}
81 81
82static int 82static int
83sc_enable_applet(void) 83sc_enable_applet(void)
84{ 84{
85 static u_char aid[] = {0xfc, 0x53, 0x73, 0x68, 0x2e, 0x62, 0x69, 0x6e}; 85 static u_char aid[] = {0xfc, 0x53, 0x73, 0x68, 0x2e, 0x62, 0x69, 0x6e};
@@ -95,7 +95,7 @@ sc_enable_applet(void)
95 return 0; 95 return 0;
96} 96}
97 97
98static int 98static int
99sc_init(void) 99sc_init(void)
100{ 100{
101 int status; 101 int status;
@@ -115,7 +115,7 @@ sc_init(void)
115 return 0; 115 return 0;
116} 116}
117 117
118static int 118static int
119sc_read_pubkey(Key * k) 119sc_read_pubkey(Key * k)
120{ 120{
121 u_char buf[2], *n; 121 u_char buf[2], *n;
@@ -133,7 +133,7 @@ sc_read_pubkey(Key * k)
133 133
134 /* get key size */ 134 /* get key size */
135 sectok_apdu(sc_fd, CLA_SSH, INS_GET_KEYLENGTH, 0, 0, 0, NULL, 135 sectok_apdu(sc_fd, CLA_SSH, INS_GET_KEYLENGTH, 0, 0, 0, NULL,
136 sizeof(buf), buf, &sw); 136 sizeof(buf), buf, &sw);
137 if (!sectok_swOK(sw)) { 137 if (!sectok_swOK(sw)) {
138 error("could not obtain key length: %s", sectok_get_sw(sw)); 138 error("could not obtain key length: %s", sectok_get_sw(sw));
139 goto err; 139 goto err;
@@ -204,7 +204,7 @@ sc_private_decrypt(int flen, u_char *from, u_char *to, RSA *rsa, int padding)
204 goto err; 204 goto err;
205 } 205 }
206 sectok_apdu(sc_fd, CLA_SSH, INS_GET_RESPONSE, 0, 0, 0, NULL, 206 sectok_apdu(sc_fd, CLA_SSH, INS_GET_RESPONSE, 0, 0, 0, NULL,
207 len, padded, &sw); 207 len, padded, &sw);
208 if (!sectok_swOK(sw)) { 208 if (!sectok_swOK(sw)) {
209 error("sc_private_decrypt: INS_GET_RESPONSE failed: %s", 209 error("sc_private_decrypt: INS_GET_RESPONSE failed: %s",
210 sectok_get_sw(sw)); 210 sectok_get_sw(sw));
@@ -249,7 +249,7 @@ sc_private_encrypt(int flen, u_char *from, u_char *to, RSA *rsa, int padding)
249 goto err; 249 goto err;
250 } 250 }
251 sectok_apdu(sc_fd, CLA_SSH, INS_GET_RESPONSE, 0, 0, 0, NULL, 251 sectok_apdu(sc_fd, CLA_SSH, INS_GET_RESPONSE, 0, 0, 0, NULL,
252 len, to, &sw); 252 len, to, &sw);
253 if (!sectok_swOK(sw)) { 253 if (!sectok_swOK(sw)) {
254 error("sc_private_decrypt: INS_GET_RESPONSE failed: %s", 254 error("sc_private_decrypt: INS_GET_RESPONSE failed: %s",
255 sectok_get_sw(sw)); 255 sectok_get_sw(sw));