EVerest / libevse-security

Apache License 2.0
7 stars 5 forks source link

Invalid error message when an certificate is expired #60

Closed AssemblyJohn closed 4 months ago

AssemblyJohn commented 6 months ago

Describe the bug

When a leaf certificate is expired and it is requested from the module, instead of properly outputting the error with a 'Could not find certificate for given private key' or something long those lines, the error that is outputted is related to a missing private key, which is not the case.

To Reproduce

Attempt to request an expired leaf certificate.

Anything else?

No response

james-ctc commented 6 months ago

An example of the warning in the log

manager[10051]: 2024-03-14 17:29:31.011941 [WARN] evse_security:E evse_security::GetKeyPairResult evse_security::EvseSecurity::get_key_pair_internal(evse_security::LeafCertificateType, evse_security::EncodingFormat) :: Could not find private key for the selected certificate: (Could not find private key for given certificate: /etc/everest/certs/client/csms/CPO_CERT_CHAIN.pem key path: /etc/everest/certs/client/csms)
AssemblyJohn commented 4 months ago

Closed with error management PR: https://github.com/EVerest/libevse-security/pull/70