From d6871931565836b683fcda757e7f266384e63804 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 18 Jul 2024 10:49:52 +0200 Subject: [PATCH] Improve consistency of public API member function names in Gnss_Crypto --- src/core/libs/osnma_msg_receiver.cc | 28 +- src/core/system_parameters/gnss_crypto.cc | 260 +++++++++--------- src/core/system_parameters/gnss_crypto.h | 20 +- .../osnma/gnss_crypto_test.cc | 20 +- .../osnma/osnma_msg_receiver_test.cc | 2 +- 5 files changed, 165 insertions(+), 165 deletions(-) diff --git a/src/core/libs/osnma_msg_receiver.cc b/src/core/libs/osnma_msg_receiver.cc index 43e62a738..293058b26 100644 --- a/src/core/libs/osnma_msg_receiver.cc +++ b/src/core/libs/osnma_msg_receiver.cc @@ -457,11 +457,11 @@ void osnma_msg_receiver::process_dsm_message(const std::vector& dsm_msg std::vector hash; if (d_osnma_data.d_dsm_kroot_message.hf == 0) // Table 8. { - hash = d_crypto->computeSHA256(MSG); + hash = d_crypto->compute_SHA_256(MSG); } else if (d_osnma_data.d_dsm_kroot_message.hf == 2) { - hash = d_crypto->computeSHA3_256(MSG); + hash = d_crypto->compute_SHA3_256(MSG); } else { @@ -483,7 +483,7 @@ void osnma_msg_receiver::process_dsm_message(const std::vector& dsm_msg << ", WN=" << static_cast(d_osnma_data.d_dsm_kroot_message.wn_k) << ", TOW=" << static_cast(d_osnma_data.d_dsm_kroot_message.towh_k) * 3600; local_time_verification(osnma_msg); - d_kroot_verified = d_crypto->verify_signature(message, d_osnma_data.d_dsm_kroot_message.ds); + d_kroot_verified = d_crypto->verify_signature_ecdsa_p256(message, d_osnma_data.d_dsm_kroot_message.ds); if (d_kroot_verified) { std::cout << "Galileo OSNMA: KROOT authentication successful!" << std::endl; @@ -1040,7 +1040,7 @@ bool osnma_msg_receiver::verify_dsm_pkr(DSM_PKR_message message) computed_merkle_root = compute_merke_root(message, base_leaf); - if (computed_merkle_root == d_crypto->getMerkleRoot()) + if (computed_merkle_root == d_crypto->get_merkle_root()) { LOG(INFO) << "Galileo OSNMA: DSM-PKR verification :: SUCCESS!." << std::endl; return true; @@ -1053,7 +1053,7 @@ bool osnma_msg_receiver::verify_dsm_pkr(DSM_PKR_message message) } std::vector osnma_msg_receiver::compute_merke_root(const DSM_PKR_message& dsm_pkr_message, const std::vector& m_i) const { - std::vector x_next, x_current = d_crypto->computeSHA256(m_i); + std::vector x_next, x_current = d_crypto->compute_SHA_256(m_i); for (size_t i = 0; i < 4; i++) { x_next.clear(); @@ -1073,7 +1073,7 @@ std::vector osnma_msg_receiver::compute_merke_root(const DSM_PKR_messag } // Compute the next node. - x_current = d_crypto->computeSHA256(x_next); + x_current = d_crypto->compute_SHA_256(x_next); } return x_current; } @@ -1116,11 +1116,11 @@ bool osnma_msg_receiver::verify_tag(Tag& tag) if (d_osnma_data.d_dsm_kroot_message.mf == 0) // C: HMAC-SHA-256 { - mac = d_crypto->computeHMAC_SHA_256(applicable_key, m); + mac = d_crypto->compute_HMAC_SHA_256(applicable_key, m); } else if (d_osnma_data.d_dsm_kroot_message.mf == 1) // C: CMAC-AES { - mac = d_crypto->computeCMAC_AES(applicable_key, m); + mac = d_crypto->compute_CMAC_AES(applicable_key, m); } // truncate the computed mac: trunc(l_t, mac(K,m)) Eq. 23 ICD @@ -1484,11 +1484,11 @@ bool osnma_msg_receiver::verify_macseq(const MACK_message& mack) std::vector mac; if (d_osnma_data.d_dsm_kroot_message.mf == 0) // C: HMAC-SHA-256 { - mac = d_crypto->computeHMAC_SHA_256(applicable_key, m); + mac = d_crypto->compute_HMAC_SHA_256(applicable_key, m); } else if (d_osnma_data.d_dsm_kroot_message.mf == 1) // C: CMAC-AES { - mac = d_crypto->computeCMAC_AES(applicable_key, m); + mac = d_crypto->compute_CMAC_AES(applicable_key, m); } // Truncate the twelve MSBits and compare with received MACSEQ uint16_t mac_msb = 0; @@ -1598,11 +1598,11 @@ std::vector osnma_msg_receiver::hash_chain(uint32_t num_of_hashes_neede std::vector hash; if (d_osnma_data.d_dsm_kroot_message.hf == 0) // Table 8. { - hash = d_crypto->computeSHA256(msg); + hash = d_crypto->compute_SHA_256(msg); } else if (d_osnma_data.d_dsm_kroot_message.hf == 2) { - hash = d_crypto->computeSHA3_256(msg); + hash = d_crypto->compute_SHA3_256(msg); } else { @@ -1729,11 +1729,11 @@ std::vector osnma_msg_receiver::verify_macseq_new(const MACK_ std::vector mac; if (d_osnma_data.d_dsm_kroot_message.mf == 0) // C: HMAC-SHA-256 { - mac = d_crypto->computeHMAC_SHA_256(applicable_key, m); + mac = d_crypto->compute_HMAC_SHA_256(applicable_key, m); } else if (d_osnma_data.d_dsm_kroot_message.mf == 1) // C: CMAC-AES { - mac = d_crypto->computeCMAC_AES(applicable_key, m); + mac = d_crypto->compute_CMAC_AES(applicable_key, m); } // Truncate the twelve MSBits and compare with received MACSEQ uint16_t mac_msb = 0; diff --git a/src/core/system_parameters/gnss_crypto.cc b/src/core/system_parameters/gnss_crypto.cc index 0e98280cf..289b7e17f 100644 --- a/src/core/system_parameters/gnss_crypto.cc +++ b/src/core/system_parameters/gnss_crypto.cc @@ -133,9 +133,73 @@ bool Gnss_Crypto::have_public_key() const } -bool Gnss_Crypto::verify_signature(const std::vector& message, const std::vector& signature) const +bool Gnss_Crypto::store_public_key(const std::string& pubKeyFilePath) const { - std::vector digest = this->computeSHA256(message); + if (!have_public_key()) + { + return false; + } + std::ofstream pubKeyFile(pubKeyFilePath, std::ios::binary); + if (!pubKeyFile.is_open()) + { + LOG(INFO) << "Unable to open file: " << pubKeyFilePath; + return false; + } +#if USE_GNUTLS_FALLBACK + gnutls_datum_t pem_data; +#if HAVE_GNUTLS_PUBKEY_EXPORT2 + int ret = gnutls_pubkey_export2(d_PublicKey, GNUTLS_X509_FMT_PEM, &pem_data); +#else + size_t output_stata_size; + int ret = gnutls_pubkey_export(d_PublicKey, GNUTLS_X509_FMT_PEM, &pem_data, &output_stata_size); +#endif + if (ret != GNUTLS_E_SUCCESS) + { + LOG(INFO) << "GnuTLS: Failed to export public key: " << gnutls_strerror(ret); + return false; + } + + pubKeyFile.write((const char*)pem_data.data, pem_data.size); + pubKeyFile.close(); + gnutls_free(pem_data.data); +#else // OpenSSL + BIO* bio = BIO_new(BIO_s_mem()); + if (!bio) + { + LOG(INFO) << "OpenSSL: Failed to create BIO"; + return false; + } +#if USE_OPENSSL_3 + if (!PEM_write_bio_PUBKEY(bio, d_PublicKey)) +#else // OpenSSL 1.x + if (!PEM_write_bio_EC_PUBKEY(bio, d_PublicKey)) +#endif + { + LOG(INFO) << "OpenSSL: Failed to write public key to BIO"; + BIO_free(bio); + return false; + } + + char* bio_data; + auto bio_len = BIO_get_mem_data(bio, &bio_data); + if (bio_len <= 0) + { + LOG(INFO) << "OpenSSL: Failed to get BIO data"; + BIO_free(bio); + return false; + } + + pubKeyFile.write(bio_data, bio_len); + pubKeyFile.close(); + BIO_free(bio); +#endif + return true; +} + + +bool Gnss_Crypto::verify_signature_ecdsa_p256(const std::vector& message, const std::vector& signature) const +{ + std::vector digest = this->compute_SHA_256(message); if (!have_public_key()) { std::cerr << "Galileo OSNMA KROOT verification error: Public key is not available" << std::endl; @@ -396,130 +460,7 @@ bool Gnss_Crypto::verify_signature_ecdsa_p521(const std::vector& messag } -bool Gnss_Crypto::store_public_key(const std::string& pubKeyFilePath) const -{ - if (!have_public_key()) - { - return false; - } - std::ofstream pubKeyFile(pubKeyFilePath, std::ios::binary); - if (!pubKeyFile.is_open()) - { - LOG(INFO) << "Unable to open file: " << pubKeyFilePath; - return false; - } -#if USE_GNUTLS_FALLBACK - gnutls_datum_t pem_data; -#if HAVE_GNUTLS_PUBKEY_EXPORT2 - int ret = gnutls_pubkey_export2(d_PublicKey, GNUTLS_X509_FMT_PEM, &pem_data); -#else - size_t output_stata_size; - int ret = gnutls_pubkey_export(d_PublicKey, GNUTLS_X509_FMT_PEM, &pem_data, &output_stata_size); -#endif - if (ret != GNUTLS_E_SUCCESS) - { - LOG(INFO) << "GnuTLS: Failed to export public key: " << gnutls_strerror(ret); - return false; - } - - pubKeyFile.write((const char*)pem_data.data, pem_data.size); - pubKeyFile.close(); - gnutls_free(pem_data.data); -#else // OpenSSL - BIO* bio = BIO_new(BIO_s_mem()); - if (!bio) - { - LOG(INFO) << "OpenSSL: Failed to create BIO"; - return false; - } -#if USE_OPENSSL_3 - if (!PEM_write_bio_PUBKEY(bio, d_PublicKey)) -#else // OpenSSL 1.x - if (!PEM_write_bio_EC_PUBKEY(bio, d_PublicKey)) -#endif - { - LOG(INFO) << "OpenSSL: Failed to write public key to BIO"; - BIO_free(bio); - return false; - } - - char* bio_data; - auto bio_len = BIO_get_mem_data(bio, &bio_data); - if (bio_len <= 0) - { - LOG(INFO) << "OpenSSL: Failed to get BIO data"; - BIO_free(bio); - return false; - } - - pubKeyFile.write(bio_data, bio_len); - pubKeyFile.close(); - BIO_free(bio); -#endif - return true; -} - - -std::vector Gnss_Crypto::getPublicKey() const -{ - if (!have_public_key()) - { - return {}; - } -#if USE_GNUTLS_FALLBACK - gnutls_datum_t pem_data = {nullptr, 0}; - - int ret = gnutls_pubkey_export2(d_PublicKey, GNUTLS_X509_FMT_PEM, &pem_data); - if (ret != GNUTLS_E_SUCCESS) - { - LOG(INFO) << "GnuTLS: Failed to export public key to PEM format."; - return {}; - } - std::vector output(pem_data.data, pem_data.data + pem_data.size); - - // Free the allocated memory by gnutls_pubkey_export2 - gnutls_free(pem_data.data); -#else // OpenSSL - // Create a BIO for the memory buffer - BIO* mem = BIO_new(BIO_s_mem()); - if (!mem) - { - LOG(INFO) << "OpenSSL: Failed to create BIO."; - return {}; - } -#if USE_OPENSSL_3 - if (!PEM_write_bio_PUBKEY(mem, d_PublicKey)) -#else // OpenSSL 1.x - if (!PEM_write_bio_EC_PUBKEY(mem, d_PublicKey)) -#endif - { - BIO_free(mem); - LOG(INFO) << "OpenSSL: Failed to write public key to PEM format."; - return {}; - } - - // Get the length of the data in the BIO - BUF_MEM* mem_ptr; - BIO_get_mem_ptr(mem, &mem_ptr); - - // Copy the data from the BIO to a std::vector - std::vector output(mem_ptr->length); - memcpy(output.data(), mem_ptr->data, mem_ptr->length); - - // Clean up the BIO - BIO_free(mem); -#endif - return output; -} - - -std::vector Gnss_Crypto::getMerkleRoot() const -{ - return d_x_4_0; -} - - -std::vector Gnss_Crypto::computeSHA256(const std::vector& input) const +std::vector Gnss_Crypto::compute_SHA_256(const std::vector& input) const { std::vector output(32); // SHA256 hash size #if USE_GNUTLS_FALLBACK @@ -564,7 +505,7 @@ std::vector Gnss_Crypto::computeSHA256(const std::vector& inpu } -std::vector Gnss_Crypto::computeSHA3_256(const std::vector& input) const +std::vector Gnss_Crypto::compute_SHA3_256(const std::vector& input) const { std::vector output(32); // SHA256 hash size #if USE_GNUTLS_FALLBACK @@ -598,7 +539,7 @@ std::vector Gnss_Crypto::computeSHA3_256(const std::vector& in } -std::vector Gnss_Crypto::computeHMAC_SHA_256(const std::vector& key, const std::vector& input) const +std::vector Gnss_Crypto::compute_HMAC_SHA_256(const std::vector& key, const std::vector& input) const { std::vector output(32); #if USE_GNUTLS_FALLBACK @@ -686,7 +627,7 @@ std::vector Gnss_Crypto::computeHMAC_SHA_256(const std::vector } -std::vector Gnss_Crypto::computeCMAC_AES(const std::vector& key, const std::vector& input) const +std::vector Gnss_Crypto::compute_CMAC_AES(const std::vector& key, const std::vector& input) const { std::vector output(16); #if USE_GNUTLS_FALLBACK @@ -829,6 +770,65 @@ std::vector Gnss_Crypto::computeCMAC_AES(const std::vector& ke } +std::vector Gnss_Crypto::get_public_key() const +{ + if (!have_public_key()) + { + return {}; + } +#if USE_GNUTLS_FALLBACK + gnutls_datum_t pem_data = {nullptr, 0}; + + int ret = gnutls_pubkey_export2(d_PublicKey, GNUTLS_X509_FMT_PEM, &pem_data); + if (ret != GNUTLS_E_SUCCESS) + { + LOG(INFO) << "GnuTLS: Failed to export public key to PEM format."; + return {}; + } + std::vector output(pem_data.data, pem_data.data + pem_data.size); + + // Free the allocated memory by gnutls_pubkey_export2 + gnutls_free(pem_data.data); +#else // OpenSSL + // Create a BIO for the memory buffer + BIO* mem = BIO_new(BIO_s_mem()); + if (!mem) + { + LOG(INFO) << "OpenSSL: Failed to create BIO."; + return {}; + } +#if USE_OPENSSL_3 + if (!PEM_write_bio_PUBKEY(mem, d_PublicKey)) +#else // OpenSSL 1.x + if (!PEM_write_bio_EC_PUBKEY(mem, d_PublicKey)) +#endif + { + BIO_free(mem); + LOG(INFO) << "OpenSSL: Failed to write public key to PEM format."; + return {}; + } + + // Get the length of the data in the BIO + BUF_MEM* mem_ptr; + BIO_get_mem_ptr(mem, &mem_ptr); + + // Copy the data from the BIO to a std::vector + std::vector output(mem_ptr->length); + memcpy(output.data(), mem_ptr->data, mem_ptr->length); + + // Clean up the BIO + BIO_free(mem); +#endif + return output; +} + + +std::vector Gnss_Crypto::get_merkle_root() const +{ + return d_x_4_0; +} + + void Gnss_Crypto::set_public_key(const std::vector& publicKey) { #if USE_GNUTLS_FALLBACK @@ -884,7 +884,7 @@ void Gnss_Crypto::set_public_key(const std::vector& publicKey) } -void Gnss_Crypto::setMerkleRoot(const std::vector& v) +void Gnss_Crypto::set_merkle_root(const std::vector& v) { d_x_4_0 = v; } diff --git a/src/core/system_parameters/gnss_crypto.h b/src/core/system_parameters/gnss_crypto.h index 117d5e0a7..8e89f1525 100644 --- a/src/core/system_parameters/gnss_crypto.h +++ b/src/core/system_parameters/gnss_crypto.h @@ -53,24 +53,24 @@ public: bool have_public_key() const; //!< Returns true if the ECDSA Public Key is already loaded - bool verify_signature(const std::vector& message, const std::vector& signature) const; //!< Verify ECDSA-P256 signature (message in hex, signature in raw format) - bool verify_signature_ecdsa_p521(const std::vector& message, const std::vector& signature) const; //!< Verify ECDSA-P521 signature (message in hex, signature in raw format) - /*! * Stores the ECDSA Public Key in a .pem file, which is read in a following run if the .crt file is not found */ bool store_public_key(const std::string& pubKeyFilePath) const; - std::vector getPublicKey() const; //!< Gets the ECDSA Public Key in PEM format - std::vector getMerkleRoot() const; //!< Gets the Merkle Tree root node (\f$ x_{4,0} \f$) + bool verify_signature_ecdsa_p256(const std::vector& message, const std::vector& signature) const; //!< Verify ECDSA-P256 signature (message in plain hex, signature in raw format) + bool verify_signature_ecdsa_p521(const std::vector& message, const std::vector& signature) const; //!< Verify ECDSA-P521 signature (message in plain hex, signature in raw format) - std::vector computeSHA256(const std::vector& input) const; //!< Computes SHA-256 hash - std::vector computeSHA3_256(const std::vector& input) const; //!< Computes SHA3-256 hash - std::vector computeHMAC_SHA_256(const std::vector& key, const std::vector& input) const; //!< Computes HMAC-SHA-256 message authentication code - std::vector computeCMAC_AES(const std::vector& key, const std::vector& input) const; //!< Computes CMAC-AES message authentication code + std::vector compute_SHA_256(const std::vector& input) const; //!< Computes SHA-256 hash + std::vector compute_SHA3_256(const std::vector& input) const; //!< Computes SHA3-256 hash + std::vector compute_HMAC_SHA_256(const std::vector& key, const std::vector& input) const; //!< Computes HMAC-SHA-256 message authentication code + std::vector compute_CMAC_AES(const std::vector& key, const std::vector& input) const; //!< Computes CMAC-AES message authentication code + + std::vector get_public_key() const; //!< Gets the ECDSA Public Key in PEM format + std::vector get_merkle_root() const; //!< Gets the Merkle Tree root node (\f$ x_{4,0} \f$) void set_public_key(const std::vector& publickey); //!< Sets the ECDSA Public Key (publickey in PEM format) - void setMerkleRoot(const std::vector& v); //!< Sets the Merkle Tree root node x(\f$ x_{4,0} \f$) + void set_merkle_root(const std::vector& v); //!< Sets the Merkle Tree root node x(\f$ x_{4,0} \f$) private: void read_merkle_xml(const std::string& merkleFilePath); diff --git a/src/tests/unit-tests/signal-processing-blocks/osnma/gnss_crypto_test.cc b/src/tests/unit-tests/signal-processing-blocks/osnma/gnss_crypto_test.cc index bbe01d905..2d7355fd7 100644 --- a/src/tests/unit-tests/signal-processing-blocks/osnma/gnss_crypto_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/osnma/gnss_crypto_test.cc @@ -96,7 +96,7 @@ TEST(GnssCryptoTest, VerifyPublicKeyStorage) ASSERT_EQ(content_file, content_file2); - std::vector readkey = d_crypto2->getPublicKey(); + std::vector readkey = d_crypto2->get_public_key(); ASSERT_EQ(publicKey, readkey); errorlib::error_code ec; @@ -116,7 +116,7 @@ TEST(GnssCryptoTest, TestComputeSHA_256) 0x43, 0xAC, 0x4E, 0x43, 0xFC, 0x00, 0x4C, 0x89, 0x16, 0x04, 0xB2, 0x6F, 0x8C, 0x69, 0xE1, 0xE8, 0x3E, 0xA2, 0xAF, 0xC7, 0xC4, 0x8F}; - std::vector output = d_crypto->computeSHA256(message); + std::vector output = d_crypto->compute_SHA_256(message); ASSERT_EQ(expected_output, output); } @@ -133,7 +133,7 @@ TEST(GnssCryptoTest, TestComputeSHA3_256) 0xBB, 0x2C, 0x24, 0x36, 0x72, 0x5E, 0x2E, 0x8D, 0xC7, 0x5B, 0x99, 0xE7, 0xF6, 0xC4, 0x50, 0x5B, 0x2A, 0x93, 0x6E, 0xB6, 0x3B, 0x3F}; - std::vector output = d_crypto->computeSHA3_256(message); + std::vector output = d_crypto->compute_SHA3_256(message); ASSERT_EQ(expected_output, output); } @@ -159,7 +159,7 @@ TEST(GnssCryptoTest, TestComputeHMACSHA256) 0xB2, 0x7A, 0xCC, 0x22, 0x00, 0xAA, 0xD2, 0x37, 0xD0, 0x79, 0x06, 0x12, 0x83, 0x40, 0xB7, 0xA6}; - std::vector output = d_crypto->computeHMAC_SHA_256(key, message); + std::vector output = d_crypto->compute_HMAC_SHA_256(key, message); ASSERT_EQ(expected_output, output); } @@ -194,7 +194,7 @@ TEST(GnssCryptoTest, TestComputeHMACSHA256_m0) 0xD2, 0xEA, 0x61, 0xE1, 0xEF, 0x09, 0x11, 0x5C, 0xFE, 0x70, 0x68, 0x52, 0xBF, 0xF2, 0x3A, 0x83}; - std::vector output = d_crypto->computeHMAC_SHA_256(key, message); + std::vector output = d_crypto->compute_HMAC_SHA_256(key, message); ASSERT_EQ(expected_output, output); } @@ -222,7 +222,7 @@ TEST(GnssCryptoTest, TestComputeHMACSHA256_adkd4) 0x44, 0xAB, 0xEE, 0x4D, 0xCE, 0xB9, 0x3D, 0xCF, 0x65, 0xCB, 0x3A, 0x5B, 0x81, 0x4A, 0x34, 0xE9}; - std::vector output = d_crypto->computeHMAC_SHA_256(key, message); + std::vector output = d_crypto->compute_HMAC_SHA_256(key, message); ASSERT_EQ(expected_output, output); } @@ -245,13 +245,13 @@ TEST(GnssCryptoTest, TestComputeCMAC_AES) 0x07, 0x0A, 0x16, 0xB4, 0x6B, 0x4D, 0x41, 0x44, 0xF7, 0x9B, 0xDD, 0x9D, 0xD0, 0x4A, 0x28, 0x7C}; - std::vector output = d_crypto->computeCMAC_AES(key, message); + std::vector output = d_crypto->compute_CMAC_AES(key, message); ASSERT_EQ(expected_output, output); } -TEST(GnssCryptoTest, VerifySignature) +TEST(GnssCryptoTest, VerifySignatureP256) { auto d_crypto = std::make_unique(); @@ -293,12 +293,12 @@ TEST(GnssCryptoTest, VerifySignature) 0x45, 0x59, 0x2D, 0x2D, 0x2D, 0x2D, 0x2D, 0x0A}; d_crypto->set_public_key(publicKey); - bool result = d_crypto->verify_signature(message, signature); + bool result = d_crypto->verify_signature_ecdsa_p256(message, signature); ASSERT_TRUE(result); std::vector wrong_signature = signature; wrong_signature[1] = 1; - bool result2 = d_crypto->verify_signature(message, wrong_signature); + bool result2 = d_crypto->verify_signature_ecdsa_p256(message, wrong_signature); ASSERT_TRUE(!result2); } diff --git a/src/tests/unit-tests/signal-processing-blocks/osnma/osnma_msg_receiver_test.cc b/src/tests/unit-tests/signal-processing-blocks/osnma/osnma_msg_receiver_test.cc index 6b7f280a4..7daa43fb4 100644 --- a/src/tests/unit-tests/signal-processing-blocks/osnma/osnma_msg_receiver_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/osnma/osnma_msg_receiver_test.cc @@ -112,7 +112,7 @@ TEST_F(OsnmaMsgReceiverTest, ComputeBaseLeaf) TEST_F(OsnmaMsgReceiverTest, VerifyPublicKey){ // values taken from RG A.7 // Arrange // ---------- - osnma->d_crypto->setMerkleRoot(helper.convert_from_hex_string("A10C440F3AA62453526DB4AF76DF8D9410D35D8277397D7053C700D192702B0D")); + osnma->d_crypto->set_merkle_root(helper.convert_from_hex_string("A10C440F3AA62453526DB4AF76DF8D9410D35D8277397D7053C700D192702B0D")); DSM_PKR_message dsm_pkr_message; dsm_pkr_message.npkt = 0x01; dsm_pkr_message.npktid = 0x2;