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

state_history_plugin: incorrect serialization of WA keys #9087

Closed

Description

@cc32d9

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.

Activity

  1. cc32d9 commented on May 13, 2020

    @cc32d9
    ContributorAuthor

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

  2. spoonincode commented on May 15, 2020

    @spoonincode
    Contributor

    Fix merged for 2.0.6 release thanks for report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions