moved to v2 of cryptoki (CK_VERSION 204. File is 4.4.0.0). This code worked before but now doesn't:
// key is BYTE[32]
RV rv;
CK_FLAGS flags = CKF_SERIAL_SESSION | CKF_RW_SESSION;
CK_SESION_HANDLE handle;
rv = C_OpenSession(slot_id, flags, (void*)"MyApp", 0, &handle); // This succeeds
int keyLen = 32;
rv = C_GenerateRandom(handle, key, keyLen); // fails here. rv = 0x8000001A
Of course C_Initialize was called beforehand. Should this code change?
Need to login before GenerateRandom: