Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/nuget/multi-19ba9b227f
Browse files Browse the repository at this point in the history
  • Loading branch information
mregen authored Feb 6, 2025
2 parents 41b41ab + a1bccf6 commit 04a5338
Show file tree
Hide file tree
Showing 59 changed files with 909 additions and 273 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -266,4 +266,8 @@ OPC\ Foundation/
# UA Fuzzing findings folders
/Fuzzing/**/findings/
/Fuzzing/**/Testcases/
!/Fuzzing/**/Testcases/*.bin
!/Fuzzing/**/Testcases/*.bin
/Fuzzing/Encoders/Fuzz.Tests/Assets/*
/Fuzzing/**/crash-*
/Fuzzing/**/slow-*
/Fuzzing/**/timeout-*
4 changes: 2 additions & 2 deletions Applications/ConsoleReferenceClient/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public static async Task Main(string[] args)
{
CertificateIdentifier userCertificateIdentifier =
await FindUserCertificateIdentifierAsync(userCertificateThumbprint,
application.ApplicationConfiguration.SecurityConfiguration.TrustedUserCertificates);
application.ApplicationConfiguration.SecurityConfiguration.TrustedUserCertificates).ConfigureAwait(false);

if (userCertificateIdentifier != null)
{
Expand Down Expand Up @@ -430,7 +430,7 @@ private static async Task<CertificateIdentifier> FindUserCertificateIdentifierAs
// get user certificate with matching thumbprint
X509Certificate2Collection userCertifiactesWithMatchingThumbprint =
(await trustedUserCertificates
.GetCertificates())
.GetCertificates().ConfigureAwait(false))
.Find(X509FindType.FindByThumbprint, thumbprint, false);

