Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

state_history_plugin: incorrect serialization of WA keys #9087

Closed
cc32d9 opened this issue May 13, 2020 · 2 comments
Closed

state_history_plugin: incorrect serialization of WA keys #9087

cc32d9 opened this issue May 13, 2020 · 2 comments

Comments

@cc32d9
Copy link
Contributor

cc32d9 commented May 13, 2020

as of release 2.0.5:

ship is using eosio::chain::shared_public_key for serializing key weight:

template <typename ST>
datastream<ST>& operator<<(datastream<ST>& ds, const history_serial_wrapper<eosio::chain::shared_key_weight>& obj) {
   fc::raw::pack(ds, as_type<eosio::chain::shared_public_key>(obj.obj.key));
   fc::raw::pack(ds, as_type<uint16_t>(obj.obj.weight));
   return ds;
}

But shared_public_key is defining its data as

using shared_public_key_data = fc::static_variant<fc::ecc::public_key_shim, fc::crypto::r1::public_key_shim, shared_string>;

so, in case of WA key, the FC serializer is packing it as a string. Then abieos is unable to deserialize it because it expects a variant.

The WA signatures seem to be safe, so it's only the authority objects affected.

@cc32d9
Copy link
Contributor Author

cc32d9 commented May 13, 2020

not a variant, abieos is expecting a public key, but it gets the string length in its first byte. nevertheless, it's wrongly serialized.

@spoonincode
Copy link
Contributor

Fix merged for 2.0.6 release thanks for report

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants