Commit Graph

549 Commits

Author SHA1 Message Date
mrsuciu f9a65094b9 Eliminate duplicate endpoints when Configured base addresses differ by port only 2022-01-27 15:17:59 +02:00
Martin Regen ac131518be ctt fixes (#1685)
* remove the SetDurableSubscription method, to skip the test cases
* DeleteSubscription returns BadSubscriptionIdInvalid
* MethodState return also BadTooManyArguments
* return AttributeIdInvalid for null attributes (fix UA Expert display)
* fix ToString of Variant array of ByteString
* fix Variant decoding 1-dim array of bytestring
2022-01-27 11:37:08 +02:00
mrsuciu e5121742a1 Assign a default value to anu variable in namespace 0 2022-01-27 11:28:20 +02:00
mrsuciu b638bb48b7 Set status code Good for all BaseVariableState in namespace 0 2022-01-27 09:09:11 +02:00
Martin Regen d37a3a1226 revert writer change 2022-01-21 14:31:29 +01:00
Martin Regen ae9ecac2be Fix a problem when a new private key can not be reloaded in virtualized environments. 2022-01-21 14:20:15 +01:00
mrsuciu 3574d17c05 Back ported log error message. 2022-01-20 09:30:12 +02:00
Martin Regen c3541ca3d0 Fix Authority Key Identifier in SubCA and cert validator return codes. (#1665)
- AuthorityKeyIdentifier in the SubCA contains the SubjectName of the Issuer instead of the IssuerName. Also an application certificate that is signed by a SubCA would contain the false information.
- The false information has no effect on Windows and macOS, however on linux OpenSSL tests all fields and a chain cannot be fully validated.
- For CTT tests a few error codes were return false codes because ServiceResult replaces the error code with the InnerException error.
- Do not allow to ignore PartialChain validation error, it may have different root cause then the error returned by GetIssuer.
2022-01-20 07:32:30 +02:00
Michi aaeba3534e Fix: Server endpoints are not returned if GetHostEntry fails. (#1639)
Fix: Server endpoints are not returned if GetHostEntry fails.

* User had issues with DNS server which caused Dns.GetHostEntry to throw SocketExceptions.
* It caused that OPC UA servers couldn't return their endpoints to remote machines.
* fix catches the SocketExceptions on Dns.GetHostEntry.
2022-01-20 07:32:17 +02:00
Suciu Mircea Adrian 54511491eb Added BitwiseAnd and BitwiseOr filter operators and unit tests for existing filter operators (#1633)
* Added BitwiseAnd and BitwiseOr filter operators

* Added positive unit tests for filter operators; Changed Cast BitwiseAnd and BitwiseOr operators to return boolean values or null

* BitwiseAnd and BitwiseOr return the operation value; Improved unit tests

* Added missing handling of BitwiseAnd and BitwiseOr filter operators under the ContentFilterElement.Validate and ContentFilterElement.ToString methods

* Changed Cast operator to return value instead of bool; Fixed typos and adapted unit tests
2022-01-20 07:31:55 +02:00
Suciu Mircea Adrian cf95cb9823 Improve initalization of BaseVariableState (#1671) 2022-01-20 06:51:18 +02:00
Suciu Mircea Adrian 79e9463b7f Set the default value of the StatusCode on BaseVariableState to BadWaitingForInitialData. (#1669)
* Removed assigning a default value to any variable value in the AddReverseReferences method.
Set the default value of the StatusCode on BaseVariableState to BadWaitingForInitialData.

* Allow initalization from variable states with status code BadWaitingForInitialData
2022-01-19 09:25:58 +02:00
Suciu Mircea Adrian c90ba80073 The UserToken PolicyId is made unique per server instance (#1664)
* The UserToken PolicyId is made unique per server instance as in the specification.
2022-01-14 11:36:44 +02:00
opcfoundation-org 985035bdf7 Modelcompiler 1.04.10 (#1627)
Replace the xml versions with properly tagged 1.04.10. 
Note -- this merge does not require a rebuild of the Opc.Ua.Core library.
2021-12-05 11:09:04 +01:00
opcfoundation-org edadaa8eab Revert MethodDeclarationId change due to breaking code. (#1615)
* Revert MethodDeclarationId change due to breaking code.

* Delete duplicate of Opc.Ua.Nodeset2.xml

Co-authored-by: Randy Armstrong <randy@sparhawksoftware.com>
Co-authored-by: Martin Regen <mregen@microsoft.com>
2021-12-03 12:48:10 +02:00
Martin Regen 47370a953f Bump up Nuget packages to 6.0.0 (#1617)
* update package to 6.0

* bump
2021-11-29 11:01:51 +02:00
Martin Regen 2430a651ea Enforce Roslynator checks in CI build (#1608)
- The ci pass includes Roslynator checks, fails on warnings
- Fix all existing warnings
2021-11-24 14:44:31 +01:00
opcfoundation-org fdf31dca76 Modelcompiler 2021 11 24 (Fixes for MethodDeclarationId) (#1612)
- ModelCompiler Fixes for MethodDeclarationId
- Previous fix not only removed TypDefinitionId in certain cases but also removed the MethodDeclarationId
- This backward compatible fix should work with old and new nodeset files
2021-11-24 14:31:39 +01:00
Martin Regen 486e97b9b5 Fix export of TypeDefinitionId (#1604)
- the previous fix to remove TypeDefinitionId caused a regression with Alarms (#1574/#1576)
- This is a backward compatible fix to remove the TypeDefintionId where it is not needed in the nodeset but still fill the MethodDeclarationId.
2021-11-24 07:59:40 +01:00
Suciu Mircea Adrian 4137cfdd02 Binding to a specific NIC is implicitly implied when an IP address is specified instead of a hostname (#1596); should fix issue #1581
* Binding to a specific NIC is implicitly implied when an IP address is specified instead of a hostname; Removed the redundant flag BindToSpecifiedAddress.
2021-11-17 10:57:55 +02:00
Martin Regen 3b233c6f55 Bug fixes in ref server and more tests cases (#1590)
- fix the complex types of the test nodeset (requires https://github.com/OPCFoundation/UA-ModelCompiler/pull/96)
- improve some client / server tests
- add tests for complex types datatype definition integrity on ref server, validate bsd and xml dictionaries in the test server (open issue:  https://mantis.opcfoundation.org/view.php?id=7393, xml validation always failing)
- improve server fixture, to allow for custom config changes 
- fix an issue that caused kestrel not start on windows/.NET Core 3.1 and above, when a new certificate was issued, thereby ignoring all https client tests.
2021-11-11 06:39:23 +01:00
Martin Regen 860c9686c9 fix uncontrolled format string and clear text storage of sensitive information (#1591)
- fix uncontrolled format string and clear text storage of sensitive information issues flagged by CodeQL
2021-11-10 13:06:59 +01:00
Martin Regen e61594eff5 CI support for .NET 6.0 builds, tests and Nuget (#1580)
- Add pipeline steps with VS2022 hosted images and .NET 6 install on linux/mac
- Nuget build with net6.0 binaries
Co-authored-by: mrsuciu <Mircea-Adrian.Suciu@softing.com>
2021-11-09 07:56:45 +01:00
Suciu Mircea Adrian 372449b222 Definition is enumeration if at least a field is not default value -1, since there is a very small probability for an enumeration to contain one field only (#1579) 2021-11-08 07:57:04 +02:00
Alin Moldovean ea3444b9c4 Performance update - Add IEquatable interface for DataValue (#1577)
* Add IEquatable interface for DataValue, StatusCode and NumericRange types

- Performance update

Implement strongly typed Equals() method and IEquatable for DataValue, StatusCode and NumericRange types so no boxing is required.
This brings a performance improvement for servers with high number of dynamic nodes and monitored items created where the compare method of DataValue is called intensively (100k -200k/sec)
2021-11-05 11:03:17 +01:00
Martin Regen 7acddc0923 Fix binary export of surplus typedefinition (#1576)
- HasTypeDefinition and TypeDefinitionId should only exist for Object/Variable in .uanodes
- fix binary export for .uanodes
- #1574 missed the binary output case, only fixed xml export
- fixes #1532 
- fixes https://github.com/OPCFoundation/UA-ModelCompiler/issues/94
- fix the default and sample models in this repo

note --> ModelCompiler needs to use the updated core lib to produce the same output
2021-11-04 08:37:22 +01:00
Suciu Mircea Adrian f090f618aa Added null check to structureType.DefaultEncodingId (#1571)
Added null check to structureType.DefaultEncodingId in the ReadNonValueAttribute method
2021-11-02 13:02:18 +01:00
opcfoundation-org 0915063175 on node export only output TypeId for vars/objects (#1574)
only output the DataTypeDefinitionId and ReferenceTypeId vor var/objects
fixes nodeset output of #1532 
fixes OPCFoundation/UA-ModelCompiler#94
2021-11-02 13:00:53 +01:00
Martin Regen 49b7f93302 Fix VS2022 build (#1566)
- add build targets for net6.0
- fix new warnings in VS2022 compiler
2021-11-02 08:03:44 +01:00
Martin Regen 96eb6c8a27 fix subcode mask (#1563) 2021-11-01 16:26:45 +02:00
dependabot[bot] e72417eb92 Bump System.Text.Encodings.Web from 4.5.1 to 5.0.1 (#1569)
Bumps [System.Text.Encodings.Web](https://github.com/dotnet/runtime) from 4.5.1 to 5.0.1.
- [Release notes](https://github.com/dotnet/runtime/releases)
- [Commits](https://github.com/dotnet/runtime/commits/v5.0.1)

---
updated-dependencies:
- dependency-name: System.Text.Encodings.Web
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-01 15:40:57 +02:00
dependabot[bot] 1e5c63b7d6 Bump System.Io.Pipelines from 4.5.4 to 5.0.1 (#1570)
Bumps [System.Io.Pipelines](https://github.com/dotnet/runtime) from 4.5.4 to 5.0.1.
- [Release notes](https://github.com/dotnet/runtime/releases)
- [Commits](https://github.com/dotnet/runtime/commits/v5.0.1)

---
updated-dependencies:
- dependency-name: System.Io.Pipelines
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-01 13:37:21 +02:00
Martin Regen 53ec78f1bc IOP workshop 2021 fixes and build improvements (#1562)
-fixes for complex types:
  - a structure which contains an enum from namespace 0 can not be created. fixes #1561.
  - a structure with multidimensional array may lead to a endless loop in `ComplexTypeSystem.Load`
  - a malformed namespace Uri which contains a space character prevents creation of type system.
  - select endpoint doesn't pick the right scheme if the default endpoint must be picked
-prep for net472 or greater and net5.0 or greater build, only build #ifdef
2021-10-29 16:21:43 +02:00
bdovaz c53807a201 Remove unnecessary Nuget dependencies in Opc.Ua.Core (#1551) 2021-10-22 11:45:46 +02:00
Martin Regen 14e7c67a5c Add sample node managers to ref server (#1535)
- add boiler, data and memory buffer sample node managers to reference server
- exclude Quickstarts.Servers from code coverage
2021-10-15 21:12:04 +02:00
Suciu Mircea Adrian beede4728f Switched to LTS Kestrel version 2.1.3 (#1538)
* Switched to LTS Kestrel version 2.1.3
* bump up / fix other nuget dependencies
2021-10-10 07:38:49 +02:00
Randy Armstrong bdde7636c4 Ua 1.04.10 2021 09 15 (#1529)
Final merge with the ModelCompiler codebase.
2021-10-01 10:31:24 +02:00
Martin Regen 27f5757995 UA Nodeset output should omit ArrayDimension with size 0 (#1528)
- Modelcompiler output contained unnecessary ArrayDimension fields which can be omitted
Co-authored-by: randy-armstrong
2021-09-30 19:30:48 +02:00
Martin Regen e5baad9c2c Application config improvements for cert recreation (#1525)
- do not silent recreate a certificate if a matching cert subject is available, enforce manual deletion or replacement
- allow the application cert to be used when expired or not yet valid
- warn in trace if an app cert is loaded without loading the private key 
fixes #1162 , fixes #1102
2021-09-28 13:53:28 +02:00
Suciu Mircea Adrian 75744e27dd Support Metadata frames in PubSub (#1518)
Refactored WriterGroupPublishState out of IPubSubConnection file
    JSON Discovery messages for DataSetMetaData
    UADP Discovery messages for DataSetMetaData (Request + response)
    Refactored the UaPublisher, extracted IntervalRunner and reused it in UdpDiscoveryPublisher & UdpDiscoverySubscriber
    Proposal: automatic setting of ConfigurationVersion based on the rules in 6.2.2.1.5 (part 14)in new class Opc.Ua.PubSub.Configuration.ConfigurationVersionUtils
    New events added to UaPubSubApplication
    Implemented support for UADP Data Key Frame DataSetMessages

    Unit tests were updated to cover the new functionality
2021-09-28 11:54:37 +03:00
Martin Regen 33ae8bbec5 Set DefaultEncodingId in DataTypeDefinition, was always null NodeId (#1523)
- DefaultEncodingId is always set to binary encoding id. Helper added to StructureDefinition for other use cases (e.g. PubSub)
- the default encoding id is derived for the encodeable factory, since the typetree does not contain sufficent information to find the proper binary encoding id
- add a few helper functions in core for an upcoming PR that was used for testing with custom types, will simplify to add more nodemanagers to servers with custom types
2021-09-24 16:25:21 +02:00
Cristian Pogacean 7d310d57bd Fix NodeSet import/export of ArrayDimensions in StructureField #1115 (#1517)
Fix NodeSet import/export of ArrayDimensions in StructureField #1115
2021-09-20 14:36:38 +02:00
Suciu Mircea Adrian 33cbddb49b Enable the coexistence of a Server and Client sessions in the same process, which consume custom data types. (#1514)
Called ServerBase::CreateMessageContext(true) to use a clone of EncodeableFactory.GlobalFactory
2021-09-20 11:56:14 +03:00
Cristian Pogacean 5048189195 fix bug - nodeset2 export of namespace index #689 (#1510)
* fix bug - nodeset2 export of namespace index #689

* the actual fix for #689
2021-09-16 22:30:29 +03:00
Martin Regen 2b54136969 Add missing vars in session less message (#1505)
**Type of Issue**
[X] Bug [ ] Enhancement [ ] Compliance [ ] Question [ ] Help wanted

The `SessionLessServiceMessage` misses the urisVersion field and localeIds

https://reference.opcfoundation.org/v104/Core/docs/Part4/6.3.2/

The urisVersion field is a VersionTime.
The urisVersion was misspelled in the Nodeset as an array. Nodeset was fixed in errata 1.04.8
2021-09-13 15:53:20 +02:00
Martin Regen 76afe829b4 Add async versions of subscription API to session client (#1498)
fixes #919 and #921

- enable async client stubs in core
- add async versions for subscription management
- APM versions will not be included...

based on PR #919 from @mibos-kremer

Co-authored-by: Michiel <m.bos@kremer.nl>
2021-09-07 16:23:00 +02:00
opcfoundation-org 9b89bd070f Modelcompiler 1.04.10 (#1492)
* Changes needed for model compiler needed for Errata 1.04.10. 
* Errata 1.04.10.
2021-09-03 19:38:31 +02:00
Martin Regen 4a2f13efaf Improve https clien/server support (#1490)
- add support for security header in client/server libs
fixes #1118
2021-08-20 16:07:10 +02:00
Suciu Mircea Adrian 198cec64bf Enhance GetBuiltintype to support simple datatypes (#1488)
* Return the correct BuiltInType for Simple numeric type ids in nanespace 0

* Added unit test BuiltInTypeOfSimpleDataTypes
2021-08-19 16:36:18 +03:00
Dmitry Tikhonov c37f66cfeb Fix the behavior in case of the server is reachable only via an alternate address (#1480)
Fix the behavior in case of the server is reachable only via an alternate address - this alternate address matching the address, the client provides, is added to the list of accessible addresses so that the TranslateApplicationDescription method works correctly and the client gets back appropriate endpoints with the corresponding alternate address within them (#1480)
2021-08-19 08:10:01 +02:00