This module will provide access to the administration functions on the smart-card. the smart card mush be opened with the admin security key otherwise an error will be returned and the smart card will have to be reset. These admin functions provide the ability to write session keys to the smart card, write a secret key to the smart card, and read / reset the authentication counters on the smart card.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <zccri.h>
#include <zcbci.h>
#include "key-admin.h"
#include "sec-game.h"
#include "sec-admin.h"
Include dependency graph for sec-admin.c:

Defines | |
| #define | _GNU_SOURCE |
Functions | |
| int | sec_AdminSetDesSessionKey (tsSMARTCARD_INFO *psSmartCard, LONG lIdx, BYTE *pabDesKeyBuf) |
| set a DES session key on the smart card | |
| int | sec_AdminSetSecretKey (tsSMARTCARD_INFO *psSmartCard, BYTE *pabSecKeyBuf) |
| Set the secret key on the smart card. | |
| int | sec_AdminZeroAuthCntrs (tsSMARTCARD_INFO *psSmartCard) |
| Zero out the authentication counters. | |
| int | sec_AdminReadAuthCntrs (tsSMARTCARD_INFO *psSmartCard, LONG *plFailure, LONG *plSuccess) |
| Read the auth counters from the smart card. | |
Variables | |
| unsigned char | abKeyAdmin [8] = { 0xc7, 0xd6, 0xea, 0x9b, 0xb7, 0x96, 0x39, 0xeb } |
|
|
|
|
||||||||||||||||
|
Read the auth counters from the smart card. Read the auth counters from the smart card. These counters only indicate comms failures in comms to the smart card. The basic declaration is: Command &H80 &H0c ReadCounters( SessionId As Long, Failure As Long, Success As Long )
History |
Here is the call graph for this function:

|
||||||||||||||||
|
set a DES session key on the smart card This command is called from the admin interface to set a DES session key. The key is firstly encrypted with the FPGA hardware key. The basic declaration is: Command &H80 &H04 SetSessionKey( SessionId As Long, Indx As Long, SessionKey As Des3Key )
History |
Here is the call graph for this function:

|
||||||||||||
|
Set the secret key on the smart card. This function will set the secret key to a known value on the smart card. This key is stored in pllain text on the smart card. The basic declaration is: Command &H80 &H08 SetSecretKey( SessionId As Long, Magic As Long, SessionKey As Des3Key )
History |
Here is the call graph for this function:

|
|
Zero out the authentication counters. This function is an admin function to reset the auth counters. The counters are FPGA success and failure counters from the smart cards view. The failure counter only increments if there is a comms failure. The basic declaration is: Command &H80 &H0a ZeroCounters( SessionId As Long )
History |
Here is the call graph for this function:

|
|
This key is the administration key used to store session keys and the secret key |
1.3.6