X-Git-Url: https://git.pterodactylus.net/?p=fms.git;a=blobdiff_plain;f=src%2Ffreenet%2Fintroductionpuzzleinserter.cpp;h=66635bb5ad7f8ed6f12c98fff5be87afdf1e689e;hp=fef42f13ea59eb3758983724972eea8e36bcbd3c;hb=52c0819bfc1d083c6e0738f75f0d7eeba521295a;hpb=f60495a029c54358f82956482fe203fe2b7b5b23 diff --git a/src/freenet/introductionpuzzleinserter.cpp b/src/freenet/introductionpuzzleinserter.cpp index fef42f1..66635bb 100644 --- a/src/freenet/introductionpuzzleinserter.cpp +++ b/src/freenet/introductionpuzzleinserter.cpp @@ -201,7 +201,9 @@ void IntroductionPuzzleInserter::StartInsert(const long localidentityid) FCPMessage message; std::string xmldata; std::string xmldatasizestr; - std::string privatekey; + std::string privatekey=""; + std::string publickey=""; + std::string keypart=""; StringFunctions::Convert(localidentityid,idstring); now.SetToGMTime(); @@ -217,10 +219,19 @@ void IntroductionPuzzleInserter::StartInsert(const long localidentityid) } StringFunctions::Convert(index,indexstr); - SQLite3DB::Recordset rs2=m_db->Query("SELECT PrivateKey FROM tblLocalIdentity WHERE LocalIdentityID="+idstring+";"); + SQLite3DB::Recordset rs2=m_db->Query("SELECT PrivateKey,PublicKey FROM tblLocalIdentity WHERE LocalIdentityID="+idstring+";"); if(rs2.Empty()==false && rs2.GetField(0)!=NULL) { privatekey=rs2.GetField(0); + if(rs2.GetField(1)) + { + publickey=rs2.GetField(1); + } + if(publickey.size()>=50) + { + // remove - and ~ + keypart=StringFunctions::Replace(StringFunctions::Replace(publickey.substr(4,43),"-",""),"~",""); + } } Option::Instance()->Get("MessageBase",messagebase); @@ -228,7 +239,7 @@ void IntroductionPuzzleInserter::StartInsert(const long localidentityid) GenerateCaptcha(encodedpuzzle,solutionstring); xml.SetType("captcha"); - xml.SetUUID(uuid.Generate()); + xml.SetUUID(uuid.Generate()+"@"+keypart); xml.SetPuzzleData(encodedpuzzle); xml.SetMimeType("image/bmp");