Skip to content

Commit 72813c1

Browse files
authored
Merge pull request #36 from c-jimenez/dev/security_secure_connection_user_certificates
Security - Secure connection user certificates
2 parents cf3fd7d + 6071fa7 commit 72813c1

File tree

89 files changed

+5296
-332
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+5296
-332
lines changed

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@ if(NOT DEFINED TARGET)
1515
endif()
1616
include(CMakeLists_${TARGET}.txt)
1717

18-
# Subdirectories
18+
# 3rd party
1919
add_subdirectory(3rdparty)
20+
21+
# OpenSSL is mandatory
22+
find_package(OpenSSL REQUIRED COMPONENTS SSL Crypto)
23+
24+
# Subdirectories
2025
add_subdirectory(examples)
2126
add_subdirectory(src)
2227

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ The standard OCPP configuration persistency has to be handled by the user applic
6767
| Firmware Management | Support for firmware update management and diagnostic log file download | Actual file download/upload as well as firmware installation must be handled by the user application in the callbacks provided by **Open OCPP** |
6868
| Local Auth List Management | Features to manage the local authorization list in Charge Points | None |
6969
| Reservation | Support for reservation of a Charge Point. | None |
70-
| Smart Charging | Support for basic Smart Charging, for instance using control pilot | GetCompositeSchedule is not supported for now in Chare Point role |
70+
| Smart Charging | Support for basic Smart Charging, for instance using control pilot | GetCompositeSchedule is not supported for now in Charge Point role |
7171
| Remote Trigger | Support for remote triggering of Charge Point initiated messages | None |
7272

7373
### Supported OCPP configuration keys
@@ -86,7 +86,7 @@ In the "Owner" column, "S" means that the configuration key behavior is handled
8686
| ConnectionTimeOut | S | None |
8787
| ConnectorPhaseRotation | S | None |
8888
| ConnectorPhaseRotationMaxLength | S | None |
89-
| GetConfigurationMaxKeys | S | Must be set to the sum of OCPP configuration keys count (99) + user application configuration keys count to allow to export all the configuration in 1 message |
89+
| GetConfigurationMaxKeys | S | Must be set to the sum of OCPP configuration keys count (49) + user application configuration keys count to allow to export all the configuration in 1 message |
9090
| HeartbeatInterval | S | Heartbeat are only sent if no messages have been exchanged since HeartbeatInterval seconds |
9191
| LightIntensity | U | None |
9292
| LocalAuthorizeOffline | S | None |
@@ -139,10 +139,9 @@ In the "Owner" column, "S" means that the configuration key behavior is handled
139139
* 2 : TLS with HTTP Basic Authentication
140140
* 3 : TLS with Client Side Certificates
141141

142-
The OCPP use cases to dynamically switch between Security Profiles is not implemented yet.
143-
Only the automatic reconnexion when the **AuthorizationKey** parameter has been modified is implemented.
144-
145-
To switch between Security Profiles, the user application will have to : stop the stack, modify the connexion parameters, restart the stack.
142+
In Charge Point role, the stack will automatically disconnect and then reconnect to the Central System after one of the following parameters has been modified :
143+
* **AuthorizationKey**
144+
* **Security Profile**
146145

147146
#### Security events
148147

@@ -159,6 +158,13 @@ In Charge Point role, the user application can generate custom security events a
159158

160159
**Open OCPP** support this feature for both Charge Point and Central System roles.
161160

161+
#### Certificate management messages
162+
163+
**Open OCPP** support this feature for both Charge Point and Central System roles.
164+
165+
The actual storage of the certificates and their keys must be done by the user application.
166+
167+
**Open OCPP** provides callbacks and helper classes to ease certificate manipulation and installation.
162168

163169
## Build
164170

examples/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ add_subdirectory(common)
44
add_subdirectory(quick_start_centralsystem)
55
add_subdirectory(quick_start_chargepoint)
66
add_subdirectory(remote_chargepoint)
7+
add_subdirectory(security_centralsystem)
8+
add_subdirectory(security_chargepoint)

examples/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ The following examples are available :
66
* [Quick start Central System example](./quick_start_centralsystem/README.md)
77
* [Quick start Charge Point example](./quick_start_chargepoint/README.md)
88
* [Remote Charge Point example](./remote_chargepoint/README.md)
9+
* [Security Charge Point example](./security_chargepoint/README.md)
910

1011
How to run the examples:
1112
* Customize the *config.ini* file of the selected example with the URL of the Central System and the other connection parameters has well has the OCPP configuration keys

examples/certificates/open-ocpp_ca.cnf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ subjectAltName = @alt_names
2222

