[hf seos] Move max OID len to preproc define

This commit is contained in:
Aaron Tulino (Aaronjamt)
2026-03-17 19:05:43 -07:00
parent 440d82ae26
commit f8ff76c5ae
+2 -1
View File
@@ -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) {