diff --git a/libretroshare/src/gossipdiscovery/gossipdiscoveryitems.cc b/libretroshare/src/gossipdiscovery/gossipdiscoveryitems.cc index bee4c9b59..97d552c0a 100644 --- a/libretroshare/src/gossipdiscovery/gossipdiscoveryitems.cc +++ b/libretroshare/src/gossipdiscovery/gossipdiscoveryitems.cc @@ -37,6 +37,7 @@ RsItem *RsDiscSerialiser::create_item( { case RsGossipDiscoveryItemType::PGP_LIST: return new RsDiscPgpListItem(); case RsGossipDiscoveryItemType::PGP_CERT_BINARY: return new RsDiscPgpKeyItem(); + case RsGossipDiscoveryItemType::PGP_CERT: return new RsDiscPgpCertItem(); // deprecated, hanlde to suppress "unkown item" warning case RsGossipDiscoveryItemType::CONTACT: return new RsDiscContactItem(); case RsGossipDiscoveryItemType::IDENTITY_LIST: return new RsDiscIdentityListItem(); default: diff --git a/libretroshare/src/gossipdiscovery/gossipdiscoveryitems.h b/libretroshare/src/gossipdiscovery/gossipdiscoveryitems.h index f5e219b95..0a1874539 100644 --- a/libretroshare/src/gossipdiscovery/gossipdiscoveryitems.h +++ b/libretroshare/src/gossipdiscovery/gossipdiscoveryitems.h @@ -97,6 +97,27 @@ public: uint32_t bin_len; }; +class RS_DEPRECATED_FOR(RsDiscPgpKeyItem) RsDiscPgpCertItem: public RsDiscItem +{ +public: + RsDiscPgpCertItem() : RsDiscItem(RsGossipDiscoveryItemType::PGP_CERT) + { setPriorityLevel(QOS_PRIORITY_RS_DISC_PGP_CERT); } + + void clear() override + { + pgpId.clear(); + pgpCert.clear(); + } + void serial_process(RsGenericSerializer::SerializeJob j, RsGenericSerializer::SerializeContext& ctx) override + { + RsTypeSerializer::serial_process(j,ctx,pgpId,"pgpId") ; + RsTypeSerializer::serial_process(j,ctx,TLV_TYPE_STR_PGPCERT,pgpCert,"pgpCert") ; + } + + RsPgpId pgpId; + std::string pgpCert; +}; + class RsDiscContactItem: public RsDiscItem { public: diff --git a/libretroshare/src/gossipdiscovery/p3gossipdiscovery.cc b/libretroshare/src/gossipdiscovery/p3gossipdiscovery.cc index 81dd097e0..77c0fd491 100644 --- a/libretroshare/src/gossipdiscovery/p3gossipdiscovery.cc +++ b/libretroshare/src/gossipdiscovery/p3gossipdiscovery.cc @@ -260,6 +260,7 @@ int p3discovery2::handleIncoming() { RsDiscPgpListItem* pgplist = nullptr; RsDiscPgpKeyItem* pgpkey = nullptr; + RsDiscPgpCertItem* pgpcert = nullptr; // deprecated, hanlde for retro compability RsDiscContactItem* contact = nullptr; RsDiscIdentityListItem* gxsidlst = nullptr; @@ -282,6 +283,9 @@ int p3discovery2::handleIncoming() } else if((pgpkey = dynamic_cast(item)) != nullptr) recvPGPCertificate(item->PeerId(), pgpkey); + else if((pgpcert = dynamic_cast(item)) != nullptr) + // sink + delete pgpcert; else if((pgplist = dynamic_cast(item)) != nullptr) { if (pgplist->mode == RsGossipDiscoveryPgpListMode::FRIENDS)