From e18e8f358b1fef5518988dceba4c846dedaf0bcc Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 20 Jun 2026 03:37:26 +0200 Subject: [PATCH 1/2] Improve const correctness --- src/core/libs/osnma_msg_receiver.cc | 2 +- src/core/libs/osnma_msg_receiver.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/libs/osnma_msg_receiver.cc b/src/core/libs/osnma_msg_receiver.cc index c3a7ee65a..9d703bf57 100644 --- a/src/core/libs/osnma_msg_receiver.cc +++ b/src/core/libs/osnma_msg_receiver.cc @@ -3225,7 +3225,7 @@ std::vector osnma_msg_receiver::build_message(Tag& tag) const } -bool osnma_msg_receiver::verify_tesla_key(std::vector& key, uint32_t key_gst) +bool osnma_msg_receiver::verify_tesla_key(const std::vector& key, uint32_t key_gst) { uint32_t num_of_hashes_needed{}; uint32_t GST_SFi = gst_with_offset(d_helper->get_WN(d_GST_Sf), d_helper->get_TOW(d_GST_Sf), -30); // GST of target key is to be used. diff --git a/src/core/libs/osnma_msg_receiver.h b/src/core/libs/osnma_msg_receiver.h index 359a1b2b5..f21479167 100644 --- a/src/core/libs/osnma_msg_receiver.h +++ b/src/core/libs/osnma_msg_receiver.h @@ -104,7 +104,7 @@ private: bool read_mack_body(); bool process_mack_block(const std::shared_ptr& osnma_msg, const std::vector& allowed_adkds, uint8_t nmas); bool set_gst_sf_for_mack(uint32_t WN, uint32_t TOW); - bool verify_tesla_key(std::vector& key, uint32_t key_gst); + bool verify_tesla_key(const std::vector& key, uint32_t key_gst); bool verify_tag(Tag& tag) const; bool tag_has_nav_data_available(const Tag& t) const; bool tag_has_key_available(const Tag& t) const; From e9077a6e1146798d55aae04fc722ba6298714ebe Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 20 Jun 2026 13:03:31 +0200 Subject: [PATCH 2/2] Fix compatibility with OpenSSL versions --- src/core/libs/osnma_msg_receiver.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/libs/osnma_msg_receiver.cc b/src/core/libs/osnma_msg_receiver.cc index 9d703bf57..5bb8d0efd 100644 --- a/src/core/libs/osnma_msg_receiver.cc +++ b/src/core/libs/osnma_msg_receiver.cc @@ -680,7 +680,7 @@ bool osnma_msg_receiver::pkid_from_certificate_subject_cn(const std::string& crt } #endif // OpenSSL - const X509_NAME* subject = X509_get_subject_name(cert); + auto* subject = X509_get_subject_name(cert); if (subject == nullptr) { LOG(WARNING) << "OpenSSL: certificate has no Subject: " @@ -698,13 +698,13 @@ bool osnma_msg_receiver::pkid_from_certificate_subject_cn(const std::string& crt NID_commonName, index)) >= 0) { - const X509_NAME_ENTRY* entry = X509_NAME_get_entry(subject, index); + auto* entry = X509_NAME_get_entry(subject, index); if (entry == nullptr) { continue; } - const ASN1_STRING* asn1 = X509_NAME_ENTRY_get_data(entry); + auto* asn1 = X509_NAME_ENTRY_get_data(entry); if (asn1 == nullptr) { continue;