From cd6d5a2b4ac7ef8d211acb45889d57c0b1dd745b Mon Sep 17 00:00:00 2001 From: victor-tucci Date: Tue, 12 Dec 2023 14:09:12 +0530 Subject: [PATCH] Verify presence of value for pubkey_ed25519 in handle_pin() --- src/rpc/core_rpc_server.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index fb8aaef23aa..d51182308a6 100755 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -3259,8 +3259,8 @@ namespace cryptonote { namespace rpc { if (cur_version < required) { res.status = fmt::format("Outdated {}. Current: {}.{}.{}, Required: {}.{}.{}",name, cur_version[0], cur_version[1], cur_version[2], required[0], required[1], required[2]); MERROR(res.status); - } else if (!pubkey_ed25519.empty() // TODO: once belnet & ss are always sending this we can remove this empty bypass - && pubkey_ed25519 != our_pubkey_ed25519) { + } else if (!pubkey_ed25519.empty() && !(pubkey_ed25519.find_first_not_of('0') == std::string_view::npos) // TODO: once belnet & ss are always sending this we can remove this empty bypass + && (pubkey_ed25519 != our_pubkey_ed25519)) { res.status = fmt::format("Invalid {} pubkey: expected {}, received {}", name, our_pubkey_ed25519, pubkey_ed25519); MERROR(res.status); } else {