[8450] Prevented using of plaintext passwords in sql queries Author: arrai

--HG--
branch : trunk
This commit is contained in:
megamage
2009-09-02 18:14:10 -05:00
parent 9d161ff757
commit ea12ff233b
6 changed files with 60 additions and 27 deletions

View File

@@ -44,8 +44,6 @@ class Sha1Hash
uint8 *GetDigest(void) { return mDigest; };
int GetLength(void) { return SHA_DIGEST_LENGTH; };
BigNumber GetBigNumber();
private:
SHA_CTX mC;
uint8 mDigest[SHA_DIGEST_LENGTH];

View File

@@ -502,3 +502,23 @@ void vutf8printf(FILE *out, const char *str, va_list* ap)
vfprintf(out, str, *ap);
#endif
}
void hexEncodeByteArray(uint8* bytes, uint32 arrayLen, std::string& result)
{
std::ostringstream ss;
for(uint32 i=0; i<arrayLen; ++i)
{
for(uint8 j=0; j<2; ++j)
{
unsigned char nibble = 0x0F & (bytes[i]>>((1-j)*4));
char encodedNibble;
if(nibble < 0x0A)
encodedNibble = '0'+nibble;
else
encodedNibble = 'A'+nibble-0x0A;
ss << encodedNibble;
}
}
result = ss.str();
}

View File

@@ -291,6 +291,7 @@ void vutf8printf(FILE *out, const char *str, va_list* ap);
bool IsIPAddress(char const* ipaddress);
uint32 CreatePIDFile(const std::string& filename);
void hexEncodeByteArray(uint8* bytes, uint32 arrayLen, std::string& result);
#endif
//handler for operations on large flags