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.Input;
using System.Windows.Media;
using fnecore;
using fnecore.DMR;
using fnecore.P25;
@ -411,6 +413,10 @@ namespace dvmconsole.Controls
SystemName = $"System: {systemName}";
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.Level = 0;

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

@ -287,21 +287,21 @@ namespace dvmconsole
callHistoryWindow.AddCall(cpgChannel.Name, (int)e.SrcId, (int)e.DstId, DateTime.Now.ToString());
callHistoryWindow.ChannelKeyed(cpgChannel.Name, (int)e.SrcId, false); // TODO: Encrypted state
string alias = string.Empty;
try
{
alias = AliasTools.GetAliasByRid(system.RidAlias, (int)e.SrcId);
}
catch (Exception) { }
channel.Background = ChannelBox.GREEN_GRADIENT;
}
if (string.IsNullOrEmpty(alias))
channel.LastSrcId = "Last ID: " + e.SrcId;
else
channel.LastSrcId = "Last: " + alias;
string alias = string.Empty;
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 ((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);
// 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.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)
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
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;
switch (e.DUID)

Loading…
Cancel
Save

Powered by TurnKey Linux.