2323
[alt_names]
2424
DNS.1 = localhost
25-
DNS.2 = IP:127.0.0.1
25+
IP.1 = 127.0.0.1
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
-----BEGIN CERTIFICATE-----
2-
MIICfjCCAiSgAwIBAgIUROpklJY2B+02oFHz1MvijdkjtvgwCgYIKoZIzj0EAwIw
2+
MIICdjCCAhygAwIBAgIUU00opFUZAFZnWYQ+kgYIY/xRtrkwCgYIKoZIzj0EAwIw
33
gaMxCzAJBgNVBAYTAkZSMQ8wDQYDVQQIDAZTYXZvaWUxETAPBgNVBAcMCENoYW1i
44
ZXJ5MRIwEAYDVQQKDAlPcGVuIE9DUFAxETAPBgNVBAsMCEV4YW1wbGVzMSgwJgYD
55
VQQDDB9PcGVuIE9DUFAgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MR8wHQYJKoZIhvcN
6-
AQkBFhBjYUBvcGVuLW9jcHAub3JnMB4XDTIyMDEyNTA4MjQzM1oXDTMyMDEyMzA4
7-
MjQzM1owgaMxCzAJBgNVBAYTAkZSMQ8wDQYDVQQIDAZTYXZvaWUxETAPBgNVBAcM
6+
AQkBFhBjYUBvcGVuLW9jcHAub3JnMB4XDTIyMDEyODIyMTAwOVoXDTMyMDEyNjIy
7+
MTAwOVowgaMxCzAJBgNVBAYTAkZSMQ8wDQYDVQQIDAZTYXZvaWUxETAPBgNVBAcM
88
CENoYW1iZXJ5MRIwEAYDVQQKDAlPcGVuIE9DUFAxETAPBgNVBAsMCEV4YW1wbGVz
99
MSgwJgYDVQQDDB9PcGVuIE9DUFAgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MR8wHQYJ
1010
KoZIhvcNAQkBFhBjYUBvcGVuLW9jcHAub3JnMFkwEwYHKoZIzj0CAQYIKoZIzj0D
11-
AQcDQgAEJZAFFCLPK7VimsLANzt6QEVVASRfqG+w6/oiCksM8l5/UkbtMi07Eum9
12-
IS1opxqsf5dPrGnLVz2wslSEsdHiaqM0MDIwDAYDVR0TBAUwAwEB/zAiBgNVHREE
13-
GzAZgglsb2NhbGhvc3SCDElQOjEyNy4wLjAuMTAKBggqhkjOPQQDAgNIADBFAiEA
14-
9Dwgm5x0hw+wRtek9UJ1aJdwmlVgHCeGqFUjwArjn1YCIES6iO0nG+sMMFhWdRHZ
15-
nmfCimIZKr/bIH6EefWzbg9s
11+
AQcDQgAELROcaZSbNQBW3xu4p6M38kFlL+nZvX+CCxZlZm8AYvT8CScbiEIhs4Yx
12+
pwPc7rw0Rg+ke+7mpiyVO6eckW8AA6MsMCowDAYDVR0TBAUwAwEB/zAaBgNVHREE
13+
EzARgglsb2NhbGhvc3SHBH8AAAEwCgYIKoZIzj0EAwIDSAAwRQIhAMnF/jvtMu9u
14+
LYlG6BtNb0QImbRACsJTvbc8vy0UWLqdAiA4SZLw3/jm6Wt0/KUBCauh9Q3ng4R7
15+
nra7+SE7jsfQGQ==
1616
-----END CERTIFICATE-----
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-----BEGIN EC PRIVATE KEY-----
2-
MHcCAQEEIDKwZrJhHkMw8cMAUNRgXzaFKlnimYYY8xB6ifuL/s4OoAoGCCqGSM49
3-
AwEHoUQDQgAEJZAFFCLPK7VimsLANzt6QEVVASRfqG+w6/oiCksM8l5/UkbtMi07
4-
Eum9IS1opxqsf5dPrGnLVz2wslSEsdHiag==
2+
MHcCAQEEIIaECY0903wV9XcY5RlURk0WsHpCL2n8B/VzUwZ1+TZpoAoGCCqGSM49
3+
AwEHoUQDQgAELROcaZSbNQBW3xu4p6M38kFlL+nZvX+CCxZlZm8AYvT8CScbiEIh
4+
s4YxpwPc7rw0Rg+ke+7mpiyVO6eckW8AAw==
55
-----END EC PRIVATE KEY-----

examples/certificates/open-ocpp_central-system.cnf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ subjectAltName = @alt_names
2222

