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

Change method of PK production for FAKE friend in DHT #1235

Merged
merged 1 commit into from
Oct 24, 2018

Conversation

NamsooCho
Copy link

@NamsooCho NamsooCho commented Oct 20, 2018

Fixes #1169
It would be better for FAKE friend to use real public key.


This change is Reviewable

@CLAassistant
Copy link

CLAassistant commented Oct 20, 2018

CLA assistant check
All committers have signed the CLA.

@zugz
Copy link

zugz commented Oct 20, 2018 via email

@NamsooCho
Copy link
Author

But, this PR can completely remove possibility of redundancy of fake friend's PK.

@zugz
Copy link

zugz commented Oct 20, 2018 via email

@iphydf
Copy link
Member

iphydf commented Oct 20, 2018

What is the redundancy this PR eliminates?

@NamsooCho
Copy link
Author

What is the redundancy this PR eliminates?

It is possible that my dht PK is same as random fake PK.
Random fake PK may be same as a node's dht PK in tox network.
Here a node is not my friend.

@iphydf
Copy link
Member

iphydf commented Oct 20, 2018

How does crypto_new_keypair avoid this?

@NamsooCho
Copy link
Author

As I remember, PK generated with crypto_new_keypair is UUID.

@sudden6
Copy link

sudden6 commented Oct 20, 2018

It is possible that my dht PK is same as random fake PK.

If you manage to generate a random 32 byte string that matches your own Public Key you must be very unlucky as this is so unlikely it's impossible for all practical applications.

@iphydf
Copy link
Member

iphydf commented Oct 20, 2018

@NamsooCho how does UUID avoid collisions?

By the way, I'm not against this PR in principle, but if we do it, we should do it for the right reason. Can you check whether your memory ("As I remember") is in fact correct, and point at the documentation or code location in libsodium that demonstrates it?

@NamsooCho
Copy link
Author

https://crypto.stackexchange.com/questions/54378/short-ed25519-keys-can-i-use-as-id

Well, I can't insist on using crypto_new_keypair.
I guess that using crypto_new_keypair would make a little bit thing to avoid collision.

@zugz
Copy link

zugz commented Oct 21, 2018 via email

@iphydf iphydf added this to the v0.2.x milestone Oct 21, 2018
@iphydf
Copy link
Member

iphydf commented Oct 21, 2018

Looks fine. Can you rebase on master?

@NamsooCho NamsooCho force-pushed the random_pk branch 3 times, most recently from ca1a4bb to f4cfd4b Compare October 22, 2018 01:39
@NamsooCho
Copy link
Author

I did rebase. But I can't confirm rebasing is actually done. Let me know if rebasing is done successfully.

@codecov
Copy link

codecov bot commented Oct 23, 2018

Codecov Report

Merging #1235 into master will decrease coverage by 0.3%.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #1235     +/-   ##
========================================
- Coverage    83.2%   82.9%   -0.4%     
========================================
  Files          82      82             
  Lines       14685   14685             
========================================
- Hits        12220   12175     -45     
- Misses       2465    2510     +45
Impacted Files Coverage Δ
toxcore/DHT.c 76.7% <100%> (-0.1%) ⬇️
toxav/msi.c 63.9% <0%> (-2.8%) ⬇️
toxav/toxav.c 67.3% <0%> (-2.3%) ⬇️
auto_tests/toxav_basic_test.c 81.6% <0%> (-2%) ⬇️
toxcore/net_crypto.c 93.5% <0%> (-1.5%) ⬇️
toxcore/onion_client.c 96% <0%> (-0.2%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 744dc2f...15cc805. Read the comment docs.

@zugz zugz force-pushed the random_pk branch 2 times, most recently from 10ef3b0 to e448882 Compare October 23, 2018 22:30
@NamsooCho
Copy link
Author

rebase done.

@zugz
Copy link

zugz commented Oct 24, 2018 via email

@NamsooCho
Copy link
Author

done

@zoff99 zoff99 removed the request for review from iphydf October 24, 2018 11:15
Copy link

@zoff99 zoff99 left a comment

Choose a reason for hiding this comment

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

:lgtm_strong:

Reviewed 1 of 1 files at r1.
Reviewable status: 0 of 1 approvals obtained

Copy link

@zoff99 zoff99 left a comment

Choose a reason for hiding this comment

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

:lgtm_strong:

Reviewable status: 0 of 1 approvals obtained

@zoff99 zoff99 requested a review from iphydf October 24, 2018 11:17
@zugz zugz merged commit 15cc805 into TokTok:master Oct 24, 2018
@NamsooCho NamsooCho deleted the random_pk branch October 25, 2018 08:03
@robinlinden robinlinden modified the milestones: v0.2.x, v0.2.9 Jan 3, 2019
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants