Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V0.6 short invites #1571

Merged
merged 48 commits into from Sep 25, 2019
Merged
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
720d5ea
Implement libretroshare short invites support
G10h4ck May 12, 2019
bde6235
Fix windows compilation
G10h4ck May 13, 2019
dac7643
Merge pull request #1565 from G10h4ck/short_invites_v2
csoler May 21, 2019
56e591f
added a flag in peerState specific to short invites, and several chec…
csoler May 22, 2019
4eb6b0b
fixed uninitialized memory read for variable mRsEventsHandle
csoler May 26, 2019
8fddb55
fixed stupid bug that crashed the code in a different place
csoler May 27, 2019
3a799ba
added optional display of short invites in places with certificates
csoler Jun 6, 2019
4bd5aaa
added parsing of short invites in connect friend wizard (not working …
csoler Jun 9, 2019
fb52f67
fixed up addign friend from short invite
csoler Jun 9, 2019
76cf64f
fixed compilation
csoler Jun 9, 2019
a7141cb
removed unused startWizard and loadCert code in HomePage
csoler Jun 9, 2019
6294aef
removed unused intro page from ConnectFriendWizard
csoler Jun 9, 2019
0c510a5
removed unused RsId and Fof pages from ConnectFriendWizard
csoler Jun 9, 2019
c0436b7
removed unused Email page from ConnectFriendWizard
csoler Jun 9, 2019
a55e824
removed unused FriendRequest page from ConnectFriendWizard
csoler Jun 9, 2019
a04079d
removed unused Cert page from ConnectFriendWizard
csoler Jun 9, 2019
1f56ef3
removed unused Cert page from ConnectFriendWizard
csoler Jun 9, 2019
38434f2
removed unused Cert page from ConnectFriendWizard
csoler Jun 9, 2019
57a5485
fixed adding friend with short invite
csoler Jun 10, 2019
805f753
fixed parsing of short invite
csoler Jun 20, 2019
6114d97
removed CIRCLES-related dead code from friendlist
csoler Jun 20, 2019
e132ce7
attempt to add SSL-only friends in FriendList - does not work yet
csoler Jun 20, 2019
9312d0c
converted short invites to compact PGP format for increased robustness
csoler Jun 21, 2019
a52451b
moved SSL part of friend list into a separate function
csoler Jun 22, 2019
daec6b3
arranged to show PGP id for friends from short invite. Name not avail…
csoler Jun 22, 2019
6419b03
merged upstream/master
csoler Sep 8, 2019
dd90314
fixed missing type conversion
csoler Sep 8, 2019
c8064e1
fixed missing parameter in jsonapi declaration
csoler Sep 8, 2019
3a58aa4
add special profile item for not yet validated peer from short invite
csoler Sep 10, 2019
bbf92bd
fixed remanent bug due causing the deletion of rsEvent
csoler Sep 10, 2019
b0c7f8f
fixed display of non validated nodes without fingerprint
csoler Sep 10, 2019
a20ec1a
fixed exchange of PGP keys in binary format and update of PGP signatu…
csoler Sep 14, 2019
bea6769
removed unused code from p3gossipdiscovery
csoler Sep 14, 2019
b4fe1d4
started documenting p3GossipDiscovery
csoler Sep 16, 2019
32b4312
improved security checks in authssl by verifying that the supplied PG…
csoler Sep 17, 2019
44d6cb7
finished documentation/review of discovery
csoler Sep 17, 2019
654d760
fixed comments from review of PR
csoler Sep 19, 2019
4fabf3d
renamed skip_signature_validation into more appropriate skip_pgp_sign…
csoler Sep 19, 2019
ed864f9
removed some debug info about PGP signature validation, and added the…
csoler Sep 21, 2019
6919711
restricted check for matching PGP ids to short invites only, since ot…
csoler Sep 21, 2019
9c7edff
fixed bug caused by shadowing a variable
csoler Sep 22, 2019
19ced52
fixed bug caused by wrong reading of disc flag
csoler Sep 22, 2019
9b78447
used RsInfo instead of std::cerr in authssl.cc
csoler Sep 22, 2019
cdeee01
removed dependency of FriendDialog on RsAutoUpdatePage which is not n…
csoler Sep 22, 2019
282d2d3
added missing notifications when adding friends
csoler Sep 22, 2019
a04d56e
fixed wrong default value for showUnconnected nodes
csoler Sep 23, 2019
d055887
removed some dead code
csoler Sep 23, 2019
24781a7
removed unused mOthersList from PeerMgr
csoler Sep 23, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions libretroshare/src/rsserver/p3peers.cc
Expand Up @@ -1268,6 +1268,8 @@ bool p3Peers::parseShortInvite(const std::string& inviteStrUrl, RsPeerDetails& d

case RsShortInviteFieldType::PGP_FINGERPRINT:
RS_SERIAL_PROCESS(details.fpr);

details.gpg_id = PGPHandler::pgpIdFromFingerprint(details.fpr);
break;

case RsShortInviteFieldType::LOCATOR:
Expand Down Expand Up @@ -1342,6 +1344,7 @@ bool p3Peers::parseShortInvite(const std::string& inviteStrUrl, RsPeerDetails& d
default:
RsWarn() << __PRETTY_FUNCTION__ << " got unkown field type: "
<< static_cast<uint32_t>(fieldType) << std::endl;
return false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case we get an unknown field we should just print a warning and ignore it, just in case we decide to add some new field in newer versions, so we can stay compatible with the past versions. Did you remember we had to do the same change on old certs? Maybe we need to add filed length too for achieving that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree on the principle. In this case I had an invite that did not parse and therefore the parser is actually going through the entire data byte by byte. This is the consequence of not storing the size of each field (which we actually do in RS certificate format) in which case it's more easy to distinguish random data (that has inconsistent size) from correct field with unknown tag (that has consistent size). So it seems to me that because we cannot decide, it's safer to return false otherwise, when parsing random data you'd easily end up with a random supposedly valid SSL id and PGP fingerprint.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another way to see the problem is that if you have 1 unknown field in the middle of the invite, the parser will not be able to skip it. It will instead try to interpret each and every byte in this field as a potential tag. That's likely to make the parsing completely wrong and even prevent the correct reading of the remaining fields. It seems to me that it would be safer to add sizes (which is 1 byte most of the time in the 1-2-5 encoding).

break;
}
}
Expand Down