mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-28 08:54:13 -04:00
Avoid JSON operations on RsGxsIdGroup::mPgpIdSign
The field is actually a raw memory chunk even if declared as an std::string as result the produced JSON is broken and JSON API clients cannot parse the output of methods like rsIdentity/getIdentitiesInfo A proper fix would be refactoring the whole code to use a proper raw memory buffer for that field but given there is no usage for a raw PGP signature on a client app as RetroShare library already verify it internally workaround the issue by just ignoring that field in JSON serial operations.
This commit is contained in:
parent
20c0032ca8
commit
7bf4da0691
3 changed files with 50 additions and 28 deletions
|
@ -3,7 +3,9 @@
|
|||
* *
|
||||
* libretroshare: retroshare core library *
|
||||
* *
|
||||
* Copyright 2012-2012 by Robert Fernie <retroshare@lunamutt.com> *
|
||||
* Copyright (C) 2012 Robert Fernie <retroshare@lunamutt.com> *
|
||||
* Copyright (C) 2021 Gioacchino Mazzurco <gio@eigenlab.org> *
|
||||
* Copyright (C) 2021 Asociación Civil Altermundi <info@altermundi.net> *
|
||||
* *
|
||||
* This program is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU Lesser General Public License as *
|
||||
|
@ -19,8 +21,7 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
|
||||
* *
|
||||
*******************************************************************************/
|
||||
#ifndef RS_GXS_IDENTITY_ITEMS_H
|
||||
#define RS_GXS_IDENTITY_ITEMS_H
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
|
||||
|
@ -57,15 +58,20 @@ public:
|
|||
bool toGxsIdGroup(RsGxsIdGroup &group, bool moveImage);
|
||||
|
||||
Sha1CheckSum mPgpIdHash;
|
||||
// Need a signature as proof - otherwise anyone could add others Hashes.
|
||||
// This is a string, as the length is variable.
|
||||
std::string mPgpIdSign;
|
||||
|
||||
// Recognition Strings. MAX# defined above.
|
||||
std::list<std::string> mRecognTags;
|
||||
/** Need a signature as proof - otherwise anyone could add others Hashes.
|
||||
* This is a string, as the length is variable.
|
||||
* TODO: this should actually be a byte array (pointer+size), using an
|
||||
* std::string breaks the JSON serialization.
|
||||
* Be careful refactoring this as it may break retrocompatibility as this
|
||||
* item is sent over the network */
|
||||
std::string mPgpIdSign;
|
||||
|
||||
// Avatar
|
||||
RsTlvImage mImage ;
|
||||
/// Unused
|
||||
RS_DEPRECATED std::list<std::string> mRecognTags;
|
||||
|
||||
/// Avatar
|
||||
RsTlvImage mImage;
|
||||
};
|
||||
|
||||
struct RsGxsIdLocalInfoItem : public RsGxsIdItem
|
||||
|
@ -89,5 +95,3 @@ public:
|
|||
|
||||
virtual RsItem *create_item(uint16_t service_id,uint8_t item_subtype) const ;
|
||||
};
|
||||
|
||||
#endif /* RS_GXS_IDENTITY_ITEMS_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue