~ubuntu-branches/ubuntu/natty/freeradius/natty-updates

« back to all changes in this revision

Viewing changes to src/modules/rlm_otp/cardops/cryptocard.h

  • Committer: Bazaar Package Importer
  • Author(s): Jeremie Corbier
  • Date: 2006-07-08 19:41:05 UTC
  • mto: (3.1.8 edgy) (4.1.3 sid) (1.1.14 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20060708194105-bxbr4e6m4dfw2x4x
Tags: upstream-1.1.2
ImportĀ upstreamĀ versionĀ 1.1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * cryptocard.h
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 $
4
4
 *
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
14
14
 *
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
18
18
 *
19
 
 * Copyright 2005 TRI-D Systems, Inc.
 
19
 * Copyright 2005,2006 TRI-D Systems, Inc.
20
20
 */
21
21
 
22
22
#ifndef CRYPTOCARD_H
28
28
/* card modes */
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)
41
47
 
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 *,