1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-13 11:40:33 +00:00

Merge branch 'osnma-cesare' of https://github.com/cesaaargm/osnma into osnma-cesare

This commit is contained in:
Carles Fernandez 2024-08-09 08:45:49 +02:00
commit 8d8b118cae
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
2 changed files with 8 additions and 4 deletions

View File

@ -292,7 +292,7 @@ void osnma_msg_receiver::process_osnma_message(const std::shared_ptr<OSNMA_msg>&
// step 2 , start using new chain
d_flag_PK_revocation = false;
uint32_t final_GST = d_helper->compute_gst(osnma_msg->WN_sf0, osnma_msg->TOW_sf0);
double duration_hours = (final_GST - d_GST_PKR_PKREV_start) / 3600;
double duration_hours = (final_GST - d_GST_PKR_PKREV_start) / 3600.0;
LOG(INFO) << "Galileo OSNMA: Public Key Revocation :: Finished at GST=[" << osnma_msg->WN_sf0 << " " << osnma_msg->TOW_sf0 << "]"
<< ", Duration=" << duration_hours << "h";
std::cout << "Galileo OSNMA: Public Key Revocation :: Finished at GST=[" << osnma_msg->WN_sf0 << " " << osnma_msg->TOW_sf0 << "]"
@ -797,9 +797,9 @@ void osnma_msg_receiver::read_mack_header()
{
lt_bits = it->second;
}
if (lt_bits == 0)
if (lt_bits < 16)
{
return; // C: TODO if Tag length is 0, what is the action? no verification possible of NavData for sure.
return; // The 16 is to avoid negative shifts if shorter tags were defined
}
uint16_t macseq = 0;
uint8_t cop = 0;
@ -1330,7 +1330,7 @@ bool osnma_msg_receiver::verify_tag(Tag& tag) const
{
lt_bits = it2->second;
}
if (lt_bits == 0)
if (lt_bits < 16)
{
return false;
}

View File

@ -1370,7 +1370,11 @@ bool Gnss_Crypto::readPublicKeyFromCRT(const std::string& crtFilePath)
gnutls_pubkey_deinit(pubkey);
#else // OpenSSL
// Read certificate
#if !(USE_OPENSSL_3 || USE_OPENSSL_111)
BIO* bio = BIO_new_mem_buf(const_cast<unsigned char*>(buffer.data()), buffer.size());
#else
BIO* bio = BIO_new_mem_buf(buffer.data(), buffer.size());
#endif
if (!bio)
{
LOG(WARNING) << "OpenSSL: Unable to create BIO for file: " << crtFilePath;