432 Commits
Author SHA1 Message Date
basyskom-jvoe bdf840f276 fix(plugin): Fix memory issues in the historical data plugins (#3992)
* Fix memory leak in UA_HistoryDataBackend_Memory

* Fix uninitialized memory in the default history data gathering plugin

After extending the memory block with realloc, the additional memory is
not initialized with null bytes.
2020-11-06 13:26:26 +01:00
basyskom-jvoe bdae55012d fix(core): PEM certificate handling for SecurityPolicy None (#3976)
If UA_ENABLE_ENCRYPTION_MBEDTLS is set, SecurityPolicy None will still
just copy the certificate data. If the input is PEM, the trailing null
byte is not added and mbedTLS will fail to parse the data.
This breaks the application URI check on server start.

In case of UA_ENABLE_ENCRYPTION_OPENSSL, there is a similar problem
if the PEM data is just copied into the local certificate byte string.
2020-10-28 15:48:07 +01:00
basyskom-jvoe e941fc23b0 fix(plugin): Fix crash in OpenSSL security policy clear on Windows (MinGW) (#3876) 2020-09-09 11:26:52 +02:00
basyskom-jvoe 4492548ee3 fix(plugin): Improve PEM support for mbedTLS and add tests (#3856)
* Add null terminator before parsing certificates and keys

mbedTLS expects PEM data to be null terminated, the length
parameter must include the null terminator.

By adding the null terminator inside open62541, an application
doesn't have to care what type of certificate or key is used.

* Extend encryption tests

- Add test for security policy Basic256
- Add test with PEM encoded certificate and key

* Fix amalgamation build for ua_pki_default.c

Including securitypolicy_mbedtls_common.h is not possible because
it is added to the amalgamation after ua_pki_default.c
2020-08-27 17:23:47 +02:00
basyskom-jvoe b9d897ce63 feat(plugin): Add support for PEM encoded local certificates (#3854) 2020-08-20 17:07:41 +02:00
basyskom-jvoe 46a9c0671c feat(plugin): OpenSSL PEM support (#3846)
* Add PEM support for the OpenSSL plugins

PEM is permitted for
- Private key
- CRL
- Trusted certificates
- Issuer certificates

* OpenSSL: Load the private key in a central place in the security policies

This is a preparation for the support of password protected private keys.
2020-08-19 16:37:51 +02:00
Jannis Voelker fa1afc9364 Fix amalgamation
Missing mbedTLS headers would break the amalgamation build if
UA_ENABLE_ENCRYPTION is used in combination with UA_ENABLE_ENCRYPTION_OPENSSL.
2020-08-14 18:45:20 +02:00
Jannis Voelker 34d2040de9 Fix segfault in ua_pki_openssl.c
If the value is not set to NULL, a heap-use-after-free occurs
in UA_CertificateVerification_clear().
2020-08-13 15:14:38 +02:00
Julius Pfrommer ecbc93731d fix(plugin): Make OpenSSL SecurityPolicies work in amalgamated build 2020-06-12 10:50:34 +02:00
Julius Pfrommer 3ae6824404 refactor(plugin): Cosmetic cleanup of securitypolicy_openssl_common.h 2020-06-12 10:50:34 +02:00
Alexander Bluhm 1d599d87b2 fix(plugin): Do not call openlog from syslog plugin
A library should not call openlog(3).  It is the program's job to
do this once at startup.  There it can select its ident, logopts
and facility.  Remove the call and its parameter from UA_Log_Syslog()
and UA_Log_Syslog_withLevel().  Write in the documentation that
openlog(3) must be called before.
2020-06-09 23:51:03 +02:00
Julius Pfrommer a11afcafb7 feat(plugin): Add a syslog logger plugin 2020-06-07 18:20:31 +02:00
Bin Lan d22844d335 check the return value of UA_malloc in the function UA_PubSubChannelEthernet_send 2020-06-02 12:27:23 +02:00
Kjeld Flarup c6cf7c517c feat(core) Extend Log_Stdout to support a maximum log level filtering (#3483) 2020-05-29 16:50:01 +02:00
Julius Pfrommer 391d226c57 fix(plugin): Fix use of uninitialized data in OpenSSL SecurityPolicies 2020-05-08 00:25:10 +02:00
Julius Pfrommer 5da1f5552a refactor(core): Correct name of ConnectionState enum values 2020-05-05 09:33:57 +02:00
Julius Pfrommer 7c76df6a40 refactor(client): Remove unused connection callback 2020-05-05 09:33:57 +02:00
Fischer-Thomas 27492f845a fix(pubsub) Fix unicast connection creation (#3553) 2020-04-14 14:21:00 +02:00
Waheed Ejaz 2f57fd7590 feat(pubsub): add support for transportSettings of dataSetReader 2020-04-09 08:08:12 +02:00
wenshan1 7bf6a6c590 fix(plugin): Don't store pointer to SecurityPolicy in *_PolicyContext
The pointer to the SecurityPolicy is not stable.
See #3539.
2020-04-07 20:07:48 +02:00
Selva Suba Jenifer Joseph 5d051fdbf9 feat(PubSub) XDP functionality with ETH over UADP
- New transport settings added for XDP functionality
 - Moved both XDP config and xdpsocket to plugins
 - Default values for defines in plugin

Change-Id: Ibd7760c9abab45c6f37ae324fec6dabc853cf797
2020-04-07 17:04:18 +02:00
Julius Pfrommer be65f1202c refactor(plugin): Shorten overlong lines in plugins/ua_pubsub_udp.c 2020-03-31 22:33:03 +02:00
Julius Pfrommer 1b404328a0 fix(pubsub): Allow publishing on a unicast address
Only create a warning.  Fixes #3530.
2020-03-31 22:33:03 +02:00
MartinaFelberFEM 6608c28ebf fix(plugin): udp - join multicast group to configured interface (#3505)
If the PubSub connection configuration defines a specific network
interface (optional parameter), we want to set this interface not only
for outgoing, but for incoming traffic too.
2020-03-26 13:07:16 +01:00
Bin Lan 682a841be5 add the security policy Basic128Rsa15 support with OpenSSL. 2020-03-23 19:54:10 +01:00
Bin Lan 9114e66ef0 add the security policy basic256 support. 2020-03-23 19:54:10 +01:00
Bin Lan 19b3dc0945 add build/test for security policy source code using openssl in Linux. 2020-03-18 10:36:45 +01:00
Suriya Narayanan Parthasarathi Vimala 6c0c79c2bd fix(PubSub): Typo error - transportSettings and mreq in setsockopt
Change-Id: I0a15011345269f897dfd5072e5d787abe256e0c6
2020-03-16 21:17:27 +01:00
Julius Pfrommer 1b259b75ee refactor(core): Add UA_NUMERICRANGE to parse ranges 2020-03-12 11:29:21 +01:00
Bin Lan f71912485e add security policy Basic256Sha256 and PKI support with OpenSSL provider. 2020-03-12 07:43:27 +01:00
Suriya Narayanan Parthasarathi Vimala babb254171 refactor(PubSub): Added ETF socket configuration in PubSub connection
- ETF socket structure added in connection config
 - Used the same on socket configuration while opening socket

Change-Id: I2d21cdd2bc1c9769299aa63b49c1da892b59080d
2020-03-06 14:06:21 +01:00
Suriya Narayanan Parthasarathi Vimala 06b1ddb8f5 refactor(PubSub): Design modification considering ETF transport settings
- New transport file created ua_pubsub_ethernet.c
 - Modification are removed in ethernet and udp .c files
 - New transport settings added for ETF functionality

Change-Id: Id11b1a06f67a8f96cd8713415f6b8472fae0b532
2020-03-06 14:06:21 +01:00
Suriya Narayanan Parthasarathi Vimala 7955eb503a refactor(PubSub): Thread based custom manager implementation
- Thread creation has been integrated with addRepeatedCallback
 - Introduction of RT Fixed offsets
 - Change from Datetime nodes to UInt64 nodes(for RT)

Change-Id: I361a1027dfe633e9b36d25bb74dad6d3a5774e01
2020-03-06 14:06:21 +01:00
Keerthivasan Alagarsamy Senthilkumaran b2be9df28d feat(PubSub): Multithread PubSub TSN application
- Application design change to run Publisher
   and Subscriber in same core(core 2)
 - User application runs in core 3
 - Three thread application design
   (Publisher, Subscriber, User application)
 - TODO:Implement spin locks for threads

Change-Id: I7c4a9bc685c9395d058b4cce71cb1ea9ffef61a8
2020-03-06 14:06:21 +01:00
Vidhya Duraisamy 77594938a3 feat(PubSub):Time triggered multithreaded application with ETF
- Run time triggered PubSub application using ETF at a publishing interval
   of 250 microseconds with qbv offset of 25us
 - Integrate time triggered functionality and publish
   OPCUA PubSub packets at calculated transmission time
 - Handle PubSub application for UDP and Ethernet over UADP
 - Implement Publisher and Subscriber as threads and handle
   in same core
 - Integrate target variable implementation in Subscriber thread
 - TODO: Write unit test cases to ensure no memory leaks are possible

Change-Id: I50982a32e126de82f4adb5e07b1ec626c0527f26
2020-03-06 14:06:21 +01:00
Julius Pfrommer 4d2eebca1c refactor(client): Clean up async connect 2020-02-29 13:09:46 +01:00
Julius Pfrommer 92def62e80 fix(client): Make a method non-inline that is not defined in a header 2020-02-29 09:54:17 +01:00
Julius Pfrommer 9d40e656c5 fix(plugin): Don't abort server/client config when a SecurityPolicy cannot init
This allows a SecurityPolicy to return "BadNotSupported" and the
endpoint will not be created.
2020-02-28 20:03:59 +01:00
Jonas Green 632d490d6d Added copyright notices for HMS Industrial Networks contributions (#3458) 2020-02-25 14:40:07 +01:00
Jonas Green 63d65e0ebf feat(server): Extended the access control plugin with check for browsing nodes
The PermissionType (Part 3) defines 17 permissions. Currently the
access control plugin can control all but 2 of them. Those are browse
and ReceiveEvents. This change adds check for browse permission of
nodes.
2020-02-21 18:27:21 +01:00
Jonas Green 83b5905418 feat(plugin): Added possibility to configure max TCP connections limit
In for example LWIP the number of TCP connection resources must be
configured at compile time. On a device with several protocols that
relies on TCP they must share this common pool of TCP resources. To
avoid one protocol allocating all TCP resources they must limit
themselfs in the number of TCP connections they allocate.
2020-02-21 12:27:26 +01:00
Julius Pfrommer 88b588748e refactor(server): Avoid duplicate SecureChannel lookups 2020-02-02 20:05:04 +01:00
Julius Pfrommer e93f8ebb69 feat(core): Differentiate local and remote MaxMessageSize / MaxChunkCount 2020-01-25 19:33:26 +01:00
Julius Pfrommer 6a3cc6c8d0 refactor(core): Remove certificate verification from SecurityPolicy in favor of global plugin 2020-01-25 19:33:26 +01:00
Julius Pfrommer 412fd83b5d feat(plugin): Accept all certificates if the pki plugin is unconfigured
* But *do warn*
2020-01-25 19:33:26 +01:00
Julius Pfrommer 7f138de1c4 fix(plugin): Remove trailing newline from mbedtls error message 2020-01-25 19:33:26 +01:00
Julius Pfrommer 6a1c300e82 feat(plugin): More logging in ua_pki_default.c 2020-01-18 21:15:08 +01:00
Julius Pfrommer a25bb75393 refactor(core): Move ConnectionConfig into SecureChannel 2020-01-18 21:15:08 +01:00
Stefan Profanter b0506d3f7c fix(server): Do not overwrite logger in default server config
The user may want to set his own logger even before any output is generated.
2020-01-17 09:58:32 +01:00
Julius Pfrommer 91f6a20c63 Merge branch '1.0' 2019-12-16 21:09:21 +01:00