From 440d82ae26e2ba724e75c55a1e9e40ed72b066aa Mon Sep 17 00:00:00 2001 From: "Aaron Tulino (Aaronjamt)" Date: Tue, 17 Mar 2026 18:31:07 -0700 Subject: [PATCH 1/2] [hf seos] Increase maximum ADF OID length Some newer MOB/ICE OIDs have gotten quite large. Custom OIDs may also be even larger. --- client/src/cmdhfseos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/cmdhfseos.c b/client/src/cmdhfseos.c index ddd2657a1..d077925b7 100644 --- a/client/src/cmdhfseos.c +++ b/client/src/cmdhfseos.c @@ -849,7 +849,7 @@ static int select_ADF_decrypt(const char *selectADFOID, uint8_t *CRYPTOGRAM_encr // Skip synthesized IV for (int i = iv_size * 2; i < CRYPTOGRAM_decrypted_data_length; i++) { // ADF OID tag - if (CRYPTOGRAM_decrypted_data[i] == 0x06 && CRYPTOGRAM_decrypted_data[i + 1] < 20) { + if (CRYPTOGRAM_decrypted_data[i] == 0x06 && CRYPTOGRAM_decrypted_data[i + 1] <= 32) { adf_length = ((CRYPTOGRAM_decrypted_data[i + 1])); diversifier_length = CRYPTOGRAM_decrypted_data[i + adf_length + 3]; if (*diversifier_length_out < diversifier_length) { From f8ff76c5aed3c79911ecc9f7ce6f5621d9c97aa4 Mon Sep 17 00:00:00 2001 From: "Aaron Tulino (Aaronjamt)" Date: Tue, 17 Mar 2026 19:04:53 -0700 Subject: [PATCH 2/2] [hf seos] Move max OID len to preproc define --- client/src/cmdhfseos.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/cmdhfseos.c b/client/src/cmdhfseos.c index d077925b7..8021b7375 100644 --- a/client/src/cmdhfseos.c +++ b/client/src/cmdhfseos.c @@ -43,6 +43,7 @@ static uint8_t zeros[16] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; #define MAX_DIVERSIFIER_LEN 16 +#define MAX_OID_LEN 32 static int CmdHelp(const char *Cmd); @@ -849,7 +850,7 @@ static int select_ADF_decrypt(const char *selectADFOID, uint8_t *CRYPTOGRAM_encr // Skip synthesized IV for (int i = iv_size * 2; i < CRYPTOGRAM_decrypted_data_length; i++) { // ADF OID tag - if (CRYPTOGRAM_decrypted_data[i] == 0x06 && CRYPTOGRAM_decrypted_data[i + 1] <= 32) { + if (CRYPTOGRAM_decrypted_data[i] == 0x06 && CRYPTOGRAM_decrypted_data[i + 1] <= MAX_OID_LEN) { adf_length = ((CRYPTOGRAM_decrypted_data[i + 1])); diversifier_length = CRYPTOGRAM_decrypted_data[i + adf_length + 3]; if (*diversifier_length_out < diversifier_length) {