added entropy collection system based on mouse movement to location/identity creation, to make keys less predictable

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6753 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2013-09-23 20:55:34 +00:00
parent 6b1613d8bb
commit cda8557b73
5 changed files with 316 additions and 140 deletions

View file

@ -41,6 +41,7 @@
#define RS_USE_PGPSSL 1
#include <stdint.h>
#include <list>
#include <map>
#include <vector>
@ -88,6 +89,7 @@ class RsInit
/*!
* Generating GPGme Account
*/
static bool collectEntropy(uint32_t bytes) ;
static int GetPGPLogins(std::list<std::string> &pgpIds);
static int GetPGPLoginDetails(const std::string& id, std::string &name, std::string &email);
static bool GeneratePGPCertificate(const std::string&, const std::string& email, const std::string& passwd, std::string &pgpId, std::string &errString);

View file

@ -51,6 +51,7 @@
#include <dirent.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <openssl/rand.h>
#include <fcntl.h>
#if (defined(__unix__) || defined(unix)) && !defined(USG)
@ -1217,6 +1218,12 @@ bool RsInit::SelectGPGAccount(const std::string& gpgId)
return retVal;
}
bool RsInit::collectEntropy(uint32_t n)
{
RAND_seed(&n,4) ;
return true ;
}
bool RsInit::GeneratePGPCertificate(const std::string& name, const std::string& email, const std::string& passwd, std::string &pgpId, std::string &errString)
{