From 7ebd8045f1c1be0a56b9a3b839479085c7e1bca1 Mon Sep 17 00:00:00 2001 From: Karel Hevessy Date: Fri, 15 Nov 2024 16:05:11 +0100 Subject: [PATCH] Hard-coded fix for TimestampIts field constraint check for Craton (until there is a better solution_ --- vanetza/asn1/its/TimestampIts.c | 4 ++-- vanetza/asn1/its/r2/TimestampIts.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vanetza/asn1/its/TimestampIts.c b/vanetza/asn1/its/TimestampIts.c index ffe9038a9..9f03ca0cc 100644 --- a/vanetza/asn1/its/TimestampIts.c +++ b/vanetza/asn1/its/TimestampIts.c @@ -11,7 +11,7 @@ int TimestampIts_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const INTEGER_t *st = (const INTEGER_t *)sptr; - long value; + uint64_t value; if(!sptr) { ASN__CTFAIL(app_key, td, sptr, @@ -20,7 +20,7 @@ TimestampIts_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, return -1; } - if(asn_INTEGER2long(st, &value)) { + if(asn_INTEGER2uint64(st, &value)) { ASN__CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); diff --git a/vanetza/asn1/its/r2/TimestampIts.c b/vanetza/asn1/its/r2/TimestampIts.c index 03bc77a32..b4ac91f26 100644 --- a/vanetza/asn1/its/r2/TimestampIts.c +++ b/vanetza/asn1/its/r2/TimestampIts.c @@ -11,7 +11,7 @@ int Vanetza_ITS2_TimestampIts_constraint(const asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { const INTEGER_t *st = (const INTEGER_t *)sptr; - long value; + uint64_t value; if(!sptr) { ASN__CTFAIL(app_key, td, sptr, @@ -20,7 +20,7 @@ Vanetza_ITS2_TimestampIts_constraint(const asn_TYPE_descriptor_t *td, const void return -1; } - if(asn_INTEGER2long(st, &value)) { + if(asn_INTEGER2uint64(st, &value)) { ASN__CTFAIL(app_key, td, sptr, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__);