Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

auth.h

Go to the documentation of this file.
00001 /*
00002     Simple Operating System for Smartcard Education
00003     Copyright (C) 2002  Matthias Bruestle <m@mbsks.franken.de>
00004 
00005     This program is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation; either version 2 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program; if not, write to the Free Software
00017     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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 /* SOSSE_AUTH_H */
00199 

Copyright 2002 by Matthias Bruestle. This is licensed under the GNU General Public License.