From 7781ffe8054011765644d3a8f9a07a0a07362488 Mon Sep 17 00:00:00 2001 From: emanuel Date: Wed, 22 Jun 2022 23:19:52 +0100 Subject: [PATCH] TPM reset state if in entry zone --- src/tpm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/tpm.c b/src/tpm.c index bd439a5..da4d720 100644 --- a/src/tpm.c +++ b/src/tpm.c @@ -112,10 +112,12 @@ int tpm_pay(void* fc, tolling_info_t* info, void* security_socket, uint8_t* neig switch (info->asn->tollType) { case TollType_entry: if (tolling->station.obu.toll_type != -1) { - syslog_err("[facilities] [tolling] trying to issue entry.request but current tolling state is %s", + syslog_err("[facilities] [tolling] trying to issue entry.request but current tolling state is %s - resetting", tts(tolling->station.obu.toll_type)); - rv = 1; - goto cleanup; + tolling->station.obu.toll_type = -1; + tolling->station.obu.active = false; + ASN_STRUCT_FREE(asn_DEF_TPM, tolling->station.obu.entry_proof); + tolling->station.obu.entry_proof = NULL; } type->present = TollingType_PR_entry; type->choice.entry.present = TollingEntry_PR_request;