00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00038 #ifndef SOSSE_AUTH_H
00039 #define SOSSE_AUTH_H
00040
00041 #include <types.h>
00042
00044 #define AUTH_FLAG_PIN 0x01
00045
00046 #define AUTH_FLAG_KEY 0x02
00047
00048 #define AUTH_AC_ALW 0x0
00049 #define AUTH_AC_PIN 0x1
00050 #define AUTH_AC_ADM 0x2
00051 #define AUTH_AC_POA 0x3
00052 #define AUTH_AC_PAA 0x4
00053 #define AUTH_AC_NEV 0xF
00054
00055 #define PIN_MAX_RETRIES 3
00056 #define PUK_MAX_RETRIES 10
00057
00058 #define PIN_TYPE_PIN 0
00059 #define PIN_TYPE_PUK 1
00060 #define PIN_TYPE_EXT 2
00061 #define PIN_TYPE_INT 3
00062
00063 #define KEY_MAX_RETRIES 10
00064
00065
00069 #define AUTH_FID_EXTAUTH 0xFF00
00070
00074 #define AUTH_FID_INTAUTH 0xFF01
00075
00079 #define AUTH_FID_PINPUK 0xFF02
00080
00087 extern iu8 challvalidity;
00088
00097 bool auth_init( void );
00098
00109 bool auth_checkAc( iu8 ac );
00110
00133 bool auth_getCheckPinLen( iu8 pintype, iu8 pinlen, iu16 *addr,
00134 iu8 *len, iu16 *rcaddr, iu8 *maxret );
00135
00148 bool auth_setPin( iu8 pintype, iu8 *pin, iu8 pinlen );
00164 bool auth_verifyPin( iu8 pintype, iu8 *pin, iu8 pinlen );
00165
00177 bool auth_getChallenge( iu8 *dst, iu8 rndlen );
00195 bool auth_createVerifyCryptogram( iu8 *cry, iu8 crylen, bool create,
00196 bool enc );
00197
00198 #endif
00199