Increasing random buffer and checks.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2022-03-10 00:13:13 +01:00
parent 213b675b9f
commit f1c0b12f5c
2 changed files with 8 additions and 2 deletions

View File

@@ -420,7 +420,10 @@ static int cmd_reset_retry() {
}
static int cmd_challenge() {
res_APDU = (uint8_t *)random_bytes_get(apdu.expected_res_size);
uint8_t *rb = (uint8_t *)random_bytes_get(apdu.expected_res_size);
if (!rb)
return SW_WRONG_LENGTH();
res_APDU = rb;
res_APDU_size = apdu.expected_res_size;
return SW_OK();
}