Skip to content

Commit

Permalink
fix state updating
Browse files Browse the repository at this point in the history
  • Loading branch information
z4yx committed Oct 27, 2023
1 parent a973f7d commit 86bd0a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion applets/oath/oath.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,6 @@ static int oath_calculate_all(const CAPDU *capdu, RAPDU *rapdu) {

if (P2 != 0x00 && P2 != 0x01) EXCEPT(SW_WRONG_P1P2);

oath_remaining_type = P2 ? REMAINING_CALC_TRUNC : REMAINING_CALC_FULL;
int size = get_file_size(OATH_FILE);
if (size < 0) return -1;

Expand All @@ -548,6 +547,7 @@ static int oath_calculate_all(const CAPDU *capdu, RAPDU *rapdu) {
memcpy(challenge, DATA + off_in, challenge_len);
off_in += challenge_len;
if (off_in > LC) EXCEPT(SW_WRONG_LENGTH);
oath_remaining_type = P2 ? REMAINING_CALC_TRUNC : REMAINING_CALC_FULL;
}

OATH_RECORD record;
Expand Down

0 comments on commit 86bd0a1

Please sign in to comment.