Fix ssh-keygen creation.

Fixes #59

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2024-09-13 21:03:34 +02:00
parent c43006f8c2
commit ec612a451d
2 changed files with 9 additions and 4 deletions

View File

@@ -120,8 +120,13 @@ void cbor_thread(void) {
DEBUG_DATA(res_APDU + 1, res_APDU_size);
}
else {
res_APDU[0] = apdu.sw;
//apdu.sw = 0;
if (apdu.sw >= CTAP1_ERR_INVALID_CHANNEL) {
res_APDU[-1] = apdu.sw;
apdu.sw = 0;
}
else {
res_APDU[0] = apdu.sw;
}
}
finished_data_size = res_APDU_size + 1;