Commit Graph

963 Commits

Author SHA1 Message Date
Хлебников Андрей Александрович
cb51c8427e fix(plugin,cmake) Failure when build in MacOSX 2023-04-23 22:29:17 +02:00
Julius Pfrommer
775bb4e75f refactor(server): Make Discovery a freestanding ServerComponent 2023-04-16 19:36:28 +02:00
Julius Pfrommer
705f34d9cd refactor(build): Remove thread-safety warning for PubSub 2023-04-11 13:33:34 +02:00
Julius Pfrommer
4d5ceb378c Merge remote-tracking branch 'origin/1.3' into merge_13_master_12 2023-03-26 10:21:49 +02:00
Julius Pfrommer
2f4a871039 refactor(build): Improve an error message in CMakeLists.txt 2023-03-22 22:06:52 +01:00
Julius Pfrommer
f4d8c15f93 refactor(pubsub): Move content from ua_pubsub_config.h to ua_pubsub.h 2023-03-22 22:06:52 +01:00
Julius Pfrommer
0bb2b0142c refactor(build): Bump version to 1.3.5 2023-02-20 10:17:48 +01:00
Julius Pfrommer
07a06f497d feat(pubsub): Warn for thread-safety of PubSub on 1.3 2023-02-15 11:23:39 +01:00
Tobias Zimmermann
d0f741308b fix(build): replace absolute paths of OpenSSL with imported target
${OPENSSL_LIBRARIES} contains the absolute paths to the OpenSSL library.
Instead, the imported targets are used. This is important when using
exported targets e.g. while cross compiling.

