Skip to content

Commit

Permalink
GH-2060 Update signature provider parsing for base64 encoded BLS publ…
Browse files Browse the repository at this point in the history
…ic keys
  • Loading branch information
heifner committed Jan 10, 2024
1 parent 3c64d96 commit 08b62d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ class signature_provider_plugin_impl {
std::tuple<std::string, std::string, std::string> parse_spec(const std::string& spec) const {
auto delim = spec.find("=");
EOS_ASSERT(delim != std::string::npos, chain::plugin_config_exception, "Missing \"=\" in the key spec pair");
// public_key can be base64 encoded with trailing `=`
while( spec.size() > delim+1 && spec[delim+1] == '=' )
++delim;
auto pub_key_str = spec.substr(0, delim);
auto spec_str = spec.substr(delim + 1);

Expand Down
2 changes: 1 addition & 1 deletion tests/TestHarness/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ def construct_command_line(self, instance: nodeDefinition):
a(a(eosdcmd, '--plugin'), 'eosio::producer_plugin')
producer_keys = list(sum([('--signature-provider', f'{key.pubkey}=KEY:{key.privkey}') for key in instance.keys], ()))
eosdcmd.extend(producer_keys)
finalizer_keys = list(sum([('--signature-provider', f'{key.blspubkey}=KEY:{key.blsprivkey}') for key in instance.keys], ()))
finalizer_keys = list(sum([('--signature-provider', f'{key.blspubkey}=KEY:{key.blsprivkey}') for key in instance.keys if key.blspubkey is not None], ()))
eosdcmd.extend(finalizer_keys)
producer_names = list(sum([('--producer-name', p) for p in instance.producers], ()))
eosdcmd.extend(producer_names)
Expand Down

0 comments on commit 08b62d7

Please sign in to comment.