mirror of
https://github.com/polhenarejos/pico-keys-sdk
synced 2026-05-08 05:56:11 +02:00
Second round to make it work for ESP32S3.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
10
src/eac.c
10
src/eac.c
@@ -103,10 +103,8 @@ int sm_unwrap() {
|
||||
if (r != CCID_OK) {
|
||||
return r;
|
||||
}
|
||||
uint16_t le = sm_get_le();
|
||||
if (le >= 0) {
|
||||
apdu.ne = le;
|
||||
}
|
||||
apdu.ne = sm_get_le();
|
||||
|
||||
uint8_t *body = NULL;
|
||||
uint16_t body_size = 0;
|
||||
bool is87 = false;
|
||||
@@ -306,12 +304,12 @@ int sm_verify() {
|
||||
}
|
||||
|
||||
uint16_t sm_remove_padding(const uint8_t *data, uint16_t data_len) {
|
||||
uint16_t i = data_len - 1;
|
||||
int32_t i = data_len - 1;
|
||||
for (; i >= 0 && data[i] == 0; i--) {
|
||||
;
|
||||
}
|
||||
if (i < 0 || data[i] != 0x80) {
|
||||
return 0;
|
||||
}
|
||||
return i;
|
||||
return (uint16_t)i;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user