Skip to content

Commit e718e64

Browse files
authored
Merge pull request #27 from c-jimenez/releases/v0.4.0
Releases/v0.4.0
2 parents 5304dfd + 0dfcdf9 commit e718e64

File tree

28 files changed

+408
-116
lines changed

28 files changed

+408
-116
lines changed

.github/workflows/c-cpp.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: C/C++ CI
2+
3+
on:
4+
push:
5+
branches: [ develop ]
6+
pull_request:
7+
branches: [ develop ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: make gcc
17+
run: make gcc-native
18+
- name: unit tests gcc
19+
run: make tests-gcc-native
20+
- name: make clang
21+
run: make clang-native
22+
- name: unit tests clang
23+
run: make tests-clang-native
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ develop ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ develop ]
20+
schedule:
21+
- cron: '40 18 * * 0'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: [ 'cpp' ]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v2
42+
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v1
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
52+
53+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54+
# If this step fails, then you should remove it and run the build manually (see below)
55+
# - name: Autobuild
56+
# uses: github/codeql-action/autobuild@v1
57+
58+
# ℹ️ Command-line programs to run using the OS shell.
59+
# 📚 https://git.io/JvXDl
60+
61+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62+
# and modify them (or add more) to build your code if your project
63+
# uses a compiled language
64+
65+
- run: |
66+
make clang-native
67+
68+
- name: Perform CodeQL Analysis
69+
uses: github/codeql-action/analyze@v1

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ project(OpenOCPP)
1010
include(CMakeLists_Options.txt)
1111

1212
# Target toolchain definition and specific compiler flags
13+
if(NOT DEFINED TARGET)
14+
set(TARGET native)
15+
endif()
1316
include(CMakeLists_${TARGET}.txt)
1417

1518
# Subdirectories

examples/common/config/CentralSystemConfig.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ class CentralSystemConfig : public ocpp::config::ICentralSystemConfig
7676
std::string tlsServerCertificatePrivateKeyPassphrase() const override { return getString("TlsServerCertificatePrivateKeyPassphrase"); }
7777
/** @brief Certification Authority signing chain for the server certificate */
7878
std::string tlsServerCertificateCa() const override { return getString("TlsServerCertificateCa"); }
79-
/** @brief Certification Authority signing chain for the clients certificates */
80-
std::string tlsClientCertificateCa() const override { return getString("TlsClientCertificateCa"); }
8179
/** @brief Enable client authentication using certificate */
8280
bool tlsClientCertificateAuthent() const override { return getBool("TlsClientCertificateAuthent"); }
8381

examples/common/config/ChargePointConfig.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ class ChargePointConfig : public ocpp::config::IChargePointConfig
6363
std::string tlsv13CipherList() const override { return getString("Tlsv13CipherList"); }
6464
/** @brief ECDH curve to use for TLS connections */
6565
std::string tlsEcdhCurve() const override { return getString("TlsEcdhCurve"); }
66+
/** @brief Certification Authority signing chain for the server certificate */
67+
std::string tlsServerCertificateCa() const override { return getString("TlsServerCertificateCa"); }
68+
/** @brief Client certificate */
69+
std::string tlsClientCertificate() const override { return getString("TlsClientCertificate"); }
70+
/** @brief Client certificate's private key */
71+
std::string tlsClientCertificatePrivateKey() const override { return getString("TlsClientCertificatePrivateKey"); }
72+
/** @brief Client certificate's private key passphrase */
73+
std::string tlsClientCertificatePrivateKeyPassphrase() const override { return getString("TlsClientCertificatePrivateKeyPassphrase"); }
6674
/** @brief Allow TLS connections using self-signed certificates
6775
* (Warning : enabling this feature is not recommended in production) */
6876
bool tlsAllowSelfSignedCertificates() const override { return getBool("TlsAllowSelfSignedCertificates"); }

examples/quick_start_centralsystem/config/quick_start_centralsystem.ini

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[CentralSystem]
22
DatabasePath=./quick_start_centralsystem.db
33
JsonSchemasPath=../../schemas/ocpp16/
4-
ListenUrl=ws://127.0.0.1:8180/steve/websocket/CentralSystemService/
4+
ListenUrl=wss://127.0.0.1:8080/openocpp/
55
CallRequestTimeout=2000
66
WebSocketPingInterval=30
77
BootNotificationRetryInterval=30
@@ -14,6 +14,5 @@ TlsServerCertificate=../../examples/certificates/open-ocpp_central-system.crt
1414
TlsServerCertificatePrivateKey=../../examples/certificates/open-ocpp_central-system.key
1515
TlsServerCertificatePrivateKeyPassphrase=
1616
TlsServerCertificateCa=../../examples/certificates/open-ocpp_ca.crt
17-
TlsClientCertificateCa=../../examples/certificates/open-ocpp_ca.crt
18-
TlsClientCertificateAuthent=false
17+
TlsClientCertificateAuthent=true
1918
LogMaxEntriesCount=2000

