ensure the P25 algId and kId are set to sane defaults (unencrypted essentially); update alias or ID immediately;

pull/2/head
Bryan Biedenkapp 10 months ago
parent 694ec3f3d4
commit 3718f20e0c

@ -20,6 +20,8 @@ using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Input; using System.Windows.Input;
using System.Windows.Media; using System.Windows.Media;
using fnecore;
using fnecore.DMR; using fnecore.DMR;
using fnecore.P25; using fnecore.P25;
@ -411,6 +413,10 @@ namespace dvmconsole.Controls
SystemName = $"System: {systemName}"; SystemName = $"System: {systemName}";
LastSrcId = $"Last ID: {LastSrcId}"; LastSrcId = $"Last ID: {LastSrcId}";
algId = P25Defines.P25_ALGO_UNENCRYPT;
kId = 0;
FneUtils.Memset(mi, 0, P25Defines.P25_MI_LENGTH);
VolumeMeter.ViewModel = new VuMeterViewModel(); VolumeMeter.ViewModel = new VuMeterViewModel();
VolumeMeter.ViewModel.Level = 0; VolumeMeter.ViewModel.Level = 0;

@ -260,6 +260,7 @@ namespace dvmconsole
/// <param name="offset"></param> /// <param name="offset"></param>
/// <param name="imbe"></param> /// <param name="imbe"></param>
/// <param name="frameType"></param> /// <param name="frameType"></param>
/// <param name="cryptoParams"></param>
private void EncodeLDU2(ref byte[] data, int offset, byte[] imbe, byte frameType, CryptoParams cryptoParams) private void EncodeLDU2(ref byte[] data, int offset, byte[] imbe, byte frameType, CryptoParams cryptoParams)
{ {
if (data == null) if (data == null)
@ -386,6 +387,7 @@ namespace dvmconsole
/// </summary> /// </summary>
/// <param name="netLDU2">Input LDU data array</param> /// <param name="netLDU2">Input LDU data array</param>
/// <param name="data">Output data array</param> /// <param name="data">Output data array</param>
/// <param name="cryptoParams"></param>
public void CreateP25LDU2Message(in byte[] netLDU2, ref byte[] data, CryptoParams cryptoParams = null) public void CreateP25LDU2Message(in byte[] netLDU2, ref byte[] data, CryptoParams cryptoParams = null)
{ {
if (cryptoParams == null) if (cryptoParams == null)

@ -287,21 +287,21 @@ namespace dvmconsole
callHistoryWindow.AddCall(cpgChannel.Name, (int)e.SrcId, (int)e.DstId, DateTime.Now.ToString()); callHistoryWindow.AddCall(cpgChannel.Name, (int)e.SrcId, (int)e.DstId, DateTime.Now.ToString());
callHistoryWindow.ChannelKeyed(cpgChannel.Name, (int)e.SrcId, false); // TODO: Encrypted state callHistoryWindow.ChannelKeyed(cpgChannel.Name, (int)e.SrcId, false); // TODO: Encrypted state
string alias = string.Empty; channel.Background = ChannelBox.GREEN_GRADIENT;
}
try
{
alias = AliasTools.GetAliasByRid(system.RidAlias, (int)e.SrcId);
}
catch (Exception) { }
if (string.IsNullOrEmpty(alias)) string alias = string.Empty;
channel.LastSrcId = "Last ID: " + e.SrcId;
else
channel.LastSrcId = "Last: " + alias;
channel.Background = ChannelBox.GREEN_GRADIENT; try
{
alias = AliasTools.GetAliasByRid(system.RidAlias, (int)e.SrcId);
} }
catch (Exception) { }
if (string.IsNullOrEmpty(alias))
channel.LastSrcId = "Last ID: " + e.SrcId;
else
channel.LastSrcId = "Last: " + alias;
// if we can, use the PI LC from the PI voice header as to keep all options intact // if we can, use the PI LC from the PI voice header as to keep all options intact
if ((e.FrameType == FrameType.DATA_SYNC) && (e.DataType == DMRDataType.VOICE_PI_HEADER)) if ((e.FrameType == FrameType.DATA_SYNC) && (e.DataType == DMRDataType.VOICE_PI_HEADER))

@ -487,22 +487,13 @@ namespace dvmconsole
FneUtils.Memset(channel.mi, 0x00, P25Defines.P25_MI_LENGTH); FneUtils.Memset(channel.mi, 0x00, P25Defines.P25_MI_LENGTH);
// make channel enc parameters sane
if (channel.algId == 0 && channel.kId == 0)
channel.algId = P25Defines.P25_ALGO_UNENCRYPT;
callHistoryWindow.AddCall(cpgChannel.Name, (int)e.SrcId, (int)e.DstId, DateTime.Now.ToString()); callHistoryWindow.AddCall(cpgChannel.Name, (int)e.SrcId, (int)e.DstId, DateTime.Now.ToString());
callHistoryWindow.ChannelKeyed(cpgChannel.Name, (int)e.SrcId, encrypted); callHistoryWindow.ChannelKeyed(cpgChannel.Name, (int)e.SrcId, encrypted);
string alias = string.Empty;
try
{
alias = AliasTools.GetAliasByRid(system.RidAlias, (int)e.SrcId);
}
catch (Exception) { }
if (string.IsNullOrEmpty(alias))
channel.LastSrcId = "Last ID: " + e.SrcId;
else
channel.LastSrcId = "Last: " + alias;
if (channel.algId != P25Defines.P25_ALGO_UNENCRYPT) if (channel.algId != P25Defines.P25_ALGO_UNENCRYPT)
Log.WriteLine($"({system.Name}) P25D: Traffic *CALL ENC PARMS * PEER {e.PeerId} SRC_ID {e.SrcId} TGID {e.DstId} ALGID {channel.algId} KID {channel.kId} [STREAM ID {e.StreamId}]"); Log.WriteLine($"({system.Name}) P25D: Traffic *CALL ENC PARMS * PEER {e.PeerId} SRC_ID {e.SrcId} TGID {e.DstId} ALGID {channel.algId} KID {channel.kId} [STREAM ID {e.StreamId}]");
} }
@ -525,8 +516,20 @@ namespace dvmconsole
else else
channel.Background = ChannelBox.GREEN_GRADIENT; channel.Background = ChannelBox.GREEN_GRADIENT;
byte[] newMI = new byte[P25Defines.P25_MI_LENGTH]; string alias = string.Empty;
try
{
alias = AliasTools.GetAliasByRid(system.RidAlias, (int)e.SrcId);
}
catch (Exception) { }
if (string.IsNullOrEmpty(alias))
channel.LastSrcId = "Last ID: " + e.SrcId;
else
channel.LastSrcId = "Last: " + alias;
byte[] newMI = new byte[P25Defines.P25_MI_LENGTH];
int count = 0; int count = 0;
switch (e.DUID) switch (e.DUID)

Loading…
Cancel
Save

Powered by TurnKey Linux.