diff --git a/src/ccid/CcidLocalAccess.c b/src/ccid/CcidLocalAccess.c index 18e8ddcb..510fde3f 100644 --- a/src/ccid/CcidLocalAccess.c +++ b/src/ccid/CcidLocalAccess.c @@ -634,14 +634,6 @@ int CcidAesDec (int nSendLength, unsigned char* cSendData, int nReceiveLength, u u32 getRandomNumber (u32 Size_u32, u8 * Data_pu8) { -u32 Ret_u32; - -u32 i; - -time_t now; - -static u8 FlasgTimeIsSet_u8 = FALSE; - // Size ok ? if (APDU_MAX_RESPONSE_LEN <= Size_u32) { @@ -649,9 +641,11 @@ static u8 FlasgTimeIsSet_u8 = FALSE; } // Get a random number from smartcard - Ret_u32 = CcidGetChallenge (Size_u32, Data_pu8); + // TODO: COMMENT FROM FLORIAN: IGNORE RETURN VALUE? + CcidGetChallenge (Size_u32, Data_pu8); #ifdef GENERATE_RANDOM_NUMBER_WITH_2ND_SOURCE + // TODO: COMMENT FROM FLORIAN: DOES THIS ACTUALLY ADD ENTROPY? // Paranoia: if the random number is not really random, xor it with // another random number from a second source if (FALSE == FlasgTimeIsSet_u8) @@ -879,40 +873,15 @@ int getAID (void) InitSCTStruct (&tSCT); - unsigned short cRet; - unsigned char nReturnSize; CcidSelectOpenPGPApp (); - cRet = CcidGetData (0x00, 0x4F, &nReturnSize); + // TODO: COMMENT FROM FLORIAN: IGNORE RETURN VALUE? + CcidGetData (0x00, 0x4F, &nReturnSize); return nReturnSize; } -uint32_t getSerialNumber (void) -{ - -uint32_t serial; - -uint8_t buffer[4]; - - InitSCTStruct (&tSCT); - -unsigned short cRet; - -unsigned char nReturnSize; - - CcidSelectOpenPGPApp (); - cRet = CcidGetData (0x00, 0x4F, &nReturnSize); - - - - return 0; - - -} - - uint8_t getByteOfData (uint8_t x) { @@ -926,8 +895,6 @@ uint8_t cardAuthenticate (uint8_t * password) unsigned short cRet; -unsigned char nReturnSize; - CcidSelectOpenPGPApp (); cRet = CcidVerifyPin (3, password); @@ -946,8 +913,6 @@ uint8_t userAuthenticate (uint8_t * password) unsigned short cRet; -unsigned char nReturnSize; - CcidSelectOpenPGPApp (); cRet = CcidVerifyPin (1, password); @@ -1006,8 +971,6 @@ uint8_t changeUserPin (uint8_t * password, uint8_t * new_password) unsigned short cRet; -unsigned char nReturnSize; - CcidSelectOpenPGPApp (); cRet = CcidChangePin (1, password, new_password); @@ -1026,8 +989,6 @@ uint8_t changeAdminPin (uint8_t * password, uint8_t * new_password) unsigned short cRet; -unsigned char nReturnSize; - CcidSelectOpenPGPApp (); cRet = CcidChangePin (3, password, new_password); @@ -1174,7 +1135,7 @@ unsigned char acBufferOut[32]; memset (pcKey, 0, nLen); return FALSE; default: - nRet; + return nRet; } /* if (APDU_ANSWER_COMMAND_CORRECT == nRet) { //CI_LocalPrintf ("Decrypted AES key : "); //HexPrint (nLen,acBufferOut); //CI_LocalPrintf @@ -1187,10 +1148,6 @@ uint8_t testSendUserPW2 (unsigned char* pcPW) { unsigned short nRet; - int n; - - n = strlen ((char *) pcPW); - // CI_LocalPrintf ("Send user password : "); nRet = CcidVerifyPin (2, pcPW); if (APDU_ANSWER_COMMAND_CORRECT == nRet)