Fix potential crash on loading dkek.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos 2024-04-17 19:42:47 +02:00
parent 001d076fdf
commit 25c93c279f
No known key found for this signature in database
GPG Key ID: C0095B7870A4CCD3

View File

@ -110,7 +110,7 @@ int mse_decrypt_ct(uint8_t *data, size_t len) {
int load_dkek(uint8_t id, uint8_t *dkek) {
file_t *tf = search_file(EF_DKEK + id);
if (!tf) {
if (!file_has_data(tf)) {
return CCID_ERR_FILE_NOT_FOUND;
}
memcpy(dkek, file_get_data(tf), DKEK_KEY_SIZE);