Fix binary read permission.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos 2024-06-28 22:59:16 +02:00
parent c1a47ed023
commit 5630043a4d
No known key found for this signature in database
GPG key ID: C0095B7870A4CCD3

View file

@ -18,7 +18,6 @@
#include "sc_hsm.h"
int cmd_read_binary() {
uint16_t fid = 0x0;
uint16_t offset = 0;
uint8_t ins = INS(apdu), p1 = P1(apdu), p2 = P2(apdu);
const file_t *ef = NULL;
@ -61,7 +60,7 @@ int cmd_read_binary() {
}
}
if ((fid >> 8) == KEY_PREFIX || !authenticate_action(ef, ACL_OP_READ_SEARCH)) {
if ((ef->fid >> 8) == KEY_PREFIX || !authenticate_action(ef, ACL_OP_READ_SEARCH)) {
return SW_SECURITY_STATUS_NOT_SATISFIED();
}
if (ef->data) {