From 4f0e00fdfa9a8146e57fab86b7980004b31e4cf0 Mon Sep 17 00:00:00 2001 From: Henrique Date: Wed, 1 Aug 2012 15:34:42 -0300 Subject: [PATCH] Change to RSA decrypt function --- src/framework/net/inputmessage.cpp | 3 ++- src/framework/net/inputmessage.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/framework/net/inputmessage.cpp b/src/framework/net/inputmessage.cpp index 80acfc72..f43b5c46 100644 --- a/src/framework/net/inputmessage.cpp +++ b/src/framework/net/inputmessage.cpp @@ -86,10 +86,11 @@ std::string InputMessage::getString() return std::string(v, stringLength); } -void InputMessage::decryptRsa(int size, const std::string& p, const std::string& q, const std::string& d) +bool InputMessage::decryptRsa(int size, const std::string& p, const std::string& q, const std::string& d) { checkRead(size); RSA::decrypt((char*)m_buffer + m_readPos, size, p.c_str(), q.c_str(), d.c_str()); + return (getU8() == 0x00); } void InputMessage::fillBuffer(uint8 *buffer, uint16 size) diff --git a/src/framework/net/inputmessage.h b/src/framework/net/inputmessage.h index 4ef7ea36..ca911144 100644 --- a/src/framework/net/inputmessage.h +++ b/src/framework/net/inputmessage.h @@ -52,7 +52,7 @@ public: uint32 peekU32() { uint32 v = getU32(); m_readPos-=4; return v; } uint64 peekU64() { uint64 v = getU64(); m_readPos-=8; return v; } - void decryptRsa(int size, const std::string& p, const std::string& q, const std::string& d); + bool decryptRsa(int size, const std::string& p, const std::string& q, const std::string& d); int getReadSize() { return m_readPos - m_headerPos; } int getReadPos() { return m_readPos; }