From 81d23fa607e797327b68d2a0d805cdf969b032b2 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Thu, 22 Nov 2018 21:56:55 +0100 Subject: [PATCH] JSON API to collect extra entropy --- libretroshare/src/retroshare/rsinit.h | 8 ++++++++ libretroshare/src/rsserver/rsinit.cc | 3 +++ 2 files changed, 11 insertions(+) diff --git a/libretroshare/src/retroshare/rsinit.h b/libretroshare/src/retroshare/rsinit.h index 031423819..2e8009b3c 100644 --- a/libretroshare/src/retroshare/rsinit.h +++ b/libretroshare/src/retroshare/rsinit.h @@ -288,6 +288,14 @@ struct RsLoginHelper RsInit::LoadCertificateStatus attemptLogin( const RsPeerId& account, const std::string& password ); + /** + * @brief Feed extra entropy to the crypto libraries + * @jsonapi{development,unauthenticated} + * @param[in] bytes number to feed to the entropy pool + * @return false if error occurred, true otherwise + */ + static bool collectEntropy(uint32_t bytes); + struct Location : RsSerializable { RsPeerId mLocationId; diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index e3f1f141e..86e26c55b 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -1934,6 +1934,9 @@ RsInit::LoadCertificateStatus RsLoginHelper::attemptLogin( return RsInit::ERR_UNKOWN; } +/*static*/ bool RsLoginHelper::collectEntropy(uint32_t bytes) +{ return RsInit::collectEntropy(bytes); } + void RsLoginHelper::getLocations(std::vector& store) { std::list locIds;