#include "../../include/freenet/introductionpuzzlexml.h"\r
#include "../../include/option.h"\r
#include "../../include/stringfunctions.h"\r
+#include "../../include/bitmapvalidator.h"\r
+#include "../../include/base64.h"\r
\r
#ifdef XMEM\r
#include <xmem.h>\r
validmessage=false;\r
}\r
\r
+ // we can only validate bitmaps for now\r
+ BitmapValidator val;\r
+ std::vector<unsigned char> puzzledata;\r
+ Base64::Decode(xml.GetPuzzleData(),puzzledata);\r
+ if(xml.GetMimeType()!="image/bmp" || val.Validate(puzzledata)==false)\r
+ {\r
+ m_log->WriteLog(LogFile::LOGLEVEL_ERROR,"IntroductionPuzzleRequester::HandleAllData received bad mime type and/or data for "+message["Identifier"]);\r
+ validmessage=false;\r
+ }\r
+\r
st=m_db->Prepare("INSERT INTO tblIntroductionPuzzleRequests(IdentityID,Day,RequestIndex,Found,UUID,Type,MimeType,PuzzleData) VALUES(?,?,?,?,?,?,?,?);");\r
st.Bind(0,identityid);\r
st.Bind(1,idparts[4]);\r