#include <config.h>
#include <auth.h>
#include <crypt.h>
#include <fs.h>
#include <fstream.h>
#include <hal.h>
#include <string.h>
#include <sw.h>
#include <tea.h>
#include <tools.h>
#include <transaction.h>
#include <types.h>
Functions | |
bool | auth_init (void) |
Initialize authentication variables. More... | |
bool | auth_checkAc (iu8 ac) |
Check fullfillment of access condition. More... | |
bool | auth_getCheckPinLen (iu8 pintype, iu8 pinlen, iu16 *addr, iu8 *len, iu16 *rcaddr, iu8 *maxret) |
Verifies length of PIN and returns addresses of PIN in EEPROM. More... | |
bool | auth_setPin (iu8 pintype, iu8 *pin, iu8 pinlen) |
Write PIN, PUK, External Authentication key or Internal Authentication key. More... | |
bool | auth_verifyPin (iu8 pintype, iu8 *pin, iu8 pinlen) |
Verifies PIN, PUK or External Authentication key and sets flags in authstate. More... | |
bool | auth_getChallenge (iu8 *dst, iu8 rndlen) |
Returns 8 byte challenge for External Authentication. More... | |
bool | auth_createVerifyCryptogram (iu8 *cry, iu8 crylen, bool create, bool enc) |
Encrypt or decrypt challenge or verify cryptogram. More... | |
Variables | |
iu8 | challenge [CRYPT_BLOCK_LEN] |
Value of the last with Get Challenge fetched random challenge. More... | |
iu8 | challvalidity |
iu8 | authstate |
Variable indicating current authentication state. More... |
|
Check fullfillment of access condition. This function checks, if the current setting of authstate fullfills the condition specified with ac.
|
|
Encrypt or decrypt challenge or verify cryptogram. To include the decryption process CONF_WITH_DECRYPT must be set to 1.
|
|
Returns 8 byte challenge for External Authentication. The challenge is also written to the challenge array and challvalidity is set to 2.
|
|
Verifies length of PIN and returns addresses of PIN in EEPROM. This functions does depending on pintype:
|
|
Initialize authentication variables. This function resets authstate and challvalidity. It must be called after reset.
|
|
Write PIN, PUK, External Authentication key or Internal Authentication key. The process is secured by transactions.
|
|
Verifies PIN, PUK or External Authentication key and sets flags in authstate. The update of the retry counter is secured by transactions. Warning: Currently the retry counter is not handled in a secure way. For more information see e.g. Rankl/Effing.
|
|
Variable indicating current authentication state. Single bit flags indicate, which authorization process has been successful. The flag is cleared, at the reset of the card and after unsuccessful authorization processes. Valid flags are:
|
|
Value of the last with Get Challenge fetched random challenge.
|
|
|