Skip to content

Commit

Permalink
EvseV2G: always assign GenChallenge and EVSETimeStamp in PaymentDetai…
Browse files Browse the repository at this point in the history
…lsRes

When responding in PaymentDetailsRes with a FAILED ResponseCode,
EVSETimeStamp and GenChallenge need to be assigned, even if unused.
Especially GenChallenge needs to conform to the fixed size mandated by the
schema.

Previously, GenChallenge was sent with size 0 in this case, which could lead
to message validation errors on the receiving EV side.

Signed-off-by: Moritz Barsnick <[email protected]>
  • Loading branch information
barsnick committed Feb 7, 2024
1 parent 1c873e5 commit efcfbf7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/EvseV2G/iso_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1251,6 +1251,10 @@ static enum v2g_event handle_iso_payment_details(struct v2g_connection* conn) {
} else {
res->ResponseCode = iso1responseCodeType_FAILED_CertChainError;
}
// EVSETimeStamp and GenChallenge are mandatory, GenChallenge has fixed size
res->EVSETimeStamp = time(NULL);
memset(res->GenChallenge.bytes, 0, GEN_CHALLENGE_SIZE);
res->GenChallenge.bytesLen = GEN_CHALLENGE_SIZE;
goto error_out;
}

Expand Down

0 comments on commit efcfbf7

Please sign in to comment.