2323
[alt_names]
2424
DNS.1 = localhost
25-
DNS.2 = IP:127.0.0.1
25+
IP.1 = 127.0.0.1
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
-----BEGIN CERTIFICATE-----
2-
MIICgDCCAiagAwIBAgIUE0SqeLRrvEnH5WWw36XvPEisumMwCgYIKoZIzj0EAwIw
2+
MIICeDCCAh6gAwIBAgIUE0SqeLRrvEnH5WWw36XvPEisumcwCgYIKoZIzj0EAwIw
33
gaMxCzAJBgNVBAYTAkZSMQ8wDQYDVQQIDAZTYXZvaWUxETAPBgNVBAcMCENoYW1i
44
ZXJ5MRIwEAYDVQQKDAlPcGVuIE9DUFAxETAPBgNVBAsMCEV4YW1wbGVzMSgwJgYD
55
VQQDDB9PcGVuIE9DUFAgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MR8wHQYJKoZIhvcN
6-
AQkBFhBjYUBvcGVuLW9jcHAub3JnMB4XDTIyMDEyNTA4MjQzM1oXDTMyMDEyMzA4
7-
MjQzM1owgagxCzAJBgNVBAYTAkZSMQ8wDQYDVQQIDAZTYXZvaWUxETAPBgNVBAcM
6+
AQkBFhBjYUBvcGVuLW9jcHAub3JnMB4XDTIyMDEyODIyMTAwOVoXDTMyMDEyNjIy
7+
MTAwOVowgagxCzAJBgNVBAYTAkZSMQ8wDQYDVQQIDAZTYXZvaWUxETAPBgNVBAcM
88
CENoYW1iZXJ5MRIwEAYDVQQKDAlPcGVuIE9DUFAxETAPBgNVBAsMCEV4YW1wbGVz
99
MSEwHwYDVQQDDBhPcGVuIE9DUFAgQ2VudHJhbCBTeXN0ZW0xKzApBgkqhkiG9w0B
1010
CQEWHGNlbnRyYWwuc3lzdGVtQG9wZW4tb2NwcC5vcmcwWTATBgcqhkjOPQIBBggq
11-
hkjOPQMBBwNCAAR677GKDxt/gxd7ijqSvhF61+ETcNAvleHheWYuMiDQdfkVazz/
12-
pEBvvyRDiYpL39GyLubcW0cFJY41inripW44ozEwLzAJBgNVHRMEAjAAMCIGA1Ud
13-
EQQbMBmCCWxvY2FsaG9zdIIMSVA6MTI3LjAuMC4xMAoGCCqGSM49BAMCA0gAMEUC
14-
IH2UJPDnxHhg6nT/GnW+qIDvas7BSAZMIRQQpzYpxINaAiEA1Xe79Q7BUJ98esNN
15-
NhtHEYmVcY4Pjzdb6r75m/vjJN4=
11+
hkjOPQMBBwNCAASQh65x/PvhYJJneJ4+SvRs8UFU86LvZatCsquGNbKFOPun8cRP
12+
VO/4kFRvQ5ePBCAjzKoPQD7n+U5ROZCWoDTuoykwJzAJBgNVHRMEAjAAMBoGA1Ud
13+
EQQTMBGCCWxvY2FsaG9zdIcEfwAAATAKBggqhkjOPQQDAgNIADBFAiEAiSPkDrFg
14+
ktbdMtzzi6AQgwbcQYDkmMmZKVoXjLqysrkCIBAfo0Iaj5/ZLGFKpaU7vvhR1CNb
15+
eavbFo36TILEfKYe
1616
-----END CERTIFICATE-----
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-----BEGIN EC PRIVATE KEY-----
2-
MHcCAQEEIFzxXv+7UwwnKeLgp8IB01r+fs5qAXiqjo8Ji/QJyCMjoAoGCCqGSM49
3-
AwEHoUQDQgAEeu+xig8bf4MXe4o6kr4RetfhE3DQL5Xh4XlmLjIg0HX5FWs8/6RA
4-
b78kQ4mKS9/Rsi7m3FtHBSWONYp64qVuOA==
2+
MHcCAQEEIBgb3p8yNSp0jonK6hQ/34jx8uVHVZJ6DkeiftklrDYxoAoGCCqGSM49
3+
AwEHoUQDQgAEkIeucfz74WCSZ3iePkr0bPFBVPOi72WrQrKrhjWyhTj7p/HET1Tv
4+
+JBUb0OXjwQgI8yqD0A+5/lOUTmQlqA07g==
55
-----END EC PRIVATE KEY-----

0 commit comments

Comments
 (0)