Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use utcnow() to check certificate validity #151

Merged
merged 1 commit into from
Oct 24, 2022

Conversation

rstanchak
Copy link
Contributor

Symptom:
Using the certificates generated using ./create_certs.sh, 'make run-secc' with TLS and PNC enabled, would fail in the CertificateInstallationReq handling:

ERROR    2022-10-21 14:37:20,294 - iso15118.shared.security (977): CertNotYetValidError: Signature verification failed while checking certificate chain

Issue:
The cryptography Certificate object represents the validity period of the certificate in UTC. https://cryptography.io/en/latest/x509/reference/#cryptography.x509.Certificate

However, security.py is comparing cert.not_valid_before to the local time, and as a result, the certificate is reported invalid for those of us in zones earlier than GMT.

Fix:
Use datetime.utcnow() instead of datetime.now() to get the current time

@tropxy
Copy link
Contributor

tropxy commented Oct 24, 2022

thanks @rstanchak for your contribution!

@tropxy tropxy merged commit 5185483 into EcoG-io:master Oct 24, 2022
shalinnijel2 added a commit that referenced this pull request Nov 2, 2022
commit 2c30797
Author: Ibrahim KARATAS <[email protected]>
Date:   Mon Oct 31 17:19:10 2022 +0000

    Fix/genchallange invalid (#154)

    * genchallance will only sent on first AuthorizationReq message

    * test_authorization_req_gen_challenge_invalid unit test modified

commit 0d34ee5
Author: Ibrahim KARATAS <[email protected]>
Date:   Mon Oct 31 16:36:56 2022 +0000

    genchallange check has been added for Authorization (#135)

    * The genchallange check has been added for Authorization

commit 6192609
Author: Chad <[email protected]>
Date:   Mon Oct 31 14:43:25 2022 +0000

    fix: cleanup template dockerfile (#109)

commit 5185483
Author: Roman Stanchak <[email protected]>
Date:   Mon Oct 24 05:35:44 2022 -0400

    fix: use utcnow() to check certificate validity (#151)

commit 72e8cc9
Author: Chad <[email protected]>
Date:   Mon Oct 17 17:29:49 2022 +0100

    feat: run code qual and tests in gha (#147)

    * feat: run code qual and tests in gha

    * fix: install deps in gha

    * fix: add isort make command

commit 8718dd5
Author: santiagosalamandri <[email protected]>
Date:   Mon Oct 17 15:02:36 2022 +0100

    Bump 0.13.0 (#149)

    * feat: Bump to 0.13.0

commit d596370
Author: Santiago Salamandri <[email protected]>
Date:   Mon Oct 17 13:59:40 2022 +0100

    feat: Pass status event as a parameter to start servers. Reduce check status delay to 10 mS

commit 8d260e2
Author: Santiago Salamandri <[email protected]>
Date:   Mon Oct 17 13:56:38 2022 +0100

    feat: Remove event atribute and pass it as a parameter

commit da2ee49
Author: Santiago Salamandri <[email protected]>
Date:   Mon Oct 17 13:55:04 2022 +0100

    chore: rename EVSEServiceStatus to ServiceStatus

commit 3898096
Author: Santiago Salamandri <[email protected]>
Date:   Mon Oct 17 12:11:47 2022 +0100

    feat: Add starting status

commit 657d451
Author: Santiago Salamandri <[email protected]>
Date:   Mon Oct 17 12:11:11 2022 +0100

    feat: Add a task to check the servers status

commit 222b741
Author: Santiago Salamandri <[email protected]>
Date:   Mon Oct 17 12:09:30 2022 +0100

    feat: Add ready status events to servers

commit f196eb6
Author: Santiago Salamandri <[email protected]>
Date:   Mon Oct 17 12:08:21 2022 +0100

    feat: Implemented set_status method

commit c076bb2
Author: Santiago Salamandri <[email protected]>
Date:   Mon Oct 17 12:07:38 2022 +0100

    feat: add evse status enum and set_status abstract method

commit b0e4f25
Author: Chad <[email protected]>
Date:   Wed Oct 12 13:54:56 2022 +0100

    fix: remove sphinx dependency (#141)

commit 15c3a5a
Author: André <[email protected]>
Date:   Wed Oct 12 11:39:27 2022 +0100

    get from the evse controller the ac evse status (#146)

    * get from the evse controller the ac evse status

    * removed unused iimport

    * added test for charging status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants