added support for dynamic pace result generation to be transmitted to the pc/sc client. note that other ccid patches are not up to date

git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@284 96b47cad-a561-4643-ad3b-153ac7d7599c
This commit is contained in:
frankmorgner
2010-09-27 20:48:43 +00:00
parent 6f46d10136
commit ae83880a16
3 changed files with 312 additions and 175 deletions

View File

@@ -785,6 +785,7 @@ perform_PC_to_RDR_Secure_EstablishPACEChannel(sc_card_t *card,
size_t parsed = 0;
int sc_result;
__le16 word;
__le32 dword;
__u8 *p;
memset(&pace_input, 0, sizeof(pace_input));
@@ -877,7 +878,10 @@ perform_PC_to_RDR_Secure_EstablishPACEChannel(sc_card_t *card,
goto err;
p = realloc(*abDataOut, 2 + /* Statusbytes */
p = realloc(*abDataOut,
4 + /* Result */
2 + /* length Output data */
2 + /* Statusbytes */
2+pace_output.ef_cardaccess_length + /* EF.CardAccess */
1+pace_output.recent_car_length + /* Most recent CAR */
1+pace_output.previous_car_length + /* Previous CAR */
@@ -889,6 +893,21 @@ perform_PC_to_RDR_Secure_EstablishPACEChannel(sc_card_t *card,
*abDataOut = p;
dword = __cpu_to_le32(pace_output.result);
memcpy(p, &dword, sizeof dword);
p += sizeof dword;
word = __cpu_to_le16(
2 +
2+pace_output.ef_cardaccess_length +
1+pace_output.recent_car_length +
1+pace_output.previous_car_length +
2+pace_output.id_icc_length);
memcpy(p, &word, sizeof word);
p += sizeof word;
*p = pace_output.mse_set_at_sw1;
p += 1;

View File

@@ -33,6 +33,25 @@ extern "C" {
#define PACE_BITMAP_EID 0x20
#define PACE_BITMAP_ESIGN 0x10
#define PACE_SUCCESS 0x00000000
#define PACE_ERROR_LENGTH_INCONSISTENT 0xD0000001
#define PACE_ERROR_UNEXPECTED_DATA 0xD0000002
#define PACE_ERROR_UNEXPECTED_DATA_COMBINATION 0xD0000003
#define PACE_ERROR_CARD_NOT_SUPPORTED 0xE0000001
#define PACE_ERROR_ALGORITH_NOT_SUPPORTED 0xE0000002
#define PACE_ERROR_PINID_NOT_SUPPORTED 0xE0000003
#define PACE_ERROR_SELECT_EF_CARDACCESS 0xF0000000
#define PACE_ERROR_READ_BINARY 0xF0010000
#define PACE_ERROR_MSE_SET_AT 0xF0020000
#define PACE_ERROR_GENERAL_AUTHENTICATE_1 0xF0030000
#define PACE_ERROR_GENERAL_AUTHENTICATE_2 0xF0040000
#define PACE_ERROR_GENERAL_AUTHENTICATE_3 0xF0050000
#define PACE_ERROR_GENERAL_AUTHENTICATE_4 0xF0060000
#define PACE_ERROR_COMMUNICATION 0xF0100001
#define PACE_ERROR_NO_CARD 0xF0100002
#define PACE_ERROR_ABORTED 0xF0200001
#define PACE_ERROR_TIMEOUT 0xF0200002
//#define PACE_MRZ 0x01
//#define PACE_CAN 0x02
//#define PACE_PIN 0x03
@@ -66,6 +85,8 @@ struct establish_pace_channel_input {
};
struct establish_pace_channel_output {
unsigned int result;
unsigned char mse_set_at_sw1;
unsigned char mse_set_at_sw2;