Event History Setup: #287

Include a simple sh file to startup dsd-fme with opts line, and open log files for multi linux terminal support;

Fix bug with P25p1 MPDU Trunking Blocks setting address values to trigger event history watchdog;

Add an internal string into event history to log internal events of note (ENC LO, errors, etc);

Add a watchdog during any ENC LO event so the event_history will log the call with ENC LO;

Disable AHOY and RSP PDU's from Event History (clogs up the event history with extra info);

Fix DMR p_clear trigger to zero out src and tg values when tuning away;

Fix Hytera Enhanced RC4 (verified working); Misc Tweaks Regarding;
This commit is contained in:
lwvmobile
2025-05-06 21:19:11 -04:00
parent 68d959cb7a
commit 1532fdcc8e
13 changed files with 240 additions and 41 deletions

View File

@@ -316,7 +316,13 @@ void dmr_flco (dsd_opts * opts, dsd_state * state, uint8_t lc_bits[], uint32_t C
unsigned long long int mi = (unsigned long long int)ConvertBitIntoBytes(&lc_bits[24], 40);
fprintf (stderr, "%s", KYEL);
fprintf (stderr, " Slot %d Alg: %02X; KEY ID: %02X; MI(40): %010llX;", slot+1, alg, key, mi);
fprintf (stderr, " Hytera Enhanced;");
fprintf (stderr, " Hytera Enhanced; ");
if (slot == 0 && state->R != 0)
fprintf (stderr, "Key: %010llX; ", state->R);
if (slot == 1 && state->RR != 0)
fprintf (stderr, "Key: %010llX; ", state->RR);
for (int i = 0; i < 8; i++)
{
@@ -555,6 +561,13 @@ void dmr_flco (dsd_opts * opts, dsd_state * state, uint8_t lc_bits[], uint32_t C
state->group_tally++;
}
//run a watchdog here so we can update this with the crypto variables and ENC LO
if (target != 0 && lo == 0)
{
sprintf (state->event_history_s[slot].Event_History_Items[0].internal_str, "Target: %d; has been locked out; Encryption Lock Out Enabled.", target);
watchdog_event_current(opts, state, slot);
}
//Craft a fake CSBK pdu send it to run as a p_clear to return to CC if available
uint8_t dummy[12]; uint8_t* dbits; memset (dummy, 0, sizeof(dummy)); dummy[0] = 46; dummy[1] = 255;
if ( (strcmp(gm, "B") == 0) && (strcmp(gn, "ENC LO") == 0) ) //&& (opts->trunk_tune_data_calls == 0)
@@ -716,6 +729,20 @@ void dmr_flco (dsd_opts * opts, dsd_state * state, uint8_t lc_bits[], uint32_t C
fprintf (stderr, "%s ", KNRM);
}
if (slot == 0 && state->payload_algid == 0x02 && state->R != 0)
{
fprintf (stderr, "%s", KYEL);
fprintf (stderr, "Key: %010llX ", state->R);
fprintf (stderr, "%s ", KNRM);
}
if (slot == 1 && state->payload_algidR == 0x02 && state->RR != 0)
{
fprintf (stderr, "%s", KYEL);
fprintf (stderr, "Key: %010llX ", state->RR);
fprintf (stderr, "%s ", KNRM);
}
if (slot == 0 && (state->payload_algid == 0x25 || state->payload_algid == 0x24) && state->aes_key_loaded[0] == 1)
{
fprintf (stderr, "\n ");