Commit Graph
66 Commits
Author SHA1 Message Date
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
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
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
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
Randy Armstrong e016a9bb29 Fix unit tests errors. 2021-02-05 23:53:30 +09: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
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
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
Alin Moldovean 4be8c87903 Suppress server nonce validation errors in Client Session for encrypted channels (#1165)
* Implement the mitigation against weak nonce for CVE2019-19135.
* Suppress server nonce validation errors for user tokens in Client Session for encrypted channels.
* This change allows client interoperability with some legacy servers that do not comply with the specification for nonce usage of user token encryption. 
* The workaround for servers which can not connect due to a weak nonce is to use an encrypted channel, then the token is protected and the threat is mitigated.
2020-10-23 10:01:12 +02:00
Martin Regen 7f3f0dbbb4 Service update, fix many warnings for Xml comments (#1146)
- no bug fixes, just documentation and formatting
- fix all warnings for xml in core libraries, except
-- protected members
-- suppressed warnings in Opc.Ua.Gds libraries (tbd)
2020-10-14 12:00:01 +02:00
AlinMoldovean 764c481405 Update Copyright year to 2020 2020-10-07 18:04:34 +03:00
AlinMoldovean 00f718c28f Update NodeSet files and generated code for 1.04.7 Errata. Fixes #1127 2020-10-07 17:52:01 +03:00
Martin Regen 838b99806d Reverse connect improvements for aggregation server (#1073)
- This improvement was tested with an aggregation server update on this branch:

Required for testing: https://github.com/mregen/UA-.NETStandard-Samples/tree/aggregationserver

Main changes: 
- Support holding of reverse connections, then a client can connect faster on a hold connection instead of waiting for the next reverse hello.
- Simplify API to connect with or without reverseconnect manager.
- Reconnect handlers code path added, tested with SessionReconnectHandler
- some locks on lists were not correctly implemented.
2020-08-13 12:50:17 +02:00
Alin Moldovean cf44debd5e ReverseConnectServer improvements (#1083)
* ReverseConnectServer improvements.
2020-08-07 10:48:28 +03:00
Martin Regen 46cd2d990a - Add the reverse connect in the reference server and a few bug fixes (#1071)
- Support the reverse connections in the reference server
- fix an issue when the anonymous token is sent as a null value by the aggregation server
- fix docker build files
2020-07-30 11:48:28 +02:00
Martin Regen e7d8214798 Fix for self signed certs (#1036)
- The self signed certs should have the CA flag set
- small cleanup fixes for cert code
- make sure public key is always disposed
- breaking change: defaults for certs naming convention was not quite right and it should be a readonly, to make sure policy changes are reflected in calling code
- add test cases for validation of extension
2020-07-06 18:40:51 +02:00
AlinMoldovean e6a22bc8f2 UANodeSet.Export() fix for MethodDeclarationId of method nodes. 2020-06-24 11:23:12 +03:00
AlinMoldovean c7348b7ba8 Fix for Extensions filed in UANodeSet.Import()/Export() 2020-06-23 15:01:59 +03:00
Martin Regen 2e47eaa44f Support Reverse Connect in the stack with samples (#998)
- Ported from prototyping branch in .Net Legacy stack
- Client and server support
- Aggregation server sample
- .Net Core samples

more info in docs/ReverseConnect.md
2020-06-03 16:48:25 +02:00
Martin Regen 5c2ac912c0 Propose removal of unsupported code in Opc.Ua.Configuration (#985)
- removes the InstalledConfig.xsd 
- remove non functional run as a service other windows specific code
- remove few references to OPC Classic / COM
2020-06-03 08:09:33 +02:00
AlinMoldovean 94097b7a79 - Check for aliases in ImportNodeSet() for ExpandedNodeId values. 2020-05-19 17:26:47 +03:00
Alin Moldovean 81832f71a3 Update UA-Nodesets and generated code (#925)
* Update generated code and UA-nodeset files for 1.04.5 Errata

* Update UA-Nodeset files and generated code of Sample projects with latest version of ModelCompiler
2020-03-20 14:43:25 +02:00
Alin Moldovean 3e640bf702 Update UA NodeSets and generated code (#895)
* Update UA NodeSets and generated code with the latest updates for 1.04.04 Errata Release.

* Revert error in generated code.
2020-01-30 16:08:19 +02:00
Alin Moldovean 636f5c03f9 Implement validation for duplicate nonces (#893)
* - Add Server nonce validation for duplicate nonces.
- Add configuration flag to bypass validation exceptions

* Add ITransportChannel.CurrentToken interface for nonce validation.
2020-01-30 15:06:13 +02:00
AlinMoldovean bcccd718a4 Fix for handling of AccessLevel and AccessLevelEx attributes. 2020-01-14 18:00:23 +02:00
Kurt 300d9ffd62 Minor analyzer (roslynator) fixes (#880)
* Use nameof() where applicable

Category: Maintainability
https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1015.md

* Rethrow original exception

Preserves original stack trace of the exception, easier to diagnose
Category: Maintainability
https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1044.md
https://stackoverflow.com/a/178464

Remove variable from the catch if not logged (compiler warning).

* Combine Where->FirstOrDefault, use Find if applicable

Category: Performance
https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1077.md

In ApplicationConfiguration:
ServerSecurityPolicyCollection inherits from List<T>, so use List.Find (better performance than FirstOrDefault)

* Use List.Count rather than LINQ Any()

Category: Performance
https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1080.md
refsToRemove is a List<T>, which we know the count of (no need to iterate).

* Add [Flags] Attribute for OpenFileMode

Each enum is a bitflag here
Just noticed this is in the "Generated" folder... some prior commits had touched other "Generated" files -- see nameof commit.

* Minor performance behavior

- EventArgs.Empty instead of allocating a new blank EventArgs

It only really happens on Connect/Disconnect so it's not like a single allocation really matters

- Use array[0] instead of First()
https://stackoverflow.com/a/25607951
- Use !Any() instead of Count() == 0
If a dependent field is found, it will stop evaluating the rest and Add instead of Insert. Count() == 0 required evaluation of all

- Use All() instead of FirstOrDefault(any) == null
Clearer intent (all are not matching the group BrowseName => clear default)
Slightly faster as the first match found doesn't have to be compared against null

* Revert changes to generated files

* Fix mistake

fixes compile error
2020-01-09 09:28:37 +02:00
AlinMoldovean ba620f2a08 Implement import of DataTypeDefinition attribute from NodeSet files. 2019-12-06 10:24:32 +02:00
Martin Regen ef06464776 fix schema validator and dictionary loader (only binary) (#833)
* fix schema validator and dictionary loader (only binary scheme)
# include some .bsd files for validation
* add check for some configuration fields, to return a meaningful error.
2019-10-29 18:16:37 +01:00
AlinMoldovean df0cc4287d #791 - Update UA NodeSets and generated code with the latest updates for V1.04.3 Errata. 2019-10-02 17:44:53 +03:00
Sebastian Bäumler f6a70031e1 Improvements to enable UANodeSet to import/export AccessLevelEx as uint32 (#815) 2019-10-02 16:39:04 +03:00
AlinMoldovean f062bfdc89 Compliance fixes in CertificateValidator.
Added setting in SecurityConfiguration to require revocation lists for all CAs
2019-05-21 17:42:59 +03:00
Octavia Stan 7a30aa1d26 Add Extension property to NodeSet to enable usage of Extension property of an imported/exported UANode
Add correction to UserAccessLevel at import time if it was not specified
Add correction to UserWriteMask at import time if it was not specified
Use MethodDeclarationId from an UANode at import time
2019-03-21 12:35:59 +02:00
AlinMoldovean 8b374a7448 Copyright year set to 2019 in license notices. 2019-02-14 12:34:33 +02:00
Alin Moldovean ea1911c4a1 Update UA NodeSets and generated code with the latest fixes for V1.04 (#637) 2019-02-05 16:00:12 +02:00
Martin Regen d007a41d15 Add Aes profile support (#574)
* add the Aes128 and Aes256 profiles
* Aes profies were tested on IoP workshop against Ascolab, Softing, Matrikon, Milo, ProSys and others
* Pss padding is not supported on all platforms, so autodetect if it is supported and filter out Aes256 if not
* not a breaking change: not specifying the SecurityProfileUri in the config xml will automatically add all supported profiles but not deprecated profiles (e.g. Basic256Sha256, Aes128, Aes256). Aes256 is only added if the platform supports Pss padding. This will simplify the maintenance of config xml, since automatically all supported and secure profiles are exposed.
2018-10-29 09:58:45 +01:00
AlinMoldovean 036320221b Create custom configuration settings and validators for user certificates. #383 2018-08-06 17:13:49 +03:00
Alin Moldovean 0d08d40180 Update NodeSets and generated code with latest fixes for V1.04 (#487)
Update NodeSets and generated code with latest fixes for V1.04 Errata
2018-06-26 09:29:36 +03:00
Martin Regen 3c1159ec71 add v1.04 caps (#406) 2018-03-26 10:39:46 +02:00
AlinMoldovean 3cdfe56f32 NodeSets and generated code updated to include UserCredentialCertificateType 2018-03-19 12:35:09 +02:00
Martin Regen bc78cded47 Merge pull request #387 from OPCFoundation/v1.03
reverse integrate V1.03 to master
2018-03-08 20:53:35 +01:00
AlinMoldovean 6ba20ba31a fix tabs in ApplicationConfiguration.xsd 2018-03-07 18:53:36 +02:00
AlinMoldovean 17dc14bcc5 Implement #362 - Certificate chain support. 2018-03-07 18:44:00 +02:00
AlinMoldovean 0894364ca9 #363 - Generated code and NodeSets for V1.04 OPC UA Specifications 2018-02-22 13:41:30 +02:00
Martin Regen 9926e40be8 my own CR feedback 2017-12-06 16:55:43 +01:00
Martin Regen 09fbb05752 Gds work travis (#32)
fix appveyor and travis builds
2017-11-15 09:45:28 +01:00
Martin Regen 915ad5b87c - add cert configuration nodes
- Update cert and sign request is still missing
- no security!
2017-11-07 16:33:15 +01:00
Martin Regen d2566c60bd X509store mac fix and travis improvements (#264)
* X509store mac os (#31)

* Fix problem when X509Store CurrentUser\\UA_MachineDefault cannot be created on macOS with .NetStandard2.0
Fix: Use CurrentUser\My instead for all machine certs to make console apps portable.

* prep console sample apps for smoke test
* update travis image
* run sample server and client as smoke test


* ignore travis osx build failure until travis is fixed
2017-10-12 11:16:09 +02:00
Martin Regen 075909f613 add servercapabilities.csv to core 2017-08-19 18:02:12 +02:00
Martin Regen ca9a17dd77 add ServerProfileArray to Base Info Server Caps 2017-06-20 14:47:26 +02:00