mirror of
https://github.com/mangosfour/server.git
synced 2025-12-27 19:37:04 +00:00
[8450] Prevented using of plaintext passwords in sql queries
This commit is contained in:
parent
c8b717ab7d
commit
9c5f85d309
7 changed files with 62 additions and 28 deletions
|
|
@ -42,8 +42,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];
|
||||
|
|
|
|||
|
|
@ -441,3 +441,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();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -289,4 +289,5 @@ 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
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "8449"
|
||||
#define REVISION_NR "8450"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue