Ver código fonte

Fix hardcoded ADF OID

Eric Betts 8 meses atrás
pai
commit
2f41718ebb
1 arquivos alterados com 5 adições e 6 exclusões
  1. 5 6
      seos_reader.c

+ 5 - 6
seos_reader.c

@@ -8,11 +8,7 @@ static uint8_t select[] =
 static uint8_t SEOS_APPLET_FCI[] =
     {0x6F, 0x0C, 0x84, 0x0A, 0xA0, 0x00, 0x00, 0x04, 0x40, 0x00, 0x01, 0x01, 0x00, 0x01};
 
-// TODO: support value from keys file
-static uint8_t select_adf[] = {0x80, 0xa5, 0x04, 0x00, 0x13, 0x06, 0x11, 0x2b, 0x06,
-                               0x01, 0x04, 0x01, 0x81, 0xe4, 0x38, 0x01, 0x01, 0x02,
-                               0x01, 0x18, 0x01, 0x01, 0x02, 0x02, 0x00};
-
+static uint8_t select_adf_header[] = {0x80, 0xa5, 0x04, 0x00};
 static uint8_t general_authenticate_1[] =
     {0x00, 0x87, 0x00, 0x01, 0x04, 0x7c, 0x02, 0x81, 0x00, 0x00};
 
@@ -222,7 +218,10 @@ NfcCommand seos_reader_select_adf(SeosReader* seos_reader) {
     NfcCommand ret = NfcCommandContinue;
     Iso14443_4aError error;
 
-    bit_buffer_append_bytes(tx_buffer, select_adf, sizeof(select_adf));
+    bit_buffer_append_bytes(tx_buffer, select_adf_header, sizeof(select_adf_header));
+    bit_buffer_append_byte(tx_buffer, SEOS_ADF_OID_LEN);
+    bit_buffer_append_bytes(tx_buffer, SEOS_ADF_OID, SEOS_ADF_OID_LEN);
+    bit_buffer_append_byte(tx_buffer, 0x00); // Le
     error = iso14443_4a_poller_send_block(iso14443_4a_poller, tx_buffer, rx_buffer);
     if(error != Iso14443_4aErrorNone) {
         FURI_LOG_W(TAG, "iso14443_4a_poller_send_block error %d", error);