Signed-off-by: Tobias Zimmermann <Tobias.Zimmermann@tq-group.com>
2023-01-13 20:14:00 +01:00
Julius Pfrommer
99890a71a0 refactor(pubsub): Move ua_pubsub_manager.h into ua_pubsub.h 2023-01-07 08:59:41 +01:00
Jan Hermes
3fda9716aa feat(pubsub): add pubsub unicast udp 2023-01-04 00:45:39 +01:00
Julius Pfrommer
9f4b099aac refactor(deps): Remove unused AA-Tree implementation 2023-01-04 00:38:46 +01:00
Julius Pfrommer
1db20e7c9e refactor(build): Don't warn for maybe unitialized 2023-01-04 00:38:46 +01:00
Srdjan Usorac
50fcc0ea43 feat(ci): Enable nodesetLoader for CI builds (#5454)
Signed-off-by: Srdjan Usorac <uso@keba.com>
2022-12-22 08:08:24 +01:00
Jan Hermes
b6f8e52684 refactor(pubsub): prepare for unicast integration
change the filename of the old legacy multicast layer to udp_multicast
for better rebase and integration of the new unicast/multicast layer.
2022-12-21 12:49:58 +01:00
Julius Pfrommer
ac7ab8fa43 refactor(pubsub): Split out Connection and DataSet into separate compilation units 2022-12-18 01:39:31 +01:00
Julius Pfrommer
6f3117951a refactor(core): Add UA_ENABLE_XML_ENCODING to config.h.in 2022-11-15 16:26:59 +01:00
Julius Pfrommer
d25a2ff43e refactor(core): Mark XML en/decoding as experimental until feature complete 2022-11-15 16:26:59 +01:00
Julius Pfrommer
acd1a465f9 feat(core): Add UA_INLINABLE to optionally export "static inline" methods 2022-11-14 23:49:49 +01:00
Srdjan Usorac
f54f1961b2 feature(core): XML data encoding for numeric + string types (#5437)
Signed-off-by: Srdjan Usorac <uso@keba.com>
2022-11-14 20:04:56 +01:00
Julius Pfrommer
0120d6ef5d feat(el): Add raw ethernet ConnectionManager 2022-10-30 22:40:00 +01:00
Julius Pfrommer
147f0e6959 feat(el): Add eventloo_common.* with KeyValue parameter validation 2022-10-30 22:40:00 +01:00
Jan Murzyn
d5b40c6356 Enable faster testing for the boundary conditions.
It's interesting to test what happens if all available IDs are reserved.
Additionally, the only way to roll over the ID counter is to reserve all
available IDs. However, testing such boundary condition involves a large
number of iterations in the implementation. Implemented a special
compile flag to reduce the number of required iterations just for
testing.
2022-10-26 23:57:46 +02:00
Julius Pfrommer
8a3b84eae5 Merge remote-tracking branch 'origin/1.3' into merge_13_master_6 2022-10-26 13:59:13 +02:00
Muddasir shakil
4c27233da9
feat(pubsub): SKS SecurityGroups (#5387)
A SecurityGroup is used to managed the security settings and keys by the SKS.
A type definition of security group is created which stores the security
configuration of the SecurityGroup and the reference to a keystorage.
2022-10-21 13:56:53 +02:00
keba-uso
779e6b7902 feat(plugin): Integration of nodesetLoader functionality within open62541 (#5371) 2022-10-18 21:46:54 +02:00
Muddasir shakil
b457206d24
feat(pubsub): KeyStorage and SetSecurityKeys (#5243)
* Add UA_ENABLE_PUBSUB_SKS Cmake option

The SKS related features are enabled in open62541. The UA_ENABLE_PUBSUB_SKS
cmake option adds the support to enable/disable SKS related features.

Signed-off-by: Muddasir Shakil <muddasir.shakil@linutronix.de>

* Add securityGroupId parameter to PubSub Group Config

The PubSub groups (Reader/Writer) are associated to a security group by
securityGroupId. The securityGroupId parameter is added to UA_WriterGroupConfig
and UA_ReaderGroupConfig structs.

Signed-off-by: Muddasir Shakil <muddasir.shakil@linutronix.de>

* Add UA_PubSubKeyListItem struct

The Keystorage contains a linked list of KeyItems. The KeyItems holds the
information related to a key. The UA_PubSubKeyListItem struct forms the keyItems
of the keystorage KeyList.

Signed-off-by: Muddasir Shakil <muddasir.shakil@linutronix.de>

* Add UA_PubSubKeyStorage struct

A structured storage is required to store all the keys and related information,
such as which security group, what security policy, how many PubSub Groups, and
when to move to next keys. The UA_PubSubKeyStorage struct holds the list of keys
used to secure the pubsub message for a security group and related information.

Signed-off-by: Muddasir Shakil <muddasir.shakil@linutronix.de>

* Add PubSubKeyStorageList to the pubSubManager

The KeyStorage is managed by the pubSubManager object. There can be multiple key
storages managed by a pubSubManager for different Security Groups. An
UA_PubSubKeyStorage List is added to the pubSubManager, which contains the
pointers to all the key Storages managed by the pubSubManager for different
Security Groups.

Signed-off-by: Muddasir Shakil <muddasir.shakil@linutronix.de>

* Add KeyStorage pointer to ReaderGroup and WriterGroup struct

A reference to a Keystorage is created when a ReaderGroup or WriterGroup group
is created. This reference is used for the life cycle management of the
KeyStorage. A non-owning pointer is added to WriterGroup and ReaderGroup structs
to point to their associated keystorage in the server.

Signed-off-by: Muddasir Shakil <muddasir.shakil@linutronix.de>

* Add function to initialize a keyStorage

An empty keystorage list is created when a ReaderGroup or a WriterGroup is
created in server. The new KeyStorage is added to the server KeyList and
initialized for a securityGroup. If a KeyStorage already exists in the server
for a securityGroupId, then the referenceCount is incremented and the keyStorage
is added to the initializing ReaderGroup or WriterGroup. In case of failure,
the keystorage is cleaned and deleted.

Signed-off-by: Muddasir Shakil <muddasir.shakil@linutronix.de>

* Add storeSecurityKey function

After the keystorage is initialized and added to the server keyList, the
keys should be stored in the keystorage keylist. the storeSecurityKeys function
takes current key and future key list and add it a KeyStorage in the server.

Signed-off-by: Muddasir Shakil <muddasir.shakil@linutronix.de>

* Add Mechanism for key Rollover after KeyLifeTime expires

After the KeyLifeTime expires the Publisher and Subscriber are required to
move to the next key in the existing list. The addMoveToNextKeyCallback function
calculates the time to trigger the callback function and adds a timed server
callback. The importKeyToChannelContext function takes the key material,
divides the key into singing, encrypting and keyNonce part according to security
Policy assigned to KeyStorage and adds them to the channelcontext of the PubSub
Group. The moveToKeyCallback is the callback function to set the keys and
add next callback for key Rollover.

Signed-off-by: Muddasir Shakil <muddasir.shakil@linutronix.de>

* Add API function update the existing keyStorage

The existing KeyList is updated/replaced with the fetched list. If the
currentTokenId is unknown in the existing list, then the existing keylist is
replaced by the fetched KeyList. In othercases keystorage is updated and keylist
is extended with new future keys.

Signed-off-by: Muddasir Shakil <muddasir.shakil@linutronix.de>

* Add removeKeyStorage function

A keyStorage can be referenced by multiple PubSub Groups in a server. When a
keyStorage is removed with removeKeyStorage function, it checks the number of
of referenceCount parameter and decrements it by 1. If referenceCount was 1, then
the keyStorage pointer is freed and removed from the server.

Signed-off-by: Muddasir Shakil <muddasir.shakil@linutronix.de>

* Add keyStorage in Server with ReaderGroup

Each ReaderGroup is assocaited with a keyStorage. The keys are used in its
channel context to secure the messages. A keyStorage is added/updated when
a ReaderGroup is created in the server.

Signed-off-by: Muddasir Shakil <muddasir.shakil@linutronix.de>

* Add KeyStorage in server with WriterGroup

Each WriterGroup is assocaited with a keyStorage. The keys are used in its
channel context to secure the messages. A keyStorage is added/updated when
a WriterGroup is created in the server.

Signed-off-by: Muddasir Shakil <muddasir.shakil@linutronix.de>

* Remove KeyStorage from server with ReaderGroup

Each ReaderGroup is assocaited with a keyStorage. The keys are used in its
channel context to secure the messages. A keyStorage is removed/updated when
a ReaderGroup is removed from the server.

Signed-off-by: Muddasir Shakil <muddasir.shakil@linutronix.de>

* Remove KeyStorage from server with a WriterGroup

Each WriterGroup is assocaited with a keyStorage. The keys are used in its
channel context to secure the messages. A keyStorage is removed/updated when
a WriterGroup is removed in the server.

Signed-off-by: Muddasir Shakil <muddasir.shakil@linutronix.de>

* Delete All KeyStorages from Server

When PubSub Configuration is deleted, all the nested configuration and members
are deleted from the server. The KeyStorages are also deleted when a
PubSubManager is deleted, because KeyStorages does not serve the purpose anymore.

Signed-off-by: Muddasir Shakil <muddasir.shakil@linutronix.de>

* Add KeyStorage Test setup and unit tests

A test suite is added for the keystorage and the following using tests are added
to it
	- Initialization of empty keystorage
	- Initialization of keystorage with invalid PubSub security policy
	- storing keys into empty keystorage
	- move to next key after keylifetime expire
	- Setting keys to the channel context
	- Adding keyStorage with Writer and ReaderGroup
	- Adding a Reader/WriterGroup to existing Keystorage
	- Removing keyStorage with a Writer/ReaderGroup

Signed-off-by: Muddasir Shakil <muddasir.shakil@linutronix.de>

* Add setSecurityKeys Method Node Callback

The keys are pushed to the Publishers and Subscribers who do not have client
functionality using setSecurityKeys Method Node. The setSecurityKeys callback
implements the backend of the setSecurityKeys Method node exposed by the server.
Checking for user credentials against PubSub Security Group Object nodes
is unresolved becuase creation of Security Group Object is not implemented.

Signed-off-by: Muddasir Shakil <muddasir.shakil@linutronix.de>

* Add sks push test setup and unit tests

Setups the PubSub SKS Push test suite and helper methods. The test suite
includes a server with encryption and a client to connect with the server
with encrypted channel. The following unit tests are added
	- insufficient Security Mode
	- MissingSecurityGroup
	- Setting Security Keys
	- Update CurrentKey from exisiting list
	- Update CurrentKey and add new future keys
	- Replace existing keys with new keys

Signed-off-by: Muddasir Shakil <muddasir.shakil@linutronix.de>

* Add PubSubKeyStorage description

The PubSubKeyStorage description is added to the header file. It also includes
the implemented workflow of the KeyStorage API to interact with KeyStorage.

Signed-off-by: Muddasir Shakil <muddasir.shakil@linutronix.de>

* Integrate PubSub SKS build and unit test in CI

The unit tests should be intergerated in the CI of open62541 pipeline to provide
proper testing and integration support of the new feature. The  build and unit
tests of PubSub SKS are integrated in the CI pipeline.

Signed-off-by: Muddasir Shakil <muddasir.shakil@linutronix.de>

Signed-off-by: Muddasir Shakil <muddasir.shakil@linutronix.de>
2022-10-17 20:55:11 +02:00
Noel Graf
737f0562fc feat(pubsub): Adding payload encryption in mqtt publish example 2022-10-17 13:31:50 +02:00
Vyacheslav Yurkov
a0328d4cb5 fix(build): do not install git files
Signed-off-by: Vyacheslav Yurkov <v.yurkov@precitec.de>
2022-10-03 20:48:24 +02:00
robertns
e1d7708052
feat(server): optionally save rejected certificate (#5260) 2022-09-22 10:58:56 +02:00
Julius Pfrommer
bbc83f4387 refactor(core): Remove unused dependency /deps/string_escape.c 2022-08-21 00:09:32 +02:00
Julius Pfrommer
f4779fa6b6 feat(core): Enable JSON encoding by default 2022-08-20 14:34:38 +02:00
Julius Pfrommer
102df360be feat(core): Add UA_Guid_print 2022-08-20 14:34:38 +02:00
Julius Pfrommer
5a25092fe0 refactor(core): Distribute content from ua_types_print.c to other files 2022-08-20 14:34:38 +02:00
Julius Pfrommer
8a1d7580c5 refactor(core): Remove the old network layer code 2022-08-20 14:34:38 +02:00
Noel Graf
f39c262234
feat(pubsub): Integrate MQTT Subscriber functionality and add an MQTT Subscriber example. (#5234) 2022-08-15 15:20:35 +02:00
Julius Pfrommer
2629ca9a70 refactor(core): Remove unused jsmn library from dependencies 2022-08-10 16:13:55 +02:00
Noel Graf
4d71b3ce82 feat(cmake): Automatic initialization of the Git submodules via cmake 2022-08-05 09:14:34 +02:00
Julius Pfrommer
5ef11b11ff refactor(core): Remove the old connection code 2022-08-05 09:13:05 +02:00
Julius Pfrommer
5f45712239 refactor(core): Remove UA_ENABLE_UNIT_TEST_FAILURE_HOOKS
The hooks are better implemented via the test-plugins.
2022-08-05 09:13:05 +02:00
Julius Pfrommer
ff73268829 refactor(core): Bump version to 1.3.3 2022-08-03 10:12:48 +02:00
Jan Mikolic
dfa88dc70d
fix(buildAdd architecture compile flags to open62541-plugins and open62541-object (#5250) 2022-07-12 19:38:09 +02:00
Julius Pfrommer
33c92ff4c7 fix(build): Fix the amalgamation build when no git version is available 2022-06-26 21:08:11 +02:00
Julius Pfrommer
0869f93a39 Merge remote-tracking branch 'origin/1.3' into merge_132_master 2022-06-26 21:07:47 +02:00
Julius Pfrommer
aacf1e6cb6 fix(ci): Disable MQTT for the amalgamation build -- not compatible with upstream repo 2022-06-26 20:41:20 +02:00
Julius Pfrommer
11923b8d16 Merge remote-tracking branch 'origin/1.3' into merge_132_master 2022-06-24 15:25:25 +02:00
Julius Pfrommer
3b5f5f24a2 refactor(core): Bump version to v1.3.2 2022-06-24 11:05:00 +02:00
Julius Pfrommer
eba9b3332b refactor(build): Enable thread-safety by default on Win32 and Unix-like 2022-06-19 20:22:40 +02:00
Julius Pfrommer
bafcd828bf refactor(build): Improve the doc string of the UA_LOGLEVEL option 2022-06-19 20:22:40 +02:00
theirix
a820093aa9
feat(build): add option UA_ENABLE_DEBUG_SANITIZER 2022-06-19 13:06:57 +02:00
Noel Graf
b30001429d fix(pubsub): Integrate the mqtt-c library as a Git submodule in 1.3 2022-06-14 11:36:55 +02:00
Julius Pfrommer
eef770ba37
Merge pull request #5196 from open62541/1.3
Merge 1.3 to master
2022-06-13 14:28:24 +02:00
Leo-Paul Geneau
40808b0ddb fix(cmake): check if CMAKE_CXX_COMPILER_VERSION is defined 2022-06-12 23:52:15 +02:00
andreasebner
b0f0843104 fix(ci) set correct release number 2022-06-10 15:59:48 +02:00
Noel Graf
02f101df73
feat(server) allow UA_NODESET_DIR to be custom defined. (#5138)
This makes it easier for developers to keep all ua-nodesets XML
definitions in a common location.

Signed-off-by: Björn Esser <b.esser@pengutronix.de>

Co-authored-by: Björn Esser <b.esser@pengutronix.de>
2022-06-07 11:04:03 +02:00
Julius Pfrommer
495174535e refactor(deps): Rename atoi -> parse_num 2022-06-04 12:41:19 +02:00
Julius Pfrommer
c90e2b4a0d refactor(deps): Simplify and rework the cj5 library 2022-06-04 12:41:19 +02:00
Noel Graf
acaa87d1c7 fix(pubsub): Switching the MQTT library to upstream. 2022-05-30 09:09:02 +02:00
Noel Graf
d952f76fa3
refactor(core): remove needless x${VAR} tricks (#5129)
Co-authored-by: Rolf Eike Beer <eb@emlix.com>
2022-05-16 16:03:34 +02:00
arozhkov
e33ccf0f03 fix(cmake): Added the use of the UA_PACK_DEBIAN flag to disable the formation of packages through CPack so that there are no conflicts with another projects. 2022-05-11 14:05:06 +02:00
MartinaFelberFEM
17949178e1
docs(pubsub) add a warning for PubSub monitoring + bufmalloc + fast-path build 2022-05-10 22:26:12 +02:00
andreasebner
b7614c88d5
feat(server) remove namespace LATEST_1_05 flag (#5096) 2022-05-04 15:36:15 +02:00
Noel Graf
dc54a9b988 fix(cmake): UA_ENABLE_MQTT_TLS_OPENSSL flag is automatically set if the UA_ENABLE_MQTT_TLS flag is set. 2022-05-03 19:52:29 +02:00
Julius Pfrommer
09cf7c295b feat(core): Enable the EventLoop UDP support in the default build 2022-04-20 20:35:29 +02:00
Andreas Ebner
2e88fee22d fix(server) adjust regex for latest nodeset flag 2022-04-20 08:48:38 +02:00
Noel Graf
07c2fab194 fix(cmake): UA_ENABLE_MQTT_TLS_OPENSSL flag is automatically set if the UA_ENABLE_MQTT_TLS flag is set. 2022-04-09 09:59:04 +02:00
Julius Pfrommer
be9fbf4f61
Merge pull request #4959 from open62541/1.3
Merge 1.3 to master
2022-03-06 22:04:00 +01:00
Julius Pfrommer
27d52b3371 build(core): JSON encoding is no longer experimental 2022-02-28 08:25:17 +01:00
Noel Graf
cf5ae9e642 fix(nc): Create a Latest Flag which sets the NS0 to the latest Nodeset2.xml version. Fix a bug in the generation of the types.
(cherry picked from commit 3befc2181a)
2022-02-07 23:18:10 +01:00
Julius Pfrommer
759210672b refactor(server): Split event filter into separate file
(cherry picked from commit 482c98760b)
2022-02-06 14:32:20 +01:00
Julius Pfrommer
16247cfaef Merge remote-tracking branch 'origin/1.3' 2022-02-01 21:28:23 +01:00
Noel Graf
3befc2181a fix(nc): Create a Latest Flag which sets the NS0 to the latest Nodeset2.xml version. Fix a bug in the generation of the types. 2022-01-31 16:08:50 +01:00
Julius Pfrommer
172f0528e9 refactor(server): Move server diagnostics into dedicated source file 2022-01-30 00:24:49 +01:00
Julius Pfrommer
802cbb4e2c Merge remote-tracking branch 'origin/1.3' 2022-01-19 12:48:39 +01:00
Julius Pfrommer
85ab83c827 fix(server): Fix building with Subscriptions disabled 2022-01-19 07:01:02 +01:00
Julius Pfrommer
00ce89cbca refactor(server): Disable diagnostics by default
They add >300kb to the binary size due to the large NodeSet
2022-01-19 07:01:02 +01:00
Julius Pfrommer
c9064a43cd
Merge pull request #4891 from open62541/1.3
Merge 1.3 to master
2022-01-06 19:52:04 +01:00
Julius Pfrommer
c6f1abd8cd feat(server): Add UA_ENABLE_DIAGNOSTICS flag and basic support 2022-01-06 07:58:30 +01:00
Julius Pfrommer
0c1cc5aeb2 feat(el): Add InterruptManager API and a POSIX signal implementation 2022-01-03 13:13:39 +01:00
Julius Pfrommer
37679473d0 refactor(el): Switch to epoll for the EventLoop on Linux 2022-01-03 13:13:39 +01:00
Julius Pfrommer
5082bf32e7 refactor(el): The EventLoop contains methods pointers
This allows several EventLoop implementations to be run concurrently.
2022-01-03 13:13:39 +01:00
Julius Pfrommer
482c98760b refactor(server): Split event filter into separate file 2021-12-22 09:59:08 +01:00
Julius Pfrommer
5de6a2e7c3 Revert "Merge branch 'master' into 1.3"
This reverts commit 2f2b9fea7d, reversing
changes made to 271f3dcb01.
2021-12-18 14:34:34 +01:00
Julius Pfrommer
34221e1664
Merge pull request #4849 from open62541/1.3
Merge 1.3 to master
2021-12-14 14:07:39 +01:00
Julius Pfrommer
6b77e5e15e Merge branch '1.2' into merge_12_13_3 2021-12-14 11:38:49 +01:00
Julius Pfrommer
6fd48c2e95 fix(build): Don't use regex to get the install path for includes
The path might contain regex-sensitive character (like '+').
See #4842.
2021-12-14 11:36:24 +01:00
Mark Giraud
506c785bcb
feat(build): Move modules to cmake3.12 (or less) specific directory such that they are not included for newer cmake versions. (#4824)
Newer cmake versions already have these modules packaged and we should use those in favor of possibly outdated ones.
2021-12-07 16:01:28 +01:00
Julius Pfrommer
33d272d519 fix(build): Don't use the check_add macro for the -m32 compiler option 2021-12-01 01:36:51 +01:00
Julius Pfrommer
9c2d61ae66 feat(core): Add EventLoop and POSIX TCP EventSource
Co-authored-by: Jan Hermes <jan@hermes-technology.de>
2021-11-25 16:03:02 +01:00
Julius Pfrommer
9268fc3fc6 refactor(core): Move ua_timer.* to /arch/common 2021-11-25 16:03:02 +01:00
andreasebner
d6f77abdcd
feat(ci) add github action to enable codecov integration and coverage testing (#4767) 2021-11-17 13:18:45 +01:00
Julius Pfrommer
c437223cfd Merge remote-tracking branch 'origin/1.3' into merge_13_master_3 2021-11-12 10:05:18 +01:00
Julius Pfrommer
ef6deabb52 refactor(core): Pull out ZIP_FFS32 from ziptree.h into ziptree.c 2021-11-11 07:45:27 +01:00
kimim
0881e25994 disable PUBSUB_MQTT for WIN32 again 2021-11-05 15:48:38 +01:00
kimim
f415f3116d fix compile error reported in issue #4727 2021-11-05 15:48:38 +01:00
Julius Pfrommer
55d8961c9b
Merge pull request #4750 from open62541/1.3
Merge 1.3 to master
2021-11-05 09:16:20 +01:00
Julius Pfrommer
90bc24291b fix(build): Build amalgamation with multithreading enabled
Co-authored-by: kimim <kimi.im@outlook.com>
2021-11-04 19:33:51 +01:00
Silvio Traversaro
38ff3518b6 Fix handling of UA_FORCE_WERROR CMake option on MSVC 2021-11-04 14:04:51 +01:00
Opcua_Tsn_Team_Kalycito
8be2e79cb4
refactor(build): Modify CMake option for TPM Encryption (#4714)
- Remove mutually exclusive CMake option to support both
   PKCS11 and Keystore

Change-Id: Ib4c89959df29b6d1a2b298fb239e9210767968a0
2021-10-22 17:19:47 +02:00
Opcua_Tsn_Team_Kalycito
b9a8fcbd3b
[REVIEW] Pubsub Encryption using key stored in TPM (#4560)
* feat(pubsub): Add PubSub example to use keys stored in TPM

 - Need to encrypt the AES and HMAC keys using the key stored
   in TPM, before running the PubSub application
 - The PubSub application decrypts the keys available in the
   filesystem using the TPM key

Change-Id: I41c7906675333fa46673dabae1bb6d6d1c3fbecc

* feat(tools): Support to encrypt the key file using TPM key

 - Add cert_encrypt_tpm.c to read the key file present in the
   file system, encrypt it using the key stored in TPM and
   store the encrypted data in different file
 - Delete the original key after creating encrypted key

Change-Id: I9fc77ebf0c76a990c70f4d228950fba09fc39c51

* docs(pubsub): Add README for PubSub TPM keystore application

 - README includes environment setup
 - Steps to generate encryption and signing keys for PubSub
 - Steps to use TPM keys to encrypt the keys in filesystem
 - Build and run Pubsub application
 - Change CMake build flag

Change-Id: I025662bd36ed9f27c7c23b8eda6e2f52cad82021

Co-authored-by: andreasebner <andreas.ebner@iosb.fraunhofer.de>
2021-10-08 14:04:47 +02:00
Divya Prasanth Prabhakaran
379ee51171 feat(ex): Add client server example to use keys stored in TPM
- Encrypt the private key using the key stored in TPM
   and remove the unencrypted private key from the filesystem
 - Used the encrypted key intermittently for software-based
   encryption/decryption

Change-Id: I46fc24102365292d9af6b51c582e3a3f74b2af5e
2021-10-02 12:23:09 +02:00
Julius Pfrommer
c4ff4bac48 refactor(build): Enable Event-support by default; Mark some options advanced 2021-09-26 17:02:53 +02:00
Divya Prasanth Prabhakaran
b984eecc53 fix(build): Modify TPM security build option
Change-Id: Ibeeea2ad3bd47d7b88738bb4b0177647d3b1d2b5
2021-09-21 17:21:58 +02:00
Opcua_Tsn_Team_Kalycito
8a3386a1cd
[REVIEW] PubSub hardware encryption and decryption using pkcs11 (#4435) 2021-08-27 12:51:34 +02:00
Julius Pfrommer
aafec2429c fix(build) Correctly test for multithreading in test builds 2021-08-25 00:01:32 +02:00
Julius Pfrommer
0d69be31e8 fix(build): Remove a warning for the old UA_MULTITHREADING config 2021-08-25 00:01:32 +02:00
Julius Pfrommer
4d3422524c refactor(core): Don't generate headers with internal encoding functions 2021-08-16 10:21:51 +02:00
Julius Pfrommer
cda865a901 fix(tests): Add MQTT plugin to build dependencies 2021-08-16 10:21:51 +02:00
Christian von Arnim
bdb94e177e feat(sec): Add UA_CreateCertificate
Implementation for OpenSSL and LibreSSL

Co-authored-by: Julius Pfrommer <julius.pfrommer@web.de>
2021-08-09 16:38:57 +02:00
Fabrice Fontaine
5edb3a0283
feat(build): add UA_FORCE_WERROR to CMakeLists.txt
Allow the user to disable -Werror to avoid the following build failures:

/tmp/instance-0/output-1/build/open62541-v1.2.2/arch/network_tcp.c: In function 'connection_recv':
/tmp/instance-0/output-1/build/open62541-v1.2.2/arch/network_tcp.c:96:5: error: conversion to 'unsigned int' from 'int' may change the sign of the result [-Werror=sign-conversion]
   96 |     UA_fd_set(connection->sockfd, &fdset);
      |     ^~~~~~~~~

/tmp/instance-6/output-1/build/open62541-v1.2.2/plugins/ua_pubsub_udp.c: In function 'UA_PubSubChannelUDPMC_receive':
/tmp/instance-6/output-1/build/open62541-v1.2.2/plugins/ua_pubsub_udp.c:477:21: error: conversion to '__suseconds_t' {aka 'int'} from 'UA_UInt32' {aka 'unsigned int'} may change the sign of the result [-Werror=sign-conversion]
  477 |     tmptv.tv_usec = (long int)(timeout % 1000000);
      |                     ^

Fixes:
 - http://autobuild.buildroot.org/results/911811de81d8abb2a31feb8f27af1592641c6fbc
 - http://autobuild.buildroot.org/results/f0187b3f2d62e955fddeef4e90f84ba4fd642bd2

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2021-08-02 14:29:26 +02:00
Julius Pfrommer
2aa1790de6 refactor(pubsub): Split out ua_pubsub_writergroup.c 2021-07-30 18:41:50 +02:00
Julius Pfrommer
7afa3c30ca refactor(pubsub): Split out ua_pubsub_readergroup.c 2021-07-30 18:41:50 +02:00
Mark Giraud
4d4e206ef5 refactor: use newer FinPython3 package in order to allow finding python versions installed with pyenv 2021-07-21 16:53:02 +02:00
Julius Pfrommer
e1f8fd3b18 fix(build): Fix building for oss-fuzz 2021-07-17 18:39:29 +02:00
Julius Pfrommer
9bed4cd765 refactor(build) Simplify setting the -m32 flag for 32bit builds 2021-07-17 18:39:29 +02:00
Julius Pfrommer
c1d763f92e feat(tools): Add "ua" shell tool for interacting with OPC UA servers
Only the getendpoints and read service are implemented at this time.
2021-07-16 08:59:33 +02:00
Christian von Arnim
fe9f995568 feat(plugin): Add LibreSSL encryption 2021-07-14 09:20:29 +02:00
Christian von Arnim
a1c5252cb4 Fix(plugin): Openssl versions less than 1.1
Extract version specific code to ua_openssl_version_abstraction.h
2021-07-09 13:28:59 +02:00
Christian von Arnim
b82ad4df1b build(plugin): Simplify encryption to single parameter.
Possible options for UA_ENABLE_ENCRYPTION are OFF, MBEDTLS, OPENSSL
2021-07-08 13:23:07 +02:00
Julius Pfrommer
6dc9b111a3 style(build): Improve comments in CMakeLists.txt 2021-07-02 09:34:37 +02:00
Julius Pfrommer
75548afac3 fix(build): Generate position-independent code for shared libraries 2021-07-02 09:34:37 +02:00
Julius Pfrommer
1223370659 refactor(ci): Simplify version number handling 2021-07-02 09:34:37 +02:00
Mark Giraud
d803a741bd refactor(pubsub): Fix check macros and slightly clean up branches by using switch case 2021-07-01 16:41:00 +02:00
Julius Pfrommer
deabb8b14f refactor(build): Move open62541.pc.in to /tools 2021-06-04 20:37:19 +02:00
Julius Pfrommer
c17de58e4b fix(build): Enable PubSub encryption only (no client/server) 2021-06-04 15:13:35 +02:00
Julius Pfrommer
656021576e fix(ci): Fix building the fuzzing tests for oss-fuzz 2021-05-27 08:51:10 +02:00
JanSurft
4cfd79c905
feat(pubsub): decryption (#4418)
* test(pubsub): disable false-negative test

The "Test_many_components" is failing under specific circumstances,
disable it until it is fixed (correctly set the publisher-ids,
writergroup-ids, datasetwriter-ids).

* feat(pubsub): decryption

Adding the possibility to verify and decrypt pubsub networkmessages.

* test(pubsub): add decryption test

* feat(pubsub): subscriber encryption example

* test(pubsub): integration-test pubsub encrypted
2021-05-21 19:01:23 +02:00
Jan Hermes
47afdab8c1 feat(plugin): aes256 encryption
Adds support for aes256 encryption in pubsub.
2021-05-21 11:20:42 +02:00
JanSurft
d7bbf512c7
fix(build): remove testing source from build script (#4420)
Testing source-file testing_networklayers.c breaks
build when UA_DEBUG_DUMP_PKGS is enabled because
of missing dependencies (e.g. testing_lock) which are
only build for the testing-build.
2021-05-20 12:21:40 +02:00
Jan Hermes
f46aec5092 build: fix typo in build-scrypt 2021-05-19 13:30:46 +02:00
Jan Hermes
f8347409b8 refactor(core): add check macros
The macros provide a way for cleaner error handling of
return codes (e.g. UA_StatusCode) and append additional
information to logging messages.

Adding file and line numbers to logging messages can be
activated and deactivted via CMake flag.
UA_DEBUG_FILE_LINE_INFO
2021-05-14 15:44:27 +02:00
basyskom-jvoe
8c31fd4dd6
feat(pubsub): Add TLS support for PubSub via MQTT (#3637)
* Add TLS support for MQTT

- OpenSSL only for now
- New connection options mqttUseTLS, mqttCertPath and mqttCaPath

* Add UA_ENABLE_MQTT_TLS option to CMakeLists.txt

* Add client certificate support for MQTT TLS

* Add fallback to DER for client certificate and key

* Use default path if neither mqttCertPath nor mqttCaPath are specified

* Rename mqttCertPath to mqttCaFilePath

* Extend MQTT PubSub example with TLS support

* Fix possible memory leak for mqtt client certificate and private key

* Fix UA_PubSubChannelDataMQTT initialization

* Handle SSL_WANT_READ on connect
2021-04-28 15:37:26 +02:00
Julius Pfrommer
fbc3a4c184 refactor(build): Make PubSub a non-advanced build option 2021-04-17 09:28:39 +02:00
Julius Pfrommer
507113bb4c fix(build): Fix the amalagamation build 2021-04-06 22:24:51 +02:00
Holger Zipper
529aceba51 feat(plugin): Add PubSub-Aes128-CTR encryption plugin 2021-04-05 22:18:58 +02:00
Julius Pfrommer
5ab671ce19 feat(pubsub): Add UA_ENABLE_PUBSUB_ENCRYPTION configuration option 2021-04-05 22:18:58 +02:00
Martina Felber
2285bd00a8 perf(pubsub): Usage of memory pool
Provide a build option to use a static memory buffer instead of
allocations on heap for time critical PubSub parts.
2021-04-03 21:43:02 +02:00
Julius Pfrommer
0d03a87833 refactor(core): Cleanup unused multithreading level 2021-03-30 18:34:24 +02:00
Julius Pfrommer
fa5ed7a4ef Merge branch '1.2' 2021-03-10 22:51:53 +01:00
Julius Pfrommer
ce4b5b513f Merge branch '1.1' into 1.2 2021-03-06 13:40:39 +01:00
Julius Pfrommer
0ad22ad7c5 fix(build): Remove compiler flag that breaks fuzz build
The flag fsanitize-coverage=trace-pc-guard,trace-cmp is no longer needed
for fuzzing and actually breaks the fuzz build now.
2021-03-06 09:04:41 +01:00
Suriya Narayanan Parthasarathi Vimala
0d4ca033a3 refactor(pubsub): Handling of XDP in ethernet.c plugin file
- Added XDP functionalities in ethernet.c
 - New connection config param(enableXdpSocket) to handle XDP

Change-Id: I37eda84d28a474e4c10cd163bf4395f2edd80fa6
2021-02-26 13:03:04 +01:00
Selva Suba Jenifer Joseph
a0806edd3b refactor(pubsub): Update XDP to 5.4 and above kernel
- Static library usage of bpf removed
 - XDP APIs modified with respect to new kernel of 5.4
 - TODO: c99 support

Change-Id: I16cb2092fa9c0385c8f6f6692d6938b4c7d5d9ca
2021-02-26 13:03:04 +01:00
Julius Pfrommer
bdb233e810 refactor(server): Remove the UA_ENABLE_MICRO_EMB_DEV_PROFILE option 2021-02-24 19:48:34 +01:00
Fabrice Fontaine
df0fdefa96 CMakeLists.txt: fix build without C++
This will fix the following build failure:

CMake Error at CMakeLists.txt:2 (project):
  The CMAKE_CXX_COMPILER:

    /srv/storage/autobuild/run/instance-3/output-1/host/bin/arm-linux-g++

  is not a full path to an existing compiler tool.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.

Fixes:
 - http://autobuild.buildroot.org/results/86ca6a5a01ecfc7030c6be0da81924436b41d057

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2021-01-14 14:46:41 +01:00
Julius Pfrommer
2809e7fc18
Merge pull request #4103 from open62541/1.2
Merge 1.2 -> master
2021-01-04 14:04:02 +01:00
Christian von Arnim
787b3d288f Fix: Build shared library with discovery multicast 2020-12-23 23:31:24 +01:00
Julius Pfrommer
c6d336e5f7 Merge remote-tracking branch 'origin/1.2' into merge_12_master_3 2020-12-19 12:32:05 +01:00
Julius Pfrommer
010ba7811f feat(core): Add reusable AA-tree implementation 2020-12-19 05:53:53 +01:00
Suriya Narayanan Parthasarathi Vimala
54bb4159b1 refactor(pubsub): Remove usage of separate ETF plugins
- Used connectionProperties for additional socket options of ETF

Change-Id: I9d21cebe82322a0034de49b8c6f6566e43ea8292
2020-12-11 13:21:57 +01:00