Skip to content

Commit

Permalink
Add ed25519 and x25519 keys to get_sn_pubkey rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
jagerman committed Nov 8, 2019
1 parent 5bde5a7 commit 4591e28
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/rpc/core_rpc_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2718,6 +2718,8 @@ namespace cryptonote
if (auto keys = m_core.get_service_node_keys())
{
res.service_node_pubkey = string_tools::pod_to_hex(keys->pub);
res.service_node_pubkey_ed25519 = string_tools::pod_to_hex(keys->pub_ed25519);
res.service_node_pubkey_x25519 = string_tools::pod_to_hex(keys->pub_x25519);
res.status = CORE_RPC_STATUS_OK;
return true;
}
Expand Down
10 changes: 7 additions & 3 deletions src/rpc/core_rpc_server_commands_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -2630,7 +2630,7 @@ namespace cryptonote
};

LOKI_RPC_DOC_INTROSPECT
// Get the service node public key of the queried daemon.
// Get the service node public keys of the queried daemon.
// The daemon must be started in --service-node mode otherwise this RPC command will fail.
struct COMMAND_RPC_GET_SERVICE_NODE_KEY
{
Expand All @@ -2643,11 +2643,15 @@ namespace cryptonote

struct response_t
{
std::string service_node_pubkey; // The queried daemon's service node key.
std::string status; // Generic RPC error code. "OK" is the success value.
std::string service_node_pubkey; // The queried daemon's service node key.
std::string service_node_pubkey_ed25519; // The queried daemon's ed25519 auxiliary public key
std::string service_node_pubkey_x25519; // The queried daemon's x25519 auxiliary public key
std::string status; // Generic RPC error code. "OK" is the success value.

BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(service_node_pubkey)
KV_SERIALIZE(service_node_pubkey_ed25519)
KV_SERIALIZE(service_node_pubkey_x25519)
KV_SERIALIZE(status)
END_KV_SERIALIZE_MAP()
};
Expand Down

0 comments on commit 4591e28

Please sign in to comment.