Commit Graph

368 Commits

Author SHA1 Message Date
AlinMoldovean ba620f2a08 Implement import of DataTypeDefinition attribute from NodeSet files. 2019-12-06 10:24:32 +02:00
AlinMoldovean 77a183ec6b Nonce validation fix in Client Session. The minimum nonce length should be 32 in CreateSession and ActivateSession responses. 2019-11-28 19:10:07 +02:00
AlinMoldovean 2d2c108a68 Fixes #847 - Fix in DiscoveryClient.Create() 2019-11-21 15:35:51 +02:00
Alin Moldovean 131f53811f Merge pull request #851 from MilosKonecny/master
Stability in BinaryDecoder improved.
2019-11-21 13:40:42 +02:00
Martin Regen 39dca2c103 Complex Types client library (#849)
Adds a complex type system client library extension for custom enumerations and structure types based on a server dictionary or DataTypeDefinition using emitted classes at runtime. 

- Custom types are added to the session factory, not to the global factory. Types are loaded when the session connects by adding 
`                var complexTypeSystem = new ComplexTypeSystem(session);
                await complexTypeSystem.Load();
`
- Custom type properties can be accessed with an accessor [propertyname] or [index]. Direct access through the properties is possible, but some cases do not update the optional or union flags correctly.
- Support includes V1.03 dictionaries and V1.04 DataTypeDefinitions (--> known issues).
- NetCoreComplexClient can be used for quick testing servers. It prints out all custom types with content and subscribes to all. Also includes sample how to write back complex type variables and how to output JSON.
- The UA Sample Client and the Quickstart Data Type client can be used for testing with UI. Many issues were adressed to be able to read and write complex types, however some support is limited, e.g. only editing simple fields is currently working (help wanted).
- Caveat: The complex type libaries for .Net Core must be built for .netcoreapp, so it needs a seperate nuget package for the complex type client extension.
- Support for a factory type builder class to allow to plugin other type builder methods (e.g. Codedom etc...)
- Added JSON test case and include the complex types client in the testing shell script, so the complex types lib is tested on mac/linux too.
- Few fixes in the JSON encoder.

Finding enough servers with custom types is an issue, so if you find servers with unsupported custom types please provide feedback.

Known limitations:
- Only V1.03 OPC binary dictionaries are supported (no XML Schema dictionaries).
- V1.03 dictionary structure definitions are only supported if they can be mapped to a V1.04 DataTypeDefinition. Nested types and cross dictionary refs should work.
- OptionSet is only partially implemented. Only shows the byte arrays, not the flags.
- Opaque Types in dictionaries are ignored.
2019-11-20 16:05:24 +01:00
AlinMoldovean 13cba2baf7 Length validation in user token decryption. 2019-11-19 16:01:28 +02:00
Miloš Konečný 110ab6b5c0 BinaryDecoder: Stability improved, exception ArgumentOutOfRangeException is avoided. 2019-11-18 21:22:09 +01:00
AlinMoldovean 8504055a83 Add server nonce validation in Client session. 2019-11-12 17:00:07 +02:00
Sebastian Bäumler c9a20988e5 Removed duplicated code. (#844)
Same Code will be called by static function "RequireEncryption()"
2019-11-11 16:44:23 +02:00
Alin Moldovean dc9fa85a38 Fixes #822 - Certificate Validation fix. (#843)
* Remove BadCertificateUriInvalid from list of certificate validation errors that may be suppressed.
2019-11-06 09:49:08 +02:00
Andrew Field d7130a97d4 Spelling (#840) 2019-11-05 10:07:52 +02:00
Alin Moldovean f015ece891 Fixes #832 - Avoid deep recursion in TcpMessageSocket.ReadNextBlock() (#836)
* Fixes #832 - Avoid deep recursion in TcpMessageSocket.ReadNextBlock()
2019-10-30 09:52:46 +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 089bcd0e6f Fixes #780. ExpandedNodeId.CompareTo() fix. 2019-10-29 10:11:44 +02: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
Alin Moldovean a1e26bf849 Interoperability fixes for HTTPS (#814)
* Fixes #709 - Allow HTTPS clients to send the certificate for servers that require TLS client authentication

* Fixes #692 - HTTPS Server listener - Use the first configured policy for HTTPS
2019-10-02 15:38:59 +03:00
AlinMoldovean 099a003144 Fixes #805 2019-09-27 16:11:33 +03:00
AlinMoldovean f10151507b Fix #751 - possible handle leak in stress test 2019-09-26 10:55:41 +03:00
jlorek fad62ed965 Fixes #771 (#781)
Fixes a copy & paste bug discovered by @hevgen
2019-08-14 14:52:29 +03:00
AlinMoldovean b53ec37199 Copy invalid certificate to rejected store for all validation errors. 2019-07-23 17:17:39 +03:00
Alin Moldovean 07e2b807fb Fixes #748. CertificateValidation event not fired for BadCertificateChainIncomplete. (#752) 2019-07-10 10:25:54 +03:00
AlinMoldovean 76cd3953ed Fix for abandoned socket connection in UaSCUaBinaryTransportChannel.Reconnect() 2019-06-19 15:38:14 +03:00
AlinMoldovean 9b02652262 Fixes #729. Connection with self-signed certificate fails with BadCertificateChainIncomplete. 2019-06-07 16:08:09 +03:00
AlinMoldovean 24e44dd3f3 Compliance fix in CertificateValidator 2019-05-23 15:12:39 +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
Martin Regen 93146020a4 Certificate Validator tests and Pem writer fix (#701)
- add more tests verify how longer cert chains are built and verified with the cert validator
- some tweaks to cert factory to allow for building Sub CA certs
- allow to set the Basic Constraint  / Path Length for CA certs
- fix #695 PKCS#8 format is now used
- add additional check to verify incomplete chain signatures
2019-04-12 16:47:34 +02:00
AlinMoldovean 33bfecea50 Add getter for stream in BinaryDecoder 2019-04-11 13:34:42 +03:00
AlinMoldovean f5a64e2e46 Fixes #666 - null pointer reference 2019-04-03 16:24:35 +03:00
AlinMoldovean c8ac8e6b5e Fixes #673 - Incorrect IssuedTokenType for JWT tokens 2019-04-02 16:49:40 +03:00
Alin Moldovean 50c9a67735 Merge pull request #681 from OctaviaStan/master
Add Extension property to NodeSet to enable usage of Extension proper…
2019-03-22 11:33:45 +02: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 65502ccd62 Update in CertificateValidator.Validate() to require the complete chain. 2019-03-19 16:31:31 +02:00
Martin Regen 64db8c73a9 IOP GDS cert related fixes (#674)
* do not require server capabilities
* fixes for cert creation key usage flags
2019-03-18 12:37:04 +01:00
AlinMoldovean 8b374a7448 Copyright year set to 2019 in license notices. 2019-02-14 12:34:33 +02:00
AlinMoldovean ec70f7d34f Fixes #639 - InvalidCastException when passing an enumeration 2019-02-13 18:26:40 +02:00
Thomas Zeugner 23551e7422 Use [Flags] on NodeStateChangeMasks (#642)
Tell the compiler that bitwise operators are allowed on NodeStateChangeMasks
2019-02-13 18:12:38 +02:00
Marc Schier def3126c5d Fix travis build and interop in binary decoder (#645)
* Fix interop where a server is responding with a 0 terminated string.  In particular xml document read with malformed string causes XML exception. 

* Do not check position before checking Stream.CanSeek when decoding to avoid exception.  This will use the memory allocation path to do random access read.

* Fix .travis build due to failing test on mono
2019-02-13 17:02:21 +01:00
Martin Regen a0c4631d28 enable Pss padding for Aes 256 profile on .Net4.x (#638) 2019-02-05 15:01:31 +01: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
Alin Moldovean 612b50694c Bugfix for NodeState.UserWriteMask getter (#631) 2019-01-23 11:27:01 +02:00
Michi 69025001ab EventFilter now considers BrowseName, NodeClass and NodeId of Variables when filtering an event (#619) 2019-01-15 15:45:35 +02:00
Alin Moldovean b8d911c569 Updates for V1.04 attributes in Client and Server (#614)
* Update for 1.04 attributes in ClientSession.ReadNode()

* Fix in ClientSession.ReadNode()

* Updates for 1.04 Attributes in server.

* Discard inner value for attributes with bad status codes in ClientSession.ReadNode().

* Remove unused attribute from AttributeWriteMask
2018-12-17 12:53:19 +02:00
Robin Mattheussen 94e2a74dc8 Added OnReferenceAdded and OnReferenceRemoved handlers to NodeState 2018-11-12 19:31:05 +01:00
Martin Regen 7deec9d782 Update Bouncy Castle to 1.8.4 (#583) 2018-11-09 09:42:58 +01: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
Marc Schier a3810831ef Introduce interface between listener and channel and make channel ext… (#572)
* Introduce interface between listener and channel and make channel extendable

* Fix build

* Code review feedback

* Code review feedback
2018-10-26 21:09:21 -07:00
Michael Wiarda f12e537606 Update Stack/Opc.Ua.Core/Types/Encoders/JsonEncoder.cs
Corrected EncodingType for JsonEncoder
2018-10-21 19:11:08 +02:00
AlinMoldovean 31a8235007 Added DecimalDataType node in ReferenceServer.
Predefined nodes updated to include DecimalDataType structure.
2018-10-12 16:00:40 +03:00
AlinMoldovean 5f91c46a0c Fixes #540. Update in Utils.Clone() method. 2018-09-24 18:41:39 +03:00