Code style.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2023-09-17 19:11:39 +02:00
parent bafede2ae5
commit 332debea6d
9 changed files with 123 additions and 66 deletions

View File

@@ -585,7 +585,7 @@ int cmd_verify_hotp() {
return SW_DATA_INVALID();
}
if (asn1_find_tag(file_get_data(ef), file_get_size(ef), TAG_IMF, &chal_len,
&chal) == false) {
&chal) == false) {
return SW_INCORRECT_PARAMS();
}
if (asn1_find_tag(apdu.data, apdu.nc, TAG_RESPONSE, &code_len, &code) == true) {
@@ -598,10 +598,10 @@ int cmd_verify_hotp() {
}
uint32_t res_int = (res_APDU[2] << 24) | (res_APDU[3] << 16) | (res_APDU[4] << 8) | res_APDU[5];
if (res_APDU[1] == 6) {
res_int %= (uint32_t)1e6;
res_int %= (uint32_t) 1e6;
}
else {
res_int %= (uint32_t)1e8;
res_int %= (uint32_t) 1e8;
}
if (res_int != code_int) {
return SW_WRONG_DATA();