1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00
qTox/src/core
Maxim Biro f5f42233ca
fix: Usage of random
- Seed random in Core Thread. Core Thread didn't seed random, resulting
  in always using the same bootstrap nodes, even when you restart qTox
  or change profiles.

- Use QDateTime::currentMSecsSinceEpoch() for seeding random. It
  provides a bigger range of numbers than QTime::currentTime().msec()
  does, and the latter somehow managed to result in approximately the
  same first random number being generated, within a certain range.

- Use something a it more sensible than a mod operation to bound random
  numbers within a range. It's not perfect either, but a lot better.
  Using mod on random skews its distribution too much.

- Use QRandomGenerator's bounded() function to generate random values
  within a range.

- Enable QRandomGenerator's usage starting with Qt 5.10.0.
  QRandomGenerator is present since Qt 5.10.0, not 5.15.0.

- Bootstrap off every 5th node instead of two consecutive nodes. It's
  likely that two consecutive nodes will have the same owner, which
  makes some attacks more likely. The node selection algorithm should be
  scraped and redone from scratch to be honest though.
2020-06-04 15:58:17 -04:00
..
contactid.cpp docs(copyright): update and add copyright info 2019-06-28 01:18:26 +02:00
contactid.h refactor(style): use #pragma once rather than include guards 2020-05-03 15:51:52 -07:00
core.cpp fix: Usage of random 2020-06-04 15:58:17 -04:00
core.h refactor(cmake): change folder structure 2020-05-11 16:45:52 +02:00
coreav.cpp refactor: remove Core dependency from Group 2020-05-27 10:39:02 +02:00
coreav.h refactor: remove Core dependency from Group 2020-05-27 10:39:02 +02:00
corefile.cpp Merge branch 'v1.17-dev' 2020-04-24 18:35:00 -07:00
corefile.h refactor(style): use #pragma once rather than include guards 2020-05-03 15:51:52 -07:00
dhtserver.cpp feat(core): use user editable bootstrap node list 2020-05-10 21:40:04 -07:00
dhtserver.h feat(core): use user editable bootstrap node list 2020-05-10 21:40:04 -07:00
groupid.cpp docs(copyright): update and add copyright info 2019-06-28 01:18:26 +02:00
groupid.h refactor(style): use #pragma once rather than include guards 2020-05-03 15:51:52 -07:00
icorefriendmessagesender.h refactor(style): use #pragma once rather than include guards 2020-05-03 15:51:52 -07:00
icoregroupmessagesender.h refactor(style): use #pragma once rather than include guards 2020-05-03 15:51:52 -07:00
icoregroupquery.h refactor(style): use #pragma once rather than include guards 2020-05-03 15:51:52 -07:00
icoreidhandler.h refactor(style): use #pragma once rather than include guards 2020-05-03 15:51:52 -07:00
icoresettings.h refactor(cmake): change folder structure 2020-05-11 16:45:52 +02:00
receiptnum.h refactor(cmake): change folder structure 2020-05-11 16:45:52 +02:00
toxcall.cpp refactor(cmake): change folder structure 2020-05-11 16:45:52 +02:00
toxcall.h refactor(cmake): change folder structure 2020-05-11 16:45:52 +02:00
toxencrypt.cpp chore(cleanup): replace remaining deprecated toxcore enums 2020-04-13 09:25:20 -07:00
toxencrypt.h refactor(style): use #pragma once rather than include guards 2020-05-03 15:51:52 -07:00
toxfile.cpp docs(copyright): update and add copyright info 2019-06-28 01:18:26 +02:00
toxfile.h refactor(style): use #pragma once rather than include guards 2020-05-03 15:51:52 -07:00
toxfilepause.h refactor(style): use #pragma once rather than include guards 2020-05-03 15:51:52 -07:00
toxid.cpp refactor(history): enforce using PK instead of ToxId in history 2020-05-03 16:22:12 -07:00
toxid.h refactor(style): use #pragma once rather than include guards 2020-05-03 15:51:52 -07:00
toxlogger.cpp refactor(Qt): use 'QLatin1String' instead of 'QLatin1Literal' 2019-10-09 23:19:26 -07:00
toxlogger.h refactor(style): use #pragma once rather than include guards 2020-05-03 15:51:52 -07:00
toxoptions.cpp fix(i18n): Various English fixes 2019-09-14 15:00:59 -04:00
toxoptions.h refactor(style): use #pragma once rather than include guards 2020-05-03 15:51:52 -07:00
toxpk.cpp docs(copyright): update and add copyright info 2019-06-28 01:18:26 +02:00
toxpk.h refactor(style): use #pragma once rather than include guards 2020-05-03 15:51:52 -07:00
toxstring.cpp docs(copyright): update and add copyright info 2019-06-28 01:18:26 +02:00
toxstring.h refactor(style): use #pragma once rather than include guards 2020-05-03 15:51:52 -07:00