-
Notifications
You must be signed in to change notification settings - Fork 791
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Refs #16199: Update CA certificates Signed-off-by: RaulSanchez <raul@eprosima.com> * Update TLS unit test certificates (#4028) * Refs #19937: Update TLS unit test certificates Signed-off-by: EduPonz <eduardoponz@eprosima.com> * Refs #19937: Enable TLS tests in all github CIs Signed-off-by: EduPonz <eduardoponz@eprosima.com> --------- Signed-off-by: EduPonz <eduardoponz@eprosima.com> --------- Signed-off-by: RaulSanchez <raul@eprosima.com> Signed-off-by: EduPonz <eduardoponz@eprosima.com> Co-authored-by: RaulSanchez <raul@eprosima.com> Co-authored-by: Eduardo Ponz Segrelles <eduardoponz@eprosima.com>
- Loading branch information
1 parent
ee0637d
commit 2ae13ef
Showing
19 changed files
with
172 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# FAST DDS SECURITY RESOURCES | ||
|
||
This directory contains several sample files needed to implement secure **TLS over TCP** communication. | ||
These files are required to configure the TCP transport protocol with TLS in Fast DDS. | ||
|
||
> :warning: Do not use these files in a real scenario. Generate your own certificates and parameters. | ||
## COMMANDS | ||
|
||
Following are the commands used to generate this example's keys and certificates | ||
|
||
### Certification Authority (CA) | ||
|
||
```sh | ||
# Generate the Certificate Authority (CA) Private Key > ca.key | ||
openssl ecparam -name prime256v1 -genkey -noout -out ca.key | ||
# openssl ecparam -name prime256v1 -genkey | openssl ec -aes256 -out ca.key -passout pass:cakey # with password | ||
|
||
# Generate the Certificate Authority Certificate > ca.crt | ||
openssl req -new -x509 -sha256 -key ca.key -out ca.crt -days 1825 -config ca.cnf | ||
# openssl req -new -x509 -sha256 -key ca.key -out ca.crt -days 1825 -config ca.cnf -passin pass:cakey # with password | ||
``` | ||
|
||
### Fast DDS Certificate | ||
|
||
```sh | ||
# Generate the Fast DDS Certificate Private Key > fastdds.key | ||
openssl ecparam -name prime256v1 -genkey -noout -out fastdds.key | ||
# openssl ecparam -name prime256v1 -genkey | openssl ec -aes256 -out fastdds.key -passout pass:fastddspwd # with password | ||
|
||
# Generate the Fast DDS Certificate Signing Request > fastdds.csr | ||
openssl req -new -sha256 -key fastdds.key -out fastdds.csr -config fastdds.cnf | ||
# openssl req -new -sha256 -key fastdds.key -out fastdds.csr -config fastdds.cnf -passin pass:fastddspwd # with password | ||
|
||
# Generate the Fast DDS Certificate (computed on the CA side) > fastdds.crt | ||
openssl x509 -req -in fastdds.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out fastdds.crt -days 1825 -sha256 | ||
# openssl x509 -req -in fastdds.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out fastdds.crt -days 1825 -sha256 -passin pass:cakey # with password | ||
``` | ||
|
||
### DH PARAMETERS | ||
|
||
```sh | ||
# Generate the Diffie-Hellman (DF) parameters to define how OpenSSL performs the DF key-exchange > dh_params.pem | ||
openssl dhparam -out dh_params.pem 2048 | ||
``` | ||
|
||
## Use | ||
|
||
```cpp | ||
TCPv4TransportDescriptor recvDescriptor; | ||
recvDescriptor.apply_security = true; | ||
recvDescriptor.tls_config.password = "fastdds"; | ||
recvDescriptor.tls_config.cert_chain_file = "fastdds.crt"; | ||
recvDescriptor.tls_config.private_key_file = "fastdds.key"; | ||
recvDescriptor.tls_config.tmp_dh_file = "dh2048.pem"; | ||
|
||
TCPv4TransportDescriptor sendDescriptor; | ||
sendDescriptor.apply_security = true; | ||
sendDescriptor.tls_config.verify_file = "ca.crt"; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Configuration file for CA request | ||
|
||
[ req ] | ||
distinguished_name = req_distinguished_name | ||
prompt = no | ||
|
||
[ req_distinguished_name ] | ||
countryName = ES | ||
stateOrProvinceName = MA | ||
localityName = Madrid | ||
organizationName = eProsima | ||
organizationalUnitName = eProsima | ||
commonName = eProsima CA | ||
emailAddress = support@eprosima.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIICFDCCAbsCFDIlAUpPsmDIvCdkZWk4YACbWvCIMAoGCCqGSM49BAMCMIGMMQsw | ||
CQYDVQQGEwJFUzELMAkGA1UECAwCTUExDzANBgNVBAcMBk1hZHJpZDERMA8GA1UE | ||
CgwIZVByb3NpbWExETAPBgNVBAsMCGVQcm9zaW1hMRQwEgYDVQQDDAtlUHJvc2lt | ||
YSBDQTEjMCEGCSqGSIb3DQEJARYUc3VwcG9ydEBlcHJvc2ltYS5jb20wHhcNMjMx | ||
MTE3MDcwODIzWhcNMjgxMTE1MDcwODIzWjCBjDELMAkGA1UEBhMCRVMxCzAJBgNV | ||
BAgMAk1BMQ8wDQYDVQQHDAZNYWRyaWQxETAPBgNVBAoMCGVQcm9zaW1hMREwDwYD | ||
VQQLDAhlUHJvc2ltYTEUMBIGA1UEAwwLZVByb3NpbWEgQ0ExIzAhBgkqhkiG9w0B | ||
CQEWFHN1cHBvcnRAZXByb3NpbWEuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcD | ||
QgAEs4pxHmiZi+/ze7NvNNSFbcKEB6bVZ21gl5ERxioMDUkDR0K9NANvCskAiOsS | ||
J2af5dmj/H35NGHm5A1DxbCsSzAKBggqhkjOPQQDAgNHADBEAiA3BeLmwYptJ1Mx | ||
6dEwKb972V8kPu784iJ75/hIWYMAAwIgB+W/TFXYffZu1IwedhkQZ349KSYKNhl4 | ||
UFg1oI2OFHU= | ||
-----END CERTIFICATE----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-----BEGIN EC PRIVATE KEY----- | ||
MHcCAQEEIOCJ0vBvNovjuZGUFBKcg9O8ikmRKyZTQxSuGE7iFWZFoAoGCCqGSM49 | ||
AwEHoUQDQgAEs4pxHmiZi+/ze7NvNNSFbcKEB6bVZ21gl5ERxioMDUkDR0K9NANv | ||
CskAiOsSJ2af5dmj/H35NGHm5A1DxbCsSw== | ||
-----END EC PRIVATE KEY----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
331DDA80816B3193F7538FF21576275FA01CD950 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
-----BEGIN DH PARAMETERS----- | ||
MIIBCAKCAQEAzCEhe/gGZrlKlCXeX56Q+PTOpBJc4fXeflaoVi34Mo4nmZyd2ben | ||
zNq2scVGhiRCem+1zqTj5+fUUC3tieoOgNHsQ2RMX5sAMVqcz34ybJfb3+dzwYA0 | ||
iJmDAgz5LevE3R/Cy0pnwqPLLDLBnnOtuXZnHVddp5gQAVs7NiF3OFOmh1vH44j8 | ||
OvX8gXsSfWv1EKv7MdYp7r+785MhGDdin287NHMXP7Wxb6bO+EM9RSb1Fgw1EFs6 | ||
svgjCDyPzngZCqhPd1rzPf2ZpE6N6qDf+fX4m832JLHISVpC1FbxcZTxw3gGnF4K | ||
xvbhWNAxZubaX7LrOW8k4Xuiy1DxahGjwwIBAg== | ||
-----END DH PARAMETERS----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Configuration file for CA request | ||
|
||
[ req ] | ||
distinguished_name = req_distinguished_name | ||
prompt = no | ||
|
||
[ req_distinguished_name ] | ||
countryName = ES | ||
stateOrProvinceName = MA | ||
localityName = Madrid | ||
organizationName = eProsima | ||
organizationalUnitName = eProsima | ||
commonName = eProsima DB | ||
emailAddress = support@eprosima.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIICFTCCAbsCFBGqg+luTTvQ3zP0TMW1xPag9Iw4MAoGCCqGSM49BAMCMIGMMQsw | ||
CQYDVQQGEwJFUzELMAkGA1UECAwCTUExDzANBgNVBAcMBk1hZHJpZDERMA8GA1UE | ||
CgwIZVByb3NpbWExETAPBgNVBAsMCGVQcm9zaW1hMRQwEgYDVQQDDAtlUHJvc2lt | ||
YSBDQTEjMCEGCSqGSIb3DQEJARYUc3VwcG9ydEBlcHJvc2ltYS5jb20wHhcNMjMx | ||
MTE3MDcwODU4WhcNMjgxMTE1MDcwODU4WjCBjDELMAkGA1UEBhMCRVMxCzAJBgNV | ||
BAgMAk1BMQ8wDQYDVQQHDAZNYWRyaWQxETAPBgNVBAoMCGVQcm9zaW1hMREwDwYD | ||
VQQLDAhlUHJvc2ltYTEUMBIGA1UEAwwLZVByb3NpbWEgREIxIzAhBgkqhkiG9w0B | ||
CQEWFHN1cHBvcnRAZXByb3NpbWEuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcD | ||
QgAERpOOxdxOyNKP5xazr5Yo/hxTkP0xbk0C1dLx8ohD515uzGPUE7fldGTCuMIh | ||
zoZKDhcvK98XfSpNr1PSAVXBjDAKBggqhkjOPQQDAgNIADBFAiAEP2q5dOdZWfco | ||
svCJpkydRpHgozKm1rxh03mH6TeVRwIhAKgYJZmaXaWxvXasrn7ToHQknXJfkkGO | ||
DtxzqPeDgot4 | ||
-----END CERTIFICATE----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
-----BEGIN CERTIFICATE REQUEST----- | ||
MIIBSDCB7wIBADCBjDELMAkGA1UEBhMCRVMxCzAJBgNVBAgMAk1BMQ8wDQYDVQQH | ||
DAZNYWRyaWQxETAPBgNVBAoMCGVQcm9zaW1hMREwDwYDVQQLDAhlUHJvc2ltYTEU | ||
MBIGA1UEAwwLZVByb3NpbWEgREIxIzAhBgkqhkiG9w0BCQEWFHN1cHBvcnRAZXBy | ||
b3NpbWEuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAERpOOxdxOyNKP5xaz | ||
r5Yo/hxTkP0xbk0C1dLx8ohD515uzGPUE7fldGTCuMIhzoZKDhcvK98XfSpNr1PS | ||
AVXBjKAAMAoGCCqGSM49BAMCA0gAMEUCIBNHR6vyWtxu7jnMNPRiJRMq9RKp88OQ | ||
bj+66uL/QDn8AiEAwKVHN9FcM1E2bvTU5A4l/2l+/W+EcRa2b7bzVkfRs4o= | ||
-----END CERTIFICATE REQUEST----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-----BEGIN EC PRIVATE KEY----- | ||
MHcCAQEEIBRqOIY28pjNczTDrKr9DJJVHvn61Ir4BxWdnrw6R0eloAoGCCqGSM49 | ||
AwEHoUQDQgAERpOOxdxOyNKP5xazr5Yo/hxTkP0xbk0C1dLx8ohD515uzGPUE7fl | ||
dGTCuMIhzoZKDhcvK98XfSpNr1PSAVXBjA== | ||
-----END EC PRIVATE KEY----- |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.