Change to RSA decrypt function
This commit is contained in:
parent
3bac3dcbb4
commit
4f0e00fdfa
|
@ -86,10 +86,11 @@ std::string InputMessage::getString()
|
||||||
return std::string(v, stringLength);
|
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);
|
checkRead(size);
|
||||||
RSA::decrypt((char*)m_buffer + m_readPos, size, p.c_str(), q.c_str(), d.c_str());
|
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)
|
void InputMessage::fillBuffer(uint8 *buffer, uint16 size)
|
||||||
|
|
|
@ -52,7 +52,7 @@ public:
|
||||||
uint32 peekU32() { uint32 v = getU32(); m_readPos-=4; return v; }
|
uint32 peekU32() { uint32 v = getU32(); m_readPos-=4; return v; }
|
||||||
uint64 peekU64() { uint64 v = getU64(); m_readPos-=8; 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 getReadSize() { return m_readPos - m_headerPos; }
|
||||||
int getReadPos() { return m_readPos; }
|
int getReadPos() { return m_readPos; }
|
||||||
|
|
Loading…
Reference in New Issue