Commit graph

11 commits

Author SHA1 Message Date
Dennis Potman
9f261423e3 Add tests for discovery protection
Adding a test that checks the effects of using different configuration settings
for discovery protection. This test set uses the cryptography wrapper to count
the number of invocations of the encode and decode functions during a session
and checks the counts with the expected values.

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-05-15 15:35:31 +02:00
Dennis Potman
fd27604a26 Add crypto token exchange test
Introduced a test that checks if all crypto tokens send by a node are
received correctly by the remote node. To support this test, the crypto
wrapper plugin is extended with a token_log mode, that stores all tokens
that are exchanged after the security handshake is finished.

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-05-15 15:35:31 +02:00
Dennis Potman
d53cdce8fe Access Control on_revoke_permissions implementation in DDSI
Implement handler for access control on_revoke_permissions. This callback
function disconnects and deletes all proxy participant that are using the
revoked permissions handle (in case of remote permissions expire) and
proxy participant that are connected with a participant for which the
permissions expire (local permissions expire).

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-04-16 15:30:08 +02:00
Dennis Potman
a6a9d1f7c1 Security core tests: new tests and refactoring
Refactoring security core tests and adding more tests:
- Dynamically generate ca and identity certificates in authentication tests, so that certificate expiry is tested.
Added writing/reading samples to these tests to ensure that nodes can (or cannot) communicate in a specific test case
- Secure communication tests: improved the validation of encryption in wrapper
- Added test for access control plugin settings
- Replaced the in-code test identities (and included ca private keys), added an additional identity

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-04-16 15:30:08 +02:00
Erik Boasson
99df0956e7 Crypto endpoint relation compare routines cleanup
* Trying not to assume an int is at least 32 bits.

* Technically speaking, comparing "unrelated" addresses is undefined
  behaviour which can be avoided by a cast to uintptr_t.

* The early out if either local_crypto == 0 does work in context,
  provided the nodes in tree never have local_crypto == 0.  That implies
  crypto_insert_endpoint_relation must never have a 0 in there, which I
  think the callers do respect.  Still I think it is better to not hide
  these assumptions in the compare function and address the problem in
  the lookup function instead.

These changes likely make the code fractionally slower, but I do think
they improve clarity.

Signed-off-by: Erik Boasson <eb@ilities.com>
2020-04-01 09:39:11 +02:00
Marcel Jordense
a77fe10a04 Add index on receiver specific key to improve verification of origin authentication signing
Signed-off-by: Marcel Jordense <marcel.jordense@adlinktech.com>
2020-03-27 16:31:08 +01:00
Dennis Potman
b8537c0d09 Add test in secure_communication suite to validate that payload/submsg/rtps-msg does not contain secret when using encryption protection kind
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-03-05 15:25:16 +01:00
Dennis Potman
e7f5ae354c Fix security handshake test
Isolate domains by using unique tags when running tests that are using security handshake.
And updated coding style and some minor refactoring in fsm and timed_cb tests.

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-03-05 15:25:16 +01:00
Dennis Potman
ea10dbd8e1 Fixes in security core tests: add check that all provided vars are used in variable expansion for test configs, add note on concurrency in authentication wrapper, replace assert by cunit assert in crypto wrapper
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-03-05 15:25:16 +01:00
Dennis Potman
8f464e0c99 Fix writer-reader sync in secure_communication tests
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-03-05 15:25:16 +01:00
Dennis Potman
1cf472ea06 Refactored tests for security core: introduced generic wrappers for security plugins and
updated plugin loading tests to use these instead of specific wrappers per test. Added
test for securing communication ad handshake fail (using different identity CAs)

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2020-03-05 15:25:16 +01:00