// create Certificate Identifier
Expand Down
9 changes: 5 additions & 4 deletions Applications/ConsoleReferenceServer/UAServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
Expand Down Expand Up @@ -241,18 +242,18 @@ private void PrintSessionStatus(Session session, string reason, bool lastContact
StringBuilder item = new StringBuilder();
lock (session.DiagnosticsLock)
{
item.AppendFormat("{0,9}:{1,20}:", reason, session.SessionDiagnostics.SessionName);
item.AppendFormat(CultureInfo.InvariantCulture, "{0,9}:{1,20}:", reason, session.SessionDiagnostics.SessionName);
if (lastContact)
{
item.AppendFormat("Last Event:{0:HH:mm:ss}", session.SessionDiagnostics.ClientLastContactTime.ToLocalTime());
item.AppendFormat(CultureInfo.InvariantCulture, "Last Event:{0:HH:mm:ss}", session.SessionDiagnostics.ClientLastContactTime.ToLocalTime());
}
else
{
if (session.Identity != null)
{
item.AppendFormat(":{0,20}", session.Identity.DisplayName);
item.AppendFormat(CultureInfo.InvariantCulture, ":{0,20}", session.Identity.DisplayName);
}
item.AppendFormat(":{0}", session.Id);
item.AppendFormat(CultureInfo.InvariantCulture, ":{0}", session.Id);
}
}
m_output.WriteLine(item.ToString());
Expand Down
3 changes: 2 additions & 1 deletion Applications/Quickstarts.Servers/Alarms/AlarmNodeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Threading;
using Opc.Ua;
using Opc.Ua.Server;
Expand Down Expand Up @@ -143,7 +144,7 @@ public override void CreateAddressSpace(IDictionary<NodeId, IList<IReference>> e

Type alarmControllerType = Type.GetType("Alarms.AlarmController");
int interval = 1000;
string intervalString = interval.ToString();
string intervalString = interval.ToString(CultureInfo.InvariantCulture);

int conditionTypeIndex = 0;
#endregion
Expand Down
6 changes: 5 additions & 1 deletion Applications/Quickstarts.Servers/Boiler/BoilerNodeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,11 @@ private static void UpdateDisplayName(BaseInstanceState instance, string unitLab

if (text != null)
{
#if NET6_0_OR_GREATER
text = text.Replace("X0", unitLabel, StringComparison.Ordinal);
#else
text = text.Replace("X0", unitLabel);
#endif
}

displayName = new LocalizedText(displayName.Locale, text);
Expand Down Expand Up @@ -301,7 +305,7 @@ protected override void OnSetMonitoringMode(
{
// TBD
}
#endregion
#endregion

#region Private Fields
private ushort m_namespaceIndex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,11 @@ private IReference NextChild()

for (int ii = 0; ii < name.Length; ii++)
{
#if NET6_0_OR_GREATER
if ("0123456789ABCDEF".IndexOf(name[ii], StringComparison.Ordinal) == -1)
#else
if ("0123456789ABCDEF".IndexOf(name[ii]) == -1)
#endif
{
return null;
}
Expand Down Expand Up @@ -193,7 +197,7 @@ private IReference NextChild()

return new NodeStateReference(ReferenceTypeIds.HasComponent, false, tag);
}
#endregion
#endregion

#region Stage Enumeration
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,11 @@ protected override object GetManagerHandle(ISystemContext context, NodeId nodeId
return null;
}

#if NET6_0_OR_GREATER
int index = id.IndexOf('[', StringComparison.Ordinal);
#else
int index = id.IndexOf('[');
#endif

if (index == -1)
{
Expand Down Expand Up @@ -536,7 +540,7 @@ protected override ServiceResult SetMonitoringMode(

return ServiceResult.Good;
}
#endregion
#endregion

#region Private Fields
private MemoryBufferConfiguration m_configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ public override void CreateAddressSpace(IDictionary<NodeId, IList<IReference>> e
string referenceString = "Has3ForwardReferences";
if (i > 1)
{
referenceString += i.ToString();
referenceString += i.ToString(CultureInfo.InvariantCulture);
}
BaseDataVariableState has3ForwardReferences = CreateMeshVariable(referencesFolder, referencesPrefix + referenceString, referenceString);
has3ForwardReferences.AddReference(ReferenceTypes.HasCause, false, variables[0].NodeId);
Expand Down
18 changes: 17 additions & 1 deletion Fuzzing/Encoders/Fuzz.Tests/Opc.Ua.Encoders.Fuzz.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<Compile Include="..\Fuzz\FuzzableCode.BinaryDecoder.cs" Link="FuzzableCode.BinaryDecoder.cs" />
<Compile Include="..\Fuzz\FuzzableCode.JsonDecoder.cs" Link="FuzzableCode.JsonDecoder.cs" />
<Compile Include="..\Fuzz\FuzzableCode.XmlDecoder.cs" Link="FuzzableCode.XmlDecoder.cs" />
<Compile Include="..\Fuzz\FuzzableCode.Certificates.cs" Link="FuzzableCode.Certificates.cs" />
<Compile Include="..\Fuzz\FuzzableCode.CRLs.cs" Link="FuzzableCode.CRLs.cs" />
<Compile Include="..\..\common\Fuzz\FuzzMethods.cs" Link="FuzzMethods.cs" />
<Compile Include="..\..\common\Fuzz.Tools\Testcases.cs" Link="Testcases.cs" />
</ItemGroup>
Expand All @@ -26,7 +28,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.3">
<PackageReference Include="coverlet.collector" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand All @@ -53,6 +55,12 @@
<None Include="..\Fuzz\Testcases.Xml\**\*.*">
<Link>Testcases\%(RecursiveDir)%(FileName)%(Extension)</Link>
</None>
<None Include="..\Fuzz\Testcases.Certificates\**\*.*">
<Link>Testcases\%(RecursiveDir)%(FileName)%(Extension)</Link>
</None>
<None Include="..\Fuzz\Testcases.CRLs\**\*.*">
<Link>Testcases\%(RecursiveDir)%(FileName)%(Extension)</Link>
</None>
</ItemGroup>

<ItemGroup>
Expand All @@ -68,6 +76,14 @@
<Link>Testcases\%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="..\Fuzz\Testcases.Certificates\**\*.*">
<Link>Testcases\%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="..\Fuzz\Testcases.CRLs\**\*.*">
<Link>Testcases\%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Assets\**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
4 changes: 3 additions & 1 deletion Fuzzing/Encoders/Fuzz.Tools/Encoders.Fuzz.Tools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<Compile Include="..\Fuzz\FuzzableCode.BinaryDecoder.cs" Link="FuzzableCode.BinaryDecoder.cs" />
<Compile Include="..\Fuzz\FuzzableCode.JsonDecoder.cs" Link="FuzzableCode.JsonDecoder.cs" />
<Compile Include="..\Fuzz\FuzzableCode.XmlDecoder.cs" Link="FuzzableCode.XmlDecoder.cs" />
<Compile Include="..\Fuzz\FuzzableCode.Certificates.cs" Link="FuzzableCode.Certificates.cs" />
<Compile Include="..\Fuzz\FuzzableCode.CRLs.cs" Link="FuzzableCode.CRLs.cs" />
<Compile Include="..\..\common\Fuzz\FuzzMethods.cs" Link="FuzzMethods.cs" />
<Compile Include="..\..\common\Fuzz.Tools\Program.cs" Link="Program.cs" />
<Compile Include="..\..\common\Fuzz.Tools\Playback.cs" Link="Playback.cs" />
Expand All @@ -20,7 +22,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="SharpFuzz" Version="2.1.1" />
<PackageReference Include="SharpFuzz" Version="2.2.0" />
<PackageReference Include="Mono.Options" Version="6.12.0.148" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.1" />
<PackageReference Include="Serilog" Version="4.2.0" />
Expand Down
Loading

0 comments on commit 04a5338

Please sign in to comment.