3
* $Id: cryptocard.h,v 1.37.2.1 2005/12/08 01:30:54 fcusack Exp $
3
* $Id: cryptocard.h,v 1.37.2.3 2006/05/09 08:13:05 fcusack Exp $
5
5
* This program is free software; you can redistribute it and/or modify
6
6
* it under the terms of the GNU General Public License as published by
15
15
* You should have received a copy of the GNU General Public License
16
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19
* Copyright 2005 TRI-D Systems, Inc.
19
* Copyright 2005,2006 TRI-D Systems, Inc.
22
22
#ifndef CRYPTOCARD_H
29
29
#define CRYPTOCARD_H8_RC (OTP_CF_HD|OTP_CF_R8|OTP_CF_AM|OTP_CF_C8)
30
30
#define CRYPTOCARD_H7_RC (OTP_CF_HD|OTP_CF_R7|OTP_CF_AM|OTP_CF_C8)
31
#define CRYPTOCARD_HP_RC (OTP_CF_HD|OTP_CF_RP|OTP_CF_AM|OTP_CF_C8)
31
32
#define CRYPTOCARD_D8_RC (OTP_CF_DD|OTP_CF_R8|OTP_CF_AM|OTP_CF_C8)
32
33
#define CRYPTOCARD_D7_RC (OTP_CF_DD|OTP_CF_R7|OTP_CF_AM|OTP_CF_C8)
34
#define CRYPTOCARD_DP_RC (OTP_CF_DD|OTP_CF_RP|OTP_CF_AM|OTP_CF_C8)
33
35
#define CRYPTOCARD_H8_ES (OTP_CF_HD|OTP_CF_R8|OTP_CF_ES|OTP_CF_C8)
34
36
#define CRYPTOCARD_H7_ES (OTP_CF_HD|OTP_CF_R7|OTP_CF_ES|OTP_CF_C8)
37
#define CRYPTOCARD_HP_ES (OTP_CF_HD|OTP_CF_RP|OTP_CF_ES|OTP_CF_C8)
35
38
#define CRYPTOCARD_D8_ES (OTP_CF_DD|OTP_CF_R8|OTP_CF_ES|OTP_CF_C8)
36
39
#define CRYPTOCARD_D7_ES (OTP_CF_DD|OTP_CF_R7|OTP_CF_ES|OTP_CF_C8)
40
#define CRYPTOCARD_DP_ES (OTP_CF_DD|OTP_CF_RP|OTP_CF_ES|OTP_CF_C8)
37
41
#define CRYPTOCARD_H8_RS (CRYPTOCARD_H8_RC|CRYPTOCARD_H8_ES)
38
42
#define CRYPTOCARD_H7_RS (CRYPTOCARD_H7_RC|CRYPTOCARD_H7_ES)
43
#define CRYPTOCARD_HP_RS (CRYPTOCARD_HP_RC|CRYPTOCARD_HP_ES)
39
44
#define CRYPTOCARD_D8_RS (CRYPTOCARD_D8_RC|CRYPTOCARD_D8_ES)
40
45
#define CRYPTOCARD_D7_RS (CRYPTOCARD_D7_RC|CRYPTOCARD_D7_ES)
46
#define CRYPTOCARD_DP_RS (CRYPTOCARD_DP_RC|CRYPTOCARD_DP_ES)
42
48
static int cryptocard_name2fm(const char *, uint32_t *);
43
static int cryptocard_keystring2keyblock(const char *,
44
unsigned char [OTP_MAX_KEY_LEN]);
49
static int cryptocard_keystring2keyblock(otp_card_info_t *);
45
50
static int cryptocard_nullstate(const otp_option_t *, const otp_card_info_t *,
46
51
otp_user_state_t *, time_t, const char *);
47
52
static int cryptocard_challenge(const otp_card_info_t *, otp_user_state_t *,