From d6b64f35b09f7886cef7b996ead1f910521cb6ac Mon Sep 17 00:00:00 2001 From: lwvmobile Date: Sun, 22 Nov 2026 19:43:53 -0500 Subject: [PATCH] DMR: Code Tweaks to Hytera OTA Encryption; #373 Clarify -H O:0:0 option in usage; DMR: Fix PDU TGT and SRC value swaps in some locations YSF: Fix Full Rate Voice; --- examples/cygwin_bat/complete_usage_options.txt | 4 ++-- src/dmr_block.c | 12 ++++++------ src/dsd_main.c | 2 +- src/ysf.c | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/cygwin_bat/complete_usage_options.txt b/examples/cygwin_bat/complete_usage_options.txt index c33ce88..52203fc 100644 --- a/examples/cygwin_bat/complete_usage_options.txt +++ b/examples/cygwin_bat/complete_usage_options.txt @@ -1,4 +1,4 @@ -Build Version: AW 2026-47-ga6ea60b +Build Version: AW 2026-83-gdad6d6c MBElib Version: 1.3.4 CODEC2 Support Enabled @@ -153,7 +153,7 @@ Advanced Decoder options: -H C:256:20029736A5D91042C923EB0697484433005EFC58A1905195E28E9C7836AA2DB8' -H Manually Enter Hytera OTA Encryption 32 Char Hex Key (see example below) - -H O:0:0 no keystream application, but check for Hytera OTA Encryption and DMRA EP Late Entry IV. + -H O:0:0 Skip Encrypted Signalling, force pseudo call info, and check DMRA EP Late Entry IV. -H O:128:17bfe59b29a06136fb7d3811fd1a4904 for 128-bit RC4 OTA Key Setup -R Manually Enter dPMR or NXDN EHR Scrambler Key Value (Decimal Value) diff --git a/src/dmr_block.c b/src/dmr_block.c index c34d9ed..091af59 100644 --- a/src/dmr_block.c +++ b/src/dmr_block.c @@ -1347,8 +1347,8 @@ void dmr_block_assembler (dsd_opts * opts, dsd_state * state, uint8_t block_byte kid = state->payload_keyid; else kid = state->payload_keyidR; - char enc_str[200]; memset (enc_str, 200, sizeof(enc_str)); - sprintf (enc_str, "DATA TGT: %lld; SRC: %lld; ENC PDU; ALG: %02X; KID: %02X;", state->dmr_lrrp_source[slot], state->dmr_lrrp_target[slot], alg, kid); + char enc_str[200]; memset (enc_str, 0, sizeof(enc_str)); + sprintf (enc_str, "DATA TGT: %lld; SRC: %lld; ENC PDU; ALG: %02X; KID: %02X;", state->dmr_lrrp_target[slot], state->dmr_lrrp_source[slot], alg, kid); sprintf (state->dmr_lrrp_gps[slot], "%s", enc_str); watchdog_event_datacall (opts, state, state->dmr_lrrp_source[slot], state->dmr_lrrp_target[slot], enc_str, slot); } @@ -1417,8 +1417,8 @@ void dmr_block_assembler (dsd_opts * opts, dsd_state * state, uint8_t block_byte //dump to event history if (mnis_type != 0x11 && mnis_type != 0x01) //if not LRRP or LOCN { - char mnis_str[200]; memset (mnis_str, 200, sizeof(mnis_str)); - sprintf (mnis_str, "MNIS TGT: %lld; SRC: %lld;", state->dmr_lrrp_source[slot], state->dmr_lrrp_target[slot]); + char mnis_str[200]; memset (mnis_str, 0, sizeof(mnis_str)); + sprintf (mnis_str, "MNIS TGT: %lld; SRC: %lld;", state->dmr_lrrp_target[slot], state->dmr_lrrp_source[slot]); watchdog_event_datacall (opts, state, state->dmr_lrrp_source[slot], state->dmr_lrrp_target[slot], mnis_str, slot); } else if (mnis_type == 0x11 || mnis_type == 0x01) //LRRP or LOCN @@ -1427,8 +1427,8 @@ void dmr_block_assembler (dsd_opts * opts, dsd_state * state, uint8_t block_byte } else { - char unk_str[200]; memset (unk_str, 200, sizeof(unk_str)); - sprintf (unk_str, "DATA TGT: %lld; SRC: %lld; Unknown PDU Format;", state->dmr_lrrp_source[slot], state->dmr_lrrp_target[slot]); + char unk_str[200]; memset (unk_str, 0, sizeof(unk_str)); + sprintf (unk_str, "DATA TGT: %lld; SRC: %lld; Unknown PDU Format;", state->dmr_lrrp_target[slot], state->dmr_lrrp_source[slot]); watchdog_event_datacall (opts, state, state->dmr_lrrp_source[slot], state->dmr_lrrp_target[slot], unk_str, slot); } } diff --git a/src/dsd_main.c b/src/dsd_main.c index 68021d9..4e5f59d 100644 --- a/src/dsd_main.c +++ b/src/dsd_main.c @@ -1585,7 +1585,7 @@ printf (" -H C:256:20029736A5D91042C923EB0697484433005EFC58A1905195E28E9C7836AA2DB8' \n"); printf ("\n"); printf (" -H Manually Enter Hytera OTA Encryption 32 Char Hex Key (see example below)\n"); - printf (" -H O:0:0 no keystream application, but check for Hytera OTA Encryption and DMRA EP Late Entry IV.\n"); + printf (" -H O:0:0 Skip Encrypted Signalling, force pseudo call info, and check DMRA EP Late Entry IV.\n"); printf (" -H O:128:17bfe59b29a06136fb7d3811fd1a4904 for 128-bit RC4 OTA Key Setup\n"); printf ("\n"); printf (" -R Manually Enter dPMR or NXDN EHR Scrambler Key Value (Decimal Value)\n"); diff --git a/src/ysf.c b/src/ysf.c index c413c21..a04f64e 100644 --- a/src/ysf.c +++ b/src/ysf.c @@ -1039,7 +1039,7 @@ void processYSF(dsd_opts * opts, dsd_state * state) for (m = 14; m >= 0; m--) imbe_fr[n][m] = imbe_vch[k++]; } - for (m = 7; m >= 0; m--) + for (m = 6; m >= 0; m--) imbe_fr[7][m] = imbe_vch[k++]; //fake it as P25p1 and sent to processMBEFrame