mirror of
https://github.com/monero-project/monero.git
synced 2025-10-15 14:10:44 -04:00
Merge pull request #5493
5e0da6fb
change SSL certificate fingerprint whitelisting from SHA1 to SHA-256 (moneromooo-monero)
This commit is contained in:
commit
77f9bfa4d5
5 changed files with 27 additions and 1 deletions
|
@ -31,6 +31,7 @@
|
|||
#include <boost/asio/ip/address.hpp>
|
||||
#include <boost/filesystem/operations.hpp>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/preprocessor/stringize.hpp>
|
||||
#include <cstdint>
|
||||
#include "include_base_utils.h"
|
||||
using namespace epee;
|
||||
|
@ -254,6 +255,14 @@ namespace tools
|
|||
{
|
||||
std::vector<std::vector<uint8_t>> allowed_fingerprints{ rpc_ssl_allowed_fingerprints.size() };
|
||||
std::transform(rpc_ssl_allowed_fingerprints.begin(), rpc_ssl_allowed_fingerprints.end(), allowed_fingerprints.begin(), epee::from_hex::vector);
|
||||
for (const auto &fpr: rpc_ssl_allowed_fingerprints)
|
||||
{
|
||||
if (fpr.size() != SSL_FINGERPRINT_SIZE)
|
||||
{
|
||||
MERROR("SHA-256 fingerprint should be " BOOST_PP_STRINGIZE(SSL_FINGERPRINT_SIZE) " bytes long.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
rpc_ssl_options = epee::net_utils::ssl_options_t{
|
||||
std::move(allowed_fingerprints), std::move(rpc_ssl_ca_file)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue