fix: make plaintext public key follow to the specs
Description
In js, all "public keys" are marshaled using protobuf PublicKey message.
However, according to specs and other implementations, the Data field should contains the raw key, instead of the protobuf marshaled key, and then put in to the exchange.
Otherwise, js-libp2p will not connect to golang or rust libp2p, raising the "Public key did not match id" error, if only plaintext selected for encryption.
Notes & open questions
Should we involve some cross-implementation tests to check if any further issue like that?
Change checklist
[x] I have performed a self-review of my own code
[ ] I have made corresponding changes to the documentation if necessary (this includes comments as well)
[ ] I have added tests that prove my fix is effective or that my feature works
Title
fix: make plaintext public key follow to the specs
Description
In js, all "public keys" are marshaled using protobuf PublicKey message.
However, according to specs and other implementations, the
Data
field should contains the raw key, instead of the protobuf marshaled key, and then put in to the exchange.Otherwise, js-libp2p will not connect to golang or rust libp2p, raising the "Public key did not match id" error, if only plaintext selected for encryption.
Notes & open questions
Should we involve some cross-implementation tests to check if any further issue like that?
Change checklist