From f51cabcdf5ef093a4142e8f6187d34804578dc9d Mon Sep 17 00:00:00 2001 From: v0-e Date: Tue, 30 Jan 2024 15:06:57 +0000 Subject: [PATCH] asn1: OER-based copy for asn1c wrapper --- vanetza/asn1/asn1c_wrapper.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vanetza/asn1/asn1c_wrapper.cpp b/vanetza/asn1/asn1c_wrapper.cpp index 1720ac3a2..269be65f5 100644 --- a/vanetza/asn1/asn1c_wrapper.cpp +++ b/vanetza/asn1/asn1c_wrapper.cpp @@ -52,16 +52,16 @@ void* copy(asn_TYPE_descriptor_t& td, const void* original) ByteBuffer buffer; asn_enc_rval_t ec; - ec = der_encode(&td, const_cast(original), write_buffer, &buffer); + ec = oer_encode(&td, const_cast(original), write_buffer, &buffer); if (ec.encoded == -1) { - throw std::runtime_error("DER encoding failed"); + throw std::runtime_error("OER encoding failed"); } asn_dec_rval_t dc; - dc = ber_decode(0, &td, ©, buffer.data(), buffer.size()); + dc = oer_decode(0, &td, ©, buffer.data(), buffer.size()); if (dc.code != RC_OK) { free(td, copy); - throw std::runtime_error("BER decoding failed"); + throw std::runtime_error("OER decoding failed"); } return copy;