Commit Graph

491 Commits

Author SHA1 Message Date
Alin Moldovean 923597eac2 improve encode/decode for array/matrix of Iencodeable (#1398)
Add tests for encode/decode of array/matrix of all IEncodeable
2021-05-12 15:10:11 +03:00
Alin Moldovean a5e1f4c8cd PubSub fixes (#1394) 2021-05-12 13:33:29 +03:00
Nyphus 244b26e22f Port thread scheduler and servicehost from UA .NET legacy. (#1389)
* Add minThreadCount and maxThreadCount setting for ThreadPool
* Port thread based scheduler back from UA.NET legacy. 
* The UA Expert perf test shows better response times than Task.Run implementation. 
* Old implementation to compare against is ifdefed,
* Port servicehost from UA.NET legacy
* a few minor backports in serverbase e.g. alias names for hostname
* fix editorconfig, as it caused false positives in ref server

Co-Authored-By: macheronte <79026457+macheronte@users.noreply.github.com>
2021-05-04 15:39:17 +02:00
Martin Regen 7e736d22fc Improve auto accept in cert validation handler, add tests (#1386)
- if a cert validator is enabled, use it and ignore auto accept flag.
- trace auto accept message, if used
- make all config flags public, otherwise they can only be configured using a SecurityConfiguration. Once a config flag is set using a property, it is protected from modification by a SecurityConfiguration. This way apps can consistently override.
- add tests for the SHA1 and AutoAccept configuration flags
- add a method to reset the validated list of certificates. The list of certs should be revalidated from time to time to catch expired or revoked certificates. Applications can call `ResetValidatedCertificates` to clear the list with a daily timer.
2021-04-30 10:27:02 +02:00
Martin Regen 631e729787 Fix warnings, improve complex type exception handler (#1384)
- catch exception in complex type system not only for ServiceResultException
- add fast path for single type loader if type already exists
- fix many warnings, no function change
- fix template for legacy nuget packages to include cert lib
2021-04-28 18:34:43 +02:00
Sebastian Baeumler e8df315193 ComplexTypes Improvements (#1383)
- Fixed typo in StructureDefinitionAttribute
- Adapt using of fixed StructureDefinitionAttribute
- Resolve method internal name conflict
- Enable TypeInfo.GetSystemType to support ExpandedNodeId
- Redirect request with absolute NodeIds an directly use the EncodableFactory.GetSystemType method
2021-04-28 15:08:14 +02:00
Alin Moldovean 7a4a22201b MQTT support in PubSub library (#1376)
Implementation of MQTT support in PubSub library
2021-04-28 15:31:06 +03:00
Alin Moldovean f0c467410e Implement AutoAcceptUntrustedCertificates flag for Client side also. Fixes #1228 (#1380) 2021-04-26 17:00:23 +03:00
Martin Regen e34eb9b512 Fix Perf warnings (#1372)
- use Array.Empty
- improve StringBuilder, Where
- use .Equals instead Compare
- use ConfigureAwait
2021-04-21 09:28:25 +02:00
Alin Moldovean 087415be1b Complex data types fix for passing TypeId to IComplexTypeInstance (#1371) 2021-04-20 18:44:58 +03:00
Martin Regen 77a3da8ecd Prohibit Xml Dtd processing (#1370)
- enable CA3075 as warning (on windows)
- Dtd processing is by default not prohibited, only limited to 10000000 chars.
- ensure to only use safe defaults for all xml processing
2021-04-20 10:45:50 +02:00
Martin Regen c996e7933d Add ifdef to support Net5.0 build with ECC support (#1367)
- for dev only ifdefs,  but not added to target props
2021-04-19 10:42:26 +02:00
Alin Moldovean 901a1715e9 Fixes #1140 - Ensure UserTokenPolicy.policyId is unique within the context of the server. (#1357)
Fix #1140
2021-04-13 10:00:38 +03:00
Alin Moldovean cb1abb1ec3 Implement encoders support for Arrays and multi-dimensional Arrays. (#1350)
* Implement encoders support Arrays and multi-dimensional Arrays.
* JsonEncoder/Decoder fix for non reversible encoding of NodeId, ExpandedNodeId and QualifiedName
2021-04-07 14:40:40 +03:00
Martin Regen 1d5e87c784 Remove RSA dispose special handling for Mono (#1347)
-Issue has been fixed in Mono, no more workarounds
-Fixes #1214 
-fix some Roslynator and other warnings
2021-04-01 14:32:20 +02:00
Martin Regen 25e0998081 Create codeql-analysis.yml (#1345)
-Add CodeQL code scanner
-EnableNetAnalyzers
-small tweak for .editorconfig
2021-04-01 08:55:42 +02:00
opcfoundation-org 0f97945858 Modelcompiler updates, errata 1.04.9 nodeset (#1284)
- Use updated Modelcompiler code generator to produce code which has no dependency on System.Servicemodel
- breaking change, .NET stack which used the NET_STANDARD version have to fix dependencies on System.Servicemodel
- new codegenerator also provides stubs for async client API (NET_STANDARD_ASYNC), currently disabled
- latest V1.04.9 Nodeset
2021-03-29 17:19:49 +02:00
Alin Moldovean 20957233ae Allow to set HiResClock Enabled/Disabled only once. Fixes #1269 (#1341)
fixes #1269 
- Add a reset method for testing
2021-03-26 21:35:17 +01:00
tobiasdroessler d9498f523c bugfix in RelativePath.ParseName(..): update variable last for loop i… (#1330)
* bugfix in RelativePath.ParseName(..): update variable last for loop increment statement to keep it for further processing
2021-03-24 10:04:35 +02:00
Camille Guérin be1aadeaf5 Fixed FormatException and Fixed missing sourcePicoseconds in DataValue Equals (#1335)
* Fixed FormatException

* Fixed missing sourcePicoseconds in DataValue Equals
2021-03-23 13:35:16 +02:00
Alin Moldovean 0ebe579448 Fixes #1300 - Minor fix in NodeId constructor comment. (#1326)
* Fixes #1300 - Minor fix in NodeId constructor comment.

* Minor fix in NodeId constructor comment.
2021-03-23 13:34:36 +02:00
Jonas Arndt bcfed5e698 Fix: Format Exception (#1307)
fixed the index in a format string
2021-03-08 09:41:50 +02:00
Alin Moldovean c541994ca2 Limit recursion level in XmlDecoder.ReadMatrix() and XmlEncoder.WriteMatrix() (#1295) 2021-02-25 09:25:23 +02:00
Martin Regen 46ada27179 Add certificate password provider interface to support password protected pfx files. (#1291)
* Add a certificate password provider.
2021-02-23 11:31:42 +02:00
Lyubomyr Vyhovskyy 61eede8628 Fix issue with https binding .net core 3.0 #1283 (#1286)
commenting out Kestrel listenOptions.NoDelay b/c:
1. the default value = true
2. it was removed in .net core 3.0 and this can be configured in SocketTransportOptions

fixes #1283
2021-02-15 15:23:29 +01:00
Randy Armstrong e016a9bb29 Fix unit tests errors. 2021-02-05 23:53:30 +09:00
Randy Armstrong c22ecec8f5 Fix XmlEncoder. 2021-02-05 19:14:10 +09:00
Randy Armstrong 1305e94182 Merge model compiler fixes with latest code. 2021-02-05 18:35:53 +09:00
Archie Miller a2e8489d91 Fix Issues 1274 and 1275 (#1277)
* Fix Issues 1274 and 1275
* Update Documentation for Publicly visible UnshelveTimeUpdateRate
* Adds a timer specifically to update UnshelveTime periodically.
* Initializes Unshelve to double maximum value or MaxTimeShelved if it exists, even for OneShotShelve method calls (Mantis 6462).
2021-02-04 18:16:12 +01:00
Bill Berry e138777638 fix comment spelling mistakes - 'refernces' to 'references' (#1273) 2021-02-03 11:14:45 +02:00
dependabot[bot] 9ce1c33b78 Bump System.ServiceModel.Primitives from 4.8.0 to 4.8.1 (#1268)
Bumps [System.ServiceModel.Primitives](https://github.com/dotnet/wcf) from 4.8.0 to 4.8.1.
- [Release notes](https://github.com/dotnet/wcf/releases)
- [Commits](https://github.com/dotnet/wcf/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-02 07:36:16 +01:00
Archie Miller fac8ed2fc8 Fix issue setting empty comments Issue #1264 (#1265)
* Fix issue setting empty comments

On Acknowledge and Confirm, if a comment with an empty Locale and empty Text is passed from the client, then the comment should remain untouched.
Also fixed issue when firing an event, clearing the change mask on all children of the alarm will update any monitored item watching the alarm parameters, like Comment, EventId, etc.

fixes #1264
2021-01-29 16:08:41 +01:00
Alin Moldovean b363442ffd Set TypeId for structured types at decode. (#1260) 2021-01-29 10:39:42 +02:00
Martin Regen 4a14df9cd5 Fix build and LGTM warnings (#1251)
- Fix only build and LGTM warnings
- no bug fixes - - oh wait -- found and fixed root cause for flaky builds, forgotten await when add cert to trusted folder
- remove source files from WinForms libraries which are not used in the projects
2021-01-20 20:18:36 +01:00
Martin Regen 32dc6bcacc Private key is not stored to the Windows certificate store when using .NET Standard 2.1 (#1244)
- added test cases to repro fact
- added code to transfer ephemeral private key to persisted state as suggested by @ChristofferGersen pointing to  dotnet/runtime#29144 
- fixes #1238
- note: on .NET Standard 2.1 with this change the private keys stored in the windows certificate store are not exportable
2021-01-19 16:30:24 +01:00
Alin Moldovean 97c22fdd25 Method calls validation for Executable and UserExecutable. Fixes #1190 (#1246) 2021-01-18 10:32:14 +02:00
Сергей 1102853812 Use monotonic timer for HiResClock and fix loss of monitored items when system time is changed (#1124)
Thanks @MyLastAngel for your contribution!

- Solves an issue when MonitoredItems are lost, when system time is changed.
- Use HiResClock.TickCount64  when update nextSamplingTime.
- Update HiResClock class with method of TickCount64 for use as monotonic timer
2021-01-15 07:44:32 +01:00
Alin Moldovean 333aadc6f3 Compliance fixes in ReferenceServer (#1241)
Compliance fixes for certificate validation.
Add config flag in ReferenceServer to specify whether  Certificate dialog should be displayed.
2021-01-14 13:52:51 +02:00
Alin Moldovean 16ff6511f2 PubSub Support for UADP (#1195)
* Add PubSub library and console samples. #1169
2021-01-08 17:48:09 +02:00
Martin Regen bfa117b7a7 Implement an AcceptAll flag in the cert validator callback (#1230)
- The AcceptAll flag can be used to accept all suppressible errors in one call back
- Behaviour unchanged when only Accept is set, callback is invoked for all errors and all must be approved
2021-01-07 10:16:07 +01:00
Martin Regen 4752a808df Validate server domains in Cert validator (#1226)
- Based on new handling of multiple suppressible errors, add also the domain check to the list
- Move domain check in validator and use cert validation callback to handle BadCertificateInvalidHostname.
- Allow to handle all suppressible errors including the domain check by the cert validator callback, approve all errors by new AcceptAll flag. Applications which only set Approve are called for each of the suppressible errors and must approve eah of them.
- Add approval of multiple errors to sample UI
- fix a few warnings
2021-01-07 09:26:14 +01:00
Martin Regen ac8e358c2c Escape special characters in JSON fieldnames (#1224)
- Values were properly escaped, field names not.
- Fix fieldname encoding in various places
- Tests to verify strings are escaped in all codepaths.
- Fixes #1210
2021-01-04 14:49:17 +01:00
Martin Regen 8c216e78f4 Replace CRLF in debug strings with AppendLine and improve cert validator tests (#1220)
- improve cross platform support, replace CRLF by AppendLine 
- replace $format trace messages with {} style
- fix warnings for comments and protected fields, null parameter checks
- replace cert factory calls with new API (obsolete warnings)
- allow to run cert validator tests in parallel using new temp cert validator class
- more test cases for cert validator, e.g wth cert validation callback
- improve cert validator for special cases
2020-12-23 00:17:09 +01:00
ThomasNehring d815cfb972 Improve handling of certificate validation (#1217)
The change ensures that all certificate validation failures (except those related to the hostname of a server) are stacked in the right order into a service result, which -- if not empty -- in the end is raised in a service result exception.
The single point where knowledge about suppressible changes is needed is the place in Validate, where that exception is caught.
2020-12-18 15:29:17 +01:00
dependabot[bot] 52754f4814 Bump System.ServiceModel.Primitives from 4.5.3 to 4.8.0 (#1182)
Bumps [System.ServiceModel.Primitives](https://github.com/dotnet/wcf) from 4.5.3 to 4.8.0.
- [Release notes](https://github.com/dotnet/wcf/releases)
- [Commits](https://github.com/dotnet/wcf/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-16 20:41:04 +01:00
Martin Regen f904139298 Refactor CertificateFactory, remove bouncy castle dependency in Opc.Ua.Core for .NET Core 3.1 (#1209)
- remove use of Bouncy Castle for .NET Core 3
- refactor CreateCertificate class to allow for an easier Create fluent model with respect to future extensions, e.g. ECC
- reimplement X509CRL and a couple of extension relevant for OPC UA based on the new System.Formats.Asn1 library
- use CertificateRequest on .NET Core 3.1
- refactor codebase to allow for a seperate library to handle all the ASN.1 encoding/decoding
- new package Opc.Ua.Security.Certificates with all ASN.1 encode/decode related code
breaking change: many  X509 related util functions were moved to X509Utils class
Note: .NET 4.6.2 and .NET Core 2.1 versions still use BouncyCastle for Cert creation
2020-12-13 18:17:54 +01:00
Alin Moldovean e53d97d9ae Set ParentNodeId of nodes at import from NodeSet2 files. (#1212) 2020-12-10 16:11:54 +02:00
Erich Barnstedt c171b14c7e Fix spelling in cert validation service results. (#1211) 2020-12-09 16:49:21 +01:00
Logan Komanetz 34d0af8dd6 Removes assigning a new instance of CertificateValidator in ApplicationConfiguration (#1161)
* Removes assigning a new instance of CertificateValidator in ApplicationConfiguration.Validate method by assigning it on construction.  
* Refactors the code to use 'using' statements for streams and LINQ expressions.
* Makes the CertificateValidator member readonly
* Removes read-only status of CertificateValidator and adds unit test to ensure it is assignable from outside the class.
2020-11-14 11:15:01 +01:00
Martin Regen 346c4e30c5 Fix codecov upload and Nuget builds (#1175)
- codecov couldn't resolve the source files when deterministic builds are enabled. Run codecoverage with det build option disabled.
- nuget preview build was broken, added ci build for packing libraries.
- add console client to ci build
- fixes #1173, fix dockerfile to use .NET Core 3.1 base image
2020-11-04 09:12:28 +01:00