Force 8-digit serial number

Fixes #149.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2025-05-19 10:01:07 +02:00
parent a61bb91824
commit 91aaee5beb
2 changed files with 2 additions and 0 deletions

View File

@@ -85,6 +85,7 @@ int man_get_config() {
res_APDU[res_APDU_size++] = TAG_SERIAL;
res_APDU[res_APDU_size++] = 4;
memcpy(res_APDU + res_APDU_size, pico_serial.id, 4);
res_APDU[res_APDU_size] &= ~0xFC; // Force 8-digit serial number
res_APDU_size += 4;
res_APDU[res_APDU_size++] = TAG_FORM_FACTOR;
res_APDU[res_APDU_size++] = 1;

View File

@@ -476,6 +476,7 @@ int cmd_otp() {
}
else if (p1 == 0x10) {
memcpy(res_APDU, pico_serial.id, 4);
res_APDU[0] &= ~0xFC; // Force 8-digit serial number
res_APDU_size = 4;
}
else if (p1 == 0x13) { // Get config