some update

This commit is contained in:
Zhi Guan
2016-04-25 20:53:02 +02:00
parent da6bb109b4
commit d8072491bc
48 changed files with 1443 additions and 128 deletions

View File

@@ -59,10 +59,30 @@ int main(int argc, char **argv)
printf(" MaxECCBuffer : %ld\n", devInfo.MaxECCBufferSize);
printf(" MaxBuffer : %ld\n", devInfo.MaxBufferSize);
rv = SKF_DevAuth(hDev, authData, sizeof(authData));
ULONG ulAuthAlgId = devInfo.DevAuthAlgId;
unsigned char pbAuthKey[16] = {0};
/* get the DevAuth challenge from GenRandom API
* encrypt challenge with DevAuthKey
*/
rv = SKF_GenRandom(hDev, authRandom, sizeof(authRandom));
rv = SKF_EncryptInit(hKey, param);
rv = SKF_Encrypt(hKey, authRandom, 16, authResponse, &ulAuthLen);
rv = SKF_DevAuth(hDev, authData, authDataLen);
assert(rv == SAR_OK);
/*
*/
len = sizeof(appNameList);
rv = SKF_EnumApplication(hDev, appNameList, &len);
assert(rv == SAR_OK);