mirror of
https://github.com/polhenarejos/pico-hsm.git
synced 2026-01-17 01:18:06 +00:00
Fix ne parameter when secure message protocol is used.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
parent
4b59bd6481
commit
7c1ef56799
2 changed files with 5 additions and 1 deletions
|
|
@ -1 +1 @@
|
|||
Subproject commit 2c3fe5bebf6cf6a9a5fb9c685aa744529c8548cb
|
||||
Subproject commit 580b0acffa8e685caee4508fb656b78247064248
|
||||
|
|
@ -761,6 +761,7 @@ static const cmd_t cmds[] = {
|
|||
};
|
||||
|
||||
int sc_hsm_process_apdu() {
|
||||
uint32_t ne = apdu.ne;
|
||||
int r = sm_unwrap();
|
||||
if (r != PICOKEY_OK) {
|
||||
return SW_DATA_INVALID();
|
||||
|
|
@ -769,6 +770,9 @@ int sc_hsm_process_apdu() {
|
|||
if (cmd->ins == INS(apdu)) {
|
||||
int res = cmd->cmd_handler();
|
||||
sm_wrap();
|
||||
if ((CLA(apdu) >> 2) & 0x3) {
|
||||
apdu.ne = ne;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue