Commit Graph

64 Commits

Author SHA1 Message Date
Jesse Kerkhoven 9788955003 Fix: Terminate session after Metering Receipt when requesting STOP Charging. Fixes #66 2021-10-18 15:07:30 +02:00
Marc Mültin 9abd5ae729 Updated version number from 1.2.5 to 1.2.6 2020-07-23 17:41:52 +01:00
Marc Mültin b5beeca0db
Merge pull request #46 from mrbig/master
Remove singleton instances once the client is finished
2020-07-23 17:37:51 +01:00
Nagy Attila Gabor 79917ab517 Inlined releaseInstance methods 2020-05-03 12:31:33 +02:00
Marc Mültin ebd66e446e Fixed a potential NullPointerException when UDP client tries to send an SECCDiscoveryReq message although the getLinkLocalAddress method of the class shared.utils.MiscUtils doesn't find a valid network interface according to the name found in the EVCCConfig.properties file. 2020-05-02 15:03:09 +02:00
Marc Mültin 7fb507a075 Added comment on how to make sure only the name elliptic curve "secp256r1" is allowed for ECDH(E). 2020-05-02 12:14:01 +02:00
Nagy Attila Gabor a3b5c94d65 Remove singleton instances once the client is finished
This can prevent unwanted behavior to happen because of missing
initialization
2020-03-28 19:12:37 +01:00
Nagy Attila Gabor 0909d425a9 Replaced DummyEVController with the appropriate interface 2020-03-22 23:29:36 +01:00
Marc Mültin d3ae17798b The requirement [V2G2-684] was not implemented so far, this commit takes care of this now (sending an empty AuthorizationReq message if the EVSEProcessing field of AuthorizationRes is set to 'Ongoing') 2020-02-27 08:36:56 +01:00
Marc Mültin 5aa6cd3179 Modified pom.xml files regarding project version 2019-10-08 17:15:45 +02:00
Marc Mültin 2ae27ebeb5 Updated the version number of the pom.xml files to the newest release 1.2.5 2019-10-01 12:12:35 +02:00
Marc Mültin e6f7b4fd4e Implemented a working mechanism for pausing and resuming a charging session 2019-10-01 11:30:09 +02:00
Marc Mültin c1140f98e7 Fixed copyright header (date) 2019-09-28 18:14:15 +02:00
Marc Mültin 4546e0e229 Added a check for unreasonably high payloads 2019-09-28 17:48:58 +02:00
Marc Mültin e4cc39807e Added mechanism in DummyEVController to trigger a renegotiation after 50 charging loops. Modified WaitForChargingStatusRes, WaitForCurrentDemandRes, and WaitForMeteringReceiptRes accordingly. 2019-08-17 18:58:36 +02:00
Jesse Kerkhoven dbd0fe8da3 Fix typo that results in a null pointer
The old implementation uses a bitwise comparison 
that will validate both statements and will result
in a null pointer. The fix will do a
 logic comparison that will return if the first 
statement is null
2019-06-20 22:56:24 +02:00
Marc Mültin d3485324fe Modified pom.xml files to reflect new version 1.2.4 of RISE V2G 2019-03-21 09:34:42 +01:00
Marc Mültin df3838b3f6 Updated pom.xml files to reflect the new version 1.2.4 2019-03-20 20:59:42 +01:00
Marc Mültin 0bf6d51748
Merge pull request #30 from mrbig/f/dynamic_implementation_loader
Made implementation classes configurable from the respective properties file
2019-02-09 18:15:59 +01:00
Nagy Attila Gabor 6e1d7fbcb7 Refactored controllers to use a default constructor
This makes the instantiation much cleaner, and also makes the
responsibility of the controller more clear.

Now we pass the communication session to the controller right
after instantiation inside the ImplementationFactory
2019-02-08 22:10:45 +01:00
Nagy Attila Gabor 5ccf4ceaad Fixed typos in documentation and exception 2019-02-07 20:25:08 +01:00
Nagy Attila Gabor 339cc722ac Made implementation classes configurable from the respective properties file
This way implementation classes for EV/SE side controllers could be
replaced without touching the mainline code. I believe this will
simplify forking and extending the project.
2019-01-26 18:07:48 +01:00
Nagy Attila Gabor 39cb8a895b Fixed trivial raw type assignments 2019-01-24 18:15:56 +01:00
Marc Mültin 56c88f910e Added a check for an empty SASchedules in WaitForChargeParameterDiscoveryRes.java in case EVSEProcessing is set to FINISHED. In that case, SASchedules must be present. 2018-12-17 12:54:07 -03:00
Marc Mültin cc26d2a239 The field 'ReceiptRequired' in the ChargingStatusRes message is optional. Fixed the code in EVCC's class WaitForChargingStatusRes.java so that it does not necessarily expect the field 'ReceiptRequired' to be set (otherwise a NullPointerException would be thrown). Also made sure that WaitForChargingStatusRes.java only sends a MeteringReceiptReq message if the connection is secured by TLS - as signed MeteringReceiptReq messages are only possible with Plug & Charge that demands TLS to be used. 2018-11-13 21:24:58 +01:00
Marc Mültin a74e0ad073 The field 'ReceiptRequired' in the CurrentDemandRes message is optional. Fixed the code in EVCC's class WaitForCurrentDemandRes.java so that it does not necessarily expect the field 'ReceiptRequired' to be set (otherwise a NullPointerException would be thrown). 2018-11-13 21:14:22 +01:00
Marc Mültin 3389c669af Corrected timeout value for supportedAppProtocolResponse. Value was set statically to 2 seconds. Now the value given in TimeRestrictions.java (located in package com.v2gclarity.risev2g.shared.misc) is taken instead. 2018-08-18 12:29:12 +02:00
Marc Mültin a15e4ff29e Rewrote the generateCertificates script 2018-08-15 12:30:36 +02:00
Marc Mültin b2b8ad07c2 - Updated the generateCertificates.sh script with slight modifications to the documentation and commands for generating all certificates needed for Plug & Charge
- Fixed a minor error in WaitForPowerDeliveryRes.java with regards to setting states B and C for WeldingDetectionReq
2018-07-31 17:18:21 +02:00
Marc Mültin cba5e041f6 - TargetCurrent in DummyEVController, used in PreChargeReq message, was set to 2A to comply to IEC 61851-23
- The necessary change from State C to State B during a renegotiation in DC charging is now correctly implemented
- Added the EV setting "voltage.accuracy" to allow for a percentage of deviation from the target current in PreCharge
2018-04-25 10:14:34 +02:00
Marc Mültin 0e4b838f8d Fixes issues #18 (chargingLoop counter was disregarded when sending MeteringReceiptRes) and #19 (error in DER encoding of ECDSA signature) 2018-01-12 10:32:30 +02:00
Marc Mültin 6f6be89a09 Improved the performance of RISE V2G by converting the MessageHandler into a Singleton. When instantiating the MessageHandler, the JAXB Context is set which is a pretty time-consuming task. Before the improvement, the MessageHandler was instantiated by the V2GCommunicationSessionHandlerSECC and the V2GCommunicationSessionHandlerSECC class.
Additionally, the MessageHandler was instantiated each time a new communication session was initiated by the EVCC.

Now, MessageHandler is initialized only once at startup of RISE V2G, saving a few seconds processing time on a slow embedded controller.
Credit goes to Advantics for pointing this out! Thanks. :)

Further changes: minor editorial edits and an additional logging message in the ConnectionHandler stating the length of the V2GTP payload as stated by the V2GTP header (helps for debugging purposes)
2018-01-01 21:35:44 +02:00
Marc Mültin babd2ee114 Changelog 13.10.17:
- Changed package name from org.v2gclarity.risev2g to com.v2gclarity.risev2g
- Changed pom.xml and bin.xml files for creating deployable .jar files with Maven
- Added RISE-V2G-Parent project folder for Maven to facilitate an easy build process that has now be reworked in this version
2017-10-13 12:30:15 +02:00
Marc Mültin 374e06e843 Changelog:
- Removed some unused imports
- Bugfix in MessageHandler's getJaxbElement when creating the JAXBElement for SalesTariff. Corrected the namespace to create the QName object from MsgBody to MsgDataTypes
- Removed the libs folder in RISE-V2G-SHARED as it is not needed with Maven
2017-09-26 12:26:50 +02:00
Marc Mültin d8c9fc7bcd Changelog commit 15.9.17
- Added copyNewCertsAndKeys.bat and generateCertificates.bat to RISE-V2G-Certificates in order to port the already existing Unix shell scripts to Windows systems
- Corrected an error in V2GCommunicationSessionHandlerEVCC.java which ensures that the SDP procedure continues to work correctly even if there is a false SDP response coming from the SECC
- Changed the signature of the method generateDigest() (in SecurityUtils.java) to have more logging information about the ID of the element for which the digest is generated
- Made sure that the PreCharge timeout and CableCheck timeout are triggered exactly (there was a possible delay of 2s)
- Changed logging level of TCP server and client from debug to info
- Added debugging logging functionality with new EVCC and SECC property HexAndBase64RepresentationOfMessages which will log the hexadecimal and Base64 encoding of each message being sent
- Small change in log4j2.xml files enabling highlighting of logging level (you need to have ANSI Console installed in Eclipse IDE for this change to take effect)
- Shifted the process of reading the MO Sub-CA 2 private key from the keystore from the method getMOSubCA2PrivateKey to the constructor of DummyBackendInterface.java in order to avoid timeouts when processing the ChargeParameterDiscoveryReq on embedded devices
- Updated the EXIficient_V2G_CI_MsgDef.java (serialized version of the XSD grammar) as there was an bug before that caused an incomplete deserialization of an EXI byte stream to an XML message
- Updated log4j from 2.1 to 2.9
2017-09-15 16:15:25 +02:00
Marc Mültin 084320d6d6 Loading EXIficient is now much faster than before. XSD schema files have been converted to EXI grammar Java files. Also, JAXB context is now only set once at startup of SECC and EVCC respectively as setting the JAXB context is a very time consuming task. 2017-08-31 17:11:16 +02:00
Marc Mültin 7cd067c118 Added property "EXICodec" in EVCCConfig.properties and SECCConfig.properties to set the EXI codec. Changed the handling in the constructor of the MessageHandler.java accordingly. 2017-08-30 18:32:09 +02:00
Marc Mültin ee5756c592 Minor changes in transport layer classes and main method 2017-08-29 17:34:52 +02:00
Marc Mültin 1cda643223 Avoid NullPointerException in WaitForSupportedAppProtocolRes.java 2017-08-23 11:29:07 +02:00
Marc Mültin 0cac87ea24 Ongoing timer settings in V2GCommunicationSessionEVCC.java 2017-08-23 11:28:14 +02:00
Marc Mültin af1f3480e0 Added PreCharge Timer, CableCheck Timer to TimeRestrictions.java and added handling for those timers in EVCC package.
Minor bugfixing with regards to genChallenge in AuthorizationReq
2017-08-23 11:26:34 +02:00
Marc Mültin d933ba39ad Added functionality in IEVController and DummyEVController which enables a predefined number of loops for ChargingStatusReq/-Res and CurrentDemandReq/-Res message pairs 2017-08-22 00:12:33 +02:00
Marc Mültin 788280cd68 - Replaced System.currentTimeMillis() by System.nanoTime() for timing tasks.
- Changed the way how JAXBElements are created due to particularities with the creation of the XML Reference elements for the CertificateInstallationRes and CertificateUpdateRes messages. The JAXBContext is now set exactly for the message or field that is to be marshaled into XML. As a result, the JAXBContext is no more set in the EXI codec, but in the MessageHandler
- SecurityUtils.java has been partly rewritten with regards to the verification of certificate chains. See also verifyCertificateChain(…) method.
- Requirement [V2G2-812] is not implemented.
- When the EVCC sends a message out of the correct order which would induce a FAILED_SequenceError message, the SECC now sends the response message corresponding to the request message sent by the EVCC instead of the response message corresponding to the message the SECC would expect. As a result, ServerState.java has partly been rewritten and all SECC states have been adapted to it.
- Charge parameter provided by ChargeParameterDisoveryReq message are now thoroughly checked by the SECC. See also verifyChargeParameter(…) method.
- Charging profile provided by PowerDeliveryReq message is now thoroughly checked by SECC. See also isChargingProfileValid(…) method.
- New enum class PKI is added to shared.enumerations package. Needed for certificate chain checks in SecurityUtils.java.
- Some bugfixes in V2GTPMessage so that headers are not checked correctly.
2017-08-20 23:26:22 +02:00
Marc Mültin d61fde3264 Changed package structure from org.eclipse.risev2g to org.v2gclarity.risev2g 2017-07-22 19:20:04 +02:00
Marc Mültin b0c4b6d657 Changed license from EPL to MIT and updated README.md 2017-07-20 21:06:26 +02:00
Marc Mültin 6b366610bc Commit-Nachricht für RISE V2G
- Signature creation and verification has been fixed and works now properly. Has been tested against various industry OEMs and suppliers.
SecurityUtils.java class was substantially revised as part of fixing the signature creation and verification process and extended signature logging

- Introduced a new abstract method setMandatoryFieldsForFailedRes() in ServerState which makes sure that for each response the mandatory fields are set properly according to the standard in case a FAILED response code is sent

- Introduced a fix in WaitForAuthorizationReq which makes sure that a possible challenge is only checked for if the chosen payment option is „Contract“ (and TLS is used)

- Saves now the payment option selected by the EVCC (in state WaitForPaymentServiceSelectionReq) in the SECCs communication session for later reference

- To avoid possible race conditions, the transport layer threads needed to be started AFTER the SECC session handler has been initialized. Otherwise the situation might occur that the UDPServer is receiving a UDP client packet and tries to access the MessageHandler object before this object has been created by the SECC session handler.

- generateCertificates.sh Shell-Script now includes variables to ease the setting of certificates’ validity periods. Renaming of some certificates (e.g. provLeaf.cert -> cpsLeaf.cert) and keys. All certificates are now also generated in DER encoded form. MOSubCA2 private key is now also created as a PKCS#8 DER encoded file as RISE V2G needs this format to read the private key from file and sign SalesTariffs.

- EVCCConfig.properties and SECCConfig.properties have additional property „SignatureVerificationLog“ which enables extended logging information to debug signature creation and verification processes

- Catched a (theoretically) possible ClassCastException in WaitForChargeParameterDiscoveryRes in case the EVCC signalizes an EnergyTransferMode (AC or DC) which does not fit to the EVSEChargeParameter sent by the SECC later on

- Made sure that by default the sum of the individual time intervals described in the PMaxSchedule and SalesTariff provided in the ChargeParameterDiscoveryRes message are equal to 24 hours as demanded by a requirement.

- Renaming of some methods in IBackendInterface for clarity and consistency

- Provided a correctly formatted EVSE-ID in DummyACEVSEController and DummyDCEVSEController

- Corrected the service name of CertificateUpdate service and CertificateInstallation service to „Service“ according to the standard

- Edited GlobalValues so that the string value returned for each global value only needs to be edited once in this file (less error prone)
2017-07-20 15:50:43 +02:00
Marc Mültin fd20302604 - added signature creation when sending MeteringReceiptReq during DC charging
- added a fix that prevents a NullPointerException in case MeterInfo element is not present when checked on SECC while processing MeteringReceiptReq
2016-11-29 18:46:42 +08:00
Marc Mültin 7cd7bde429 - made sure that no ServiceDetailReq is sent for the ChargeService (for which no ServiceParameterList is available)
- added error logger message in case FAILED_No_NEGOTIATION is sent as response code in supportedAppProtocolRes
2016-11-26 17:41:41 +08:00
Marc Mültin 0fc64963f7 minor debugging and error catching changes 2016-11-06 19:19:48 +09:00
Marc Mültin 258af9b5ac Bugfix: An empty catch clause in the StatefulTransportLayerClient.java caused a weired EXI Codec error message ("ERROR: 'EXI No valid EXI document according distinguishing bits'") when a message timeout occurred (e.g. with the small timeout value of 250ms for CurrentDemandRes). This was confusing since there was no obvious reason for the EXI Codec error message. Now there is some meaningful error catch clause which makes clear that the header of the received message could not be read, which then terminates the communication session. 2016-07-28 19:13:00 +02:00