examples/quick_start_chargepoint/config/quick_start_chargepoint.ini

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
[ChargePoint]
22
DatabasePath=./quick_start_chargepoint.db
33
JsonSchemasPath=../../schemas/ocpp16/
4-
ConnexionUrl=ws://127.0.0.1:8180/steve/websocket/CentralSystemService/
4+
ConnexionUrl=wss://127.0.0.1:8080/openocpp/
55
Tlsv12CipherList=ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-WITH-AES-256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:TLS-PSK-WITH-AES-256-GCM-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-WITH-AES-128-GCM-SHA256:DHE-RSA-AES128-GCM-SHA256:TLS-PSK-WITH-AES-128-GCM-SHA256
66
Tlsv13CipherList=TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384
77
TlsEcdhCurve=prime256v1
8-
TlsAllowSelfSignedCertificates=true
9-
TlsAllowExpiredCertificates=true
10-
TlsAcceptNonTrustedCertificates=true
8+
TlsServerCertificateCa=../../examples/certificates/open-ocpp_ca.crt
9+
TlsClientCertificate=../../examples/certificates/open-ocpp_charge-point.crt
10+
TlsClientCertificatePrivateKey=../../examples/certificates/open-ocpp_charge-point.key
11+
TlsClientCertificatePrivateKeyPassphrase=
12+
TlsAllowSelfSignedCertificates=false
13+
TlsAllowExpiredCertificates=false
14+
TlsAcceptNonTrustedCertificates=false
1115
TlsSkipServerNameCheck=true
1216
ChargePointIdentifier=ChargePointTest
1317
ConnectionTimeout=2000

examples/remote_chargepoint/config/remote_chargepoint.ini

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
[ChargePoint]
22
DatabasePath=./remote_chargepoint.db
33
JsonSchemasPath=../../schemas/ocpp16/
4-
ConnexionUrl=ws://127.0.0.1:8180/steve/websocket/CentralSystemService/
4+
ConnexionUrl=wss://127.0.0.1:8080/openocpp/
55
Tlsv12CipherList=ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-WITH-AES-256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:TLS-PSK-WITH-AES-256-GCM-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-WITH-AES-128-GCM-SHA256:DHE-RSA-AES128-GCM-SHA256:TLS-PSK-WITH-AES-128-GCM-SHA256
66
Tlsv13CipherList=TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384
77
TlsEcdhCurve=prime256v1
8-
TlsAllowSelfSignedCertificates=true
9-
TlsAllowExpiredCertificates=true
10-
TlsAcceptNonTrustedCertificates=true
8+
TlsServerCertificateCa=../../examples/certificates/open-ocpp_ca.crt
9+
TlsClientCertificate=../../examples/certificates/open-ocpp_charge-point.crt
10+
TlsClientCertificatePrivateKey=../../examples/certificates/open-ocpp_charge-point.key
11+
TlsClientCertificatePrivateKeyPassphrase=
12+
TlsAllowSelfSignedCertificates=false
13+
TlsAllowExpiredCertificates=false
14+
TlsAcceptNonTrustedCertificates=false
1115
TlsSkipServerNameCheck=true
1216
ChargePointIdentifier=ChargePointTest
1317
ConnectionTimeout=2000

src/centralsystem/CentralSystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ bool CentralSystem::start()
167167
credentials.server_certificate_private_key = m_stack_config.tlsServerCertificatePrivateKey();
168168
credentials.server_certificate_private_key_passphrase = m_stack_config.tlsServerCertificatePrivateKeyPassphrase();
169169
credentials.server_certificate_ca = m_stack_config.tlsServerCertificateCa();
170-
credentials.client_certificate_ca = m_stack_config.tlsClientCertificateCa();
171170
credentials.client_certificate_authent = m_stack_config.tlsClientCertificateAuthent();
171+
credentials.encoded_pem_certificates = false;
172172

173173
// Start listening
174174
ret = m_rpc_server->start(m_stack_config.listenUrl(), credentials, m_stack_config.webSocketPingInterval());

src/centralsystem/interface/ICentralSystemConfig.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ class ICentralSystemConfig
6969
virtual std::string tlsServerCertificatePrivateKeyPassphrase() const = 0;
7070
/** @brief Certification Authority signing chain for the server certificate */
7171
virtual std::string tlsServerCertificateCa() const = 0;
72-
/** @brief Certification Authority signing chain for the clients certificates */
73-
virtual std::string tlsClientCertificateCa() const = 0;
7472
/** @brief Enable client authentication using certificate */
7573
virtual bool tlsClientCertificateAuthent() const = 0;
7674

0 commit comments

Comments
 (0)