Add fix suggested in sros2 bug report. #1552
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes #1546 using the same method as OpenDDS/OpenDDS#3992 (comment).
As stated in: OpenDDS/OpenDDS#3992 (comment)
"Implement the suggestion in ros2/sros2#282.
Specifically, use PKCS7_NOINTERN to not accept any signatures in the signed document. This, in turn, requires the use of the certs parameter to PKCS7_verify. PKCS7_NOVERIFY is used since the permissions CA certificate will not be chain verified."
Verification
I built ros2 rolling from source with cyclonedds tag 0.10.2 checked out and used the scripts here copied and slightly modified from the sros2 issue to verify the reported issue. Specifically, the should-fail script should not allow the subscriber to receive messages at the end.
I then cherry-picked this issue a branch forking from the 0.10.2 tag and verified the should-fail script now failed. I used the should-succeed script to test a configuration where the permissions did allow the two nodes to talk, and verified that worked as well.
I referenced the openssl docs here to confirm the API and heavily based this PR on the OpenDDS PR linked above.
Fixes: #1546
Related to: ros2/sros2#282
Signed-off-by: James Pace [email protected]
(Apologies for the last PR. I was a little quick to the draw there...)