diff options
| author | Riccardo Spagni <ric@spagni.net> | 2019-05-02 11:30:28 +0200 |
|---|---|---|
| committer | Riccardo Spagni <ric@spagni.net> | 2019-05-02 11:30:28 +0200 |
| commit | 77f9bfa4d5de1b39c8f0c86508eab5ac0ae6488a (patch) | |
| tree | 2fb25ffb3cc161b87c2275e95a67ba2bda28d0e9 /src/wallet/wallet_rpc_server.cpp | |
| parent | 52eb454d7b9f5aba42eb693c5acd4bfbf4853643 (diff) | |
| parent | 5e0da6fb68446612844970be1e862f0e5bc25183 (diff) | |
| download | monzero-core-77f9bfa4d5de1b39c8f0c86508eab5ac0ae6488a.tar.gz monzero-core-77f9bfa4d5de1b39c8f0c86508eab5ac0ae6488a.tar.xz monzero-core-77f9bfa4d5de1b39c8f0c86508eab5ac0ae6488a.zip | |
Merge pull request #5493
5e0da6fb change SSL certificate fingerprint whitelisting from SHA1 to SHA-256 (moneromooo-monero)
Diffstat (limited to 'src/wallet/wallet_rpc_server.cpp')
| -rw-r--r-- | src/wallet/wallet_rpc_server.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index 8e67f8f51..22eaffa6f 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -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) |
