Commit Graph

49 Commits

Author SHA1 Message Date
Noel Graf d49cb241ba feat(example): Add an example of using encryption with a filestore backend 2025-01-24 22:34:30 +01:00
Julius Pfrommer c8146660a4 refactor(examples): Use the AcceptAll certificate verification for the examples
Don't require the examples to have the remote certificate in a
trustlist.  This reduces initial confusion and still logs a warning.
2024-12-10 08:28:30 +01:00
Julius Pfrommer 9ae8b76986 refactor(plugins): Use urn:open62541.unconfigured.application as the default ApplicationUri
We want to have the same default for client and server. So we get less
trouble with reusing certificates. Before we had to manually adjust the
client URI to say "server". That's not good...
2024-12-10 08:28:30 +01:00
Julius Pfrommer 2b445aecf6 Merge remote-tracking branch 'origin/1.4' into merge_14_master_23 2024-11-05 17:19:45 +01:00
Julius Pfrommer c5f214ee4c refactor(examples): Remove misleading comments - revocation lists are supported 2024-10-23 07:18:22 +02:00
Julius Pfrommer 705801a55c refactor(examples): Use the NS0ID shorthand in the examples 2024-07-26 08:30:16 +02:00
Julius Pfrommer eab68cf716 refactor(pubsub): Always compile encryption for PubSub
This removes the UA_ENABLE_PUBSUB_ENCRYPTION option entirely.
Its not much code and the complexity gets reduced.
2024-07-20 11:42:05 +02:00
Noel Graf 1f19a8e484 feat(plugins): Support certificate generation with mbedTLS. (#6145) 2024-01-11 16:08:37 +01:00
Julius Pfrommer 2bd9e723ad refactor(build): Remove UA_ENABLE_PUBSUB_ETH_UADP option - now part of the EventLoop 2023-10-07 23:07:54 +02:00
basyskom-dege 0f055942b7 feat(CI): Added support for arguments in the examples workflow (#5760)
* CI: Added support for arguments in the examples workflow

* Fixed memory leaks in examples. Add ApplicationUri

* Arguments and server/client for all examples. Small fixes

* outsource/blacklist some examples. Fix memory leak in example.

* Remove Shlex. Remove false UA_Client_delete

* Removed raw examples from ci. Fix leak in client.c and mqtt_publish

* Fix memory leak in mqtt subscriber
2023-07-02 02:58:40 +02:00
Julius Pfrommer 66696402ae refactor(plugin): Remove usage of old networking API for Websockets 2023-06-26 13:27:18 +02:00
Martin Brenner 08a533464d feat(plugin): Make the certificate key length and expiration date configurable (#5713) 2023-05-02 15:28:51 +02:00
Julius Pfrommer 20ad12c6db fix(examples): Fix ctrl-c during certificate generation in server_encryption.c 2023-03-27 11:23:41 +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 3dc93eaa90 refactor(examples): Return EXIT_SUCCESS for the valgrind run 2023-02-20 02:11:56 +01:00
Julius Pfrommer 6e618fdb78 refactor(client): Always first set the connectStatus, then close the SecureChannel 2023-01-06 17:05:37 +01:00
Andreas Eckerstorfer 13af9b8688 refactor(core): Remove trailing spaces in code (#5221) 2022-06-24 11:03:25 +02:00
Kjeld Flarup 2d59c7d367 feat(examples): Example client_encryption: If one of the specified certificate files is in wrong format, the example ignored this and continued with policy #None (#3405)
Signed-off-by: Kjeld Flarup <kfa@deif.com>
2022-06-10 01:04:47 +02: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
Christian von Arnim 028421225b feat(ex): Use UA_CreateCertificate in server_encryption
Co-authored-by: Julius Pfrommer <julius.pfrommer@web.de>
2021-08-09 16:38:57 +02:00
Joakim Roubert d69ee99f4d Fix(doc): Documentation spelling fixes (#4472)
Signed-off-by: Joakim Roubert <joakimr@axis.com>
2021-06-14 21:50:36 +02:00
Julius Pfrommer 7e4f8f15c4 fix(examples): Make server_encryption.c clang-analyzer clean 2021-02-28 07:05:05 +01:00
Julius Pfrommer b1d5a51366 fix(examples): Make client_encryption.c clang-analyzer clean 2021-02-28 07:05:05 +01:00
demike 5dea0e3898 feat(core): Add support for WebSocket Secure (wss) (#3779)
* fix: websocket not disconnecting

* feat: allow official opcua proto opcua+uacp/+json

* fix: disable opcua+json protocol for now

* feat: initial commit

* feat: add wss support + example

* fix: wrong condition + memory leak

* fix: typo
2020-09-13 11:25:43 +02:00
Asish Ganesh 436f29b03a [TASK] Pass issuer list separately
- At present issuer list is passed in trust list
 - Add functionality to pass the issuer list separately
 - Handle condition where a client is connected using
   an (trusted) issued certificate of a CA that is not
   trusted but available
 - This resolves test case number 044.js and 045.js in
   Security Certificate Validation to pass simultaneously
 - usage : ./server_ctt <server-certificate.der> <private-key.der>
           [--trustlist <tl1.ctl> <tl2.ctl> ... ]
           [--issuerlist <il1.der> <il2.der> ... ]
           [--revocationlist <rv1.crl> <rv2.crl> ...]

Change-Id: I4a25af9f4c2b771da9492fafb534f72dcc6fc17d
Signed-off-by: Asish Ganesh <asish.g@kalycito.com>
2019-07-05 14:10:17 +02:00
Julius Pfrommer fd08d012d9 Server: Initialize the config in the server 2019-04-23 00:41:32 +02:00
Stefan Profanter 63f3653ff1 Additional header cleanup and consistent name of ns generated files 2019-03-21 20:16:31 +01:00
Julius Pfrommer c9c818868f Move header files to a more unix-like structure
This commit drops the 'ua_' prefix and changes the public includes
to the form `#include <open62541/server.h>` instead of the old
`#include <ua_server.h>`
2019-03-21 20:16:31 +01:00
Julius Pfrommer afec3480a6 Examples: Force encryption to be used with the client_encryption example 2019-03-18 16:37:20 +01:00
Frank Meerkoetter 1648fb8aaa Use EXIT_SUCCESS/FAILURE for the examples
Make use of EXIT_SUCCESS and EXIT_FAILURE from stdlib.h.
The previous approach of returning a value from UA_StatusCode
was often broken as an exit code can (portably) only be between 0 and 125.
2019-02-09 09:34:46 +01:00
Julius Pfrommer f85607bc77 Examples: Force SignAndEncrypt for the client encryption example 2019-01-30 18:45:42 +01:00
Julius Pfrommer bcaa6695c0 Client: Store SecurityPolicies in the client config; Refactor connection logic 2019-01-30 18:45:42 +01:00
Julius Pfrommer b4c9fc37eb Client: Initialize client config inside the client structure
Temporarily disable encyrption
2019-01-30 18:45:42 +01:00
Frank Meerkoetter defe399445 Remove comments - I felt to be misleading
UA_ByteStrings aren't refcounted. The call to UA_ByteString_delete()
surely frees the memory. It does not derefence a string.
2019-01-21 10:02:07 +01:00
Stefan Profanter d715db1057 Stack: Use non-amalgamated headers in all the examples
For consistency we recommend using non-amalgamation install, thus the
examples should also use the non-amalgamated headers.
2018-12-17 22:40:07 +01:00
Julius Pfrommer eb9409b435 Examples: Use _clear instead of _deleteMembers for the examples 2018-12-09 19:40:02 +01:00
Jose Cabral 1605455a74 Fixes #1925 and clean examples 2018-07-25 08:17:51 +02:00
Sharavanan A R 6d7f08b641 [FIX] Trust list verification for secure client application
- Update UA_ByteString_allocBuffer() to UA_STACKARRAY() in the files
   examples/encryption/client_basic128rsa15.c and examples/encryption/
   client_basic256sha256.c.
 - Handle return value for remote certificate verification in
   ua_client.c file.
 - Update create_self-signed.py to generate CA certificate in .der
   format.

Change-Id: I6e84694c99c561d237ecbafb63b957d19c2e74c9
Signed-off-by: Sharavanan A R <sharavanan.ar@kalycito.com>
2018-04-16 10:44:33 +02:00
StalderT f144f0eabc fix securityPolicyUri selection (#1713)
* fix example selecting the correct endPoint

* fix ua_client_connect to use the correct policyUri

* fix load certificate order
2018-04-06 11:41:53 +02:00
StalderT 0702cc9bc2 unify include common.h 2018-04-05 12:51:14 +02:00
Mark 3b7d4d426d Add common.h to cmake project 2018-04-04 10:27:55 +02:00
StalderT da64add5c0 client basic 256sha256 / server sample / tests / various fixes (#1691)
* client basic 256sha256 / tests / various fixes

* fix server basic256sha256

* remove duplicated loadFile

* Fix fuzzing by making backup of message buffer

* Disable sonarcloud on PRs
2018-03-29 19:15:20 +02:00
Sharavanan A R 9093197f88 [FEATURE] Secure client implementation using basic128rsa15 policy
- The file examples/encryption/client_basic128rsa15.c provides a
   secure communication between client and server by using
   basic128rsa15 security policy.
 - The secure client-server communication is implemented
   based on the OPC UA specification Part 4, setion 6.
 - Line number 176 in file src/client/ua_client.c is commented as
   UA_SecureChannel_deleteMembers already done in
   UA_client_disconnect function.
 - Load revocation list is not supported in this commit.

Change-Id: I9aa06dce6ac000c290accc57f1147a919ec74f1e
Signed-off-by: Sharavanan A R <sharavanan.ar@kalycito.com>
2018-03-24 18:44:54 +01:00
Julius Pfrommer 46979d3b87 replace alloca with variable-length arrays and alloca as fallback 2018-03-16 15:33:02 +01:00
Mark Giraud 2110c8892e Fix windows script and warning (#1558) 2018-01-30 15:43:46 +01:00
StalderT dedff4d9d6 fix loadFile when alloc error (#1525)
* fix loadFile when alloc error

* fix loadFile when alloc error (basic128rsa15)
2018-01-20 01:26:01 +01:00
Infinity95 adf793b2ef Implement SecurityPolicy#Basic128Rsa15 with mbedTLS
seed rng correctly, don't use md_internal.h

move sha1 message digest into policy context

less casting in methods
2018-01-17 15:05:00 +01:00