Fix when secure message cannot be correctly processed.

It is discarded.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos 2022-10-30 21:11:06 +01:00
parent b2ac893efc
commit eec4612a6f
No known key found for this signature in database
GPG key ID: C0095B7870A4CCD3

View file

@ -647,7 +647,9 @@ static const cmd_t cmds[] = {
};
int sc_hsm_process_apdu() {
sm_unwrap();
int r = sm_unwrap();
if (r != CCID_OK)
return SW_DATA_INVALID();
for (const cmd_t *cmd = cmds; cmd->ins != 0x00; cmd++) {
if (cmd->ins == INS(apdu)) {
int r = cmd->cmd_handler();