diff options
author | QAston <qaston@gmail.com> | 2013-08-18 16:06:29 +0200 |
---|---|---|
committer | QAston <qaston@gmail.com> | 2013-08-18 17:44:03 +0200 |
commit | 2a3370929d4eeb22fbe9b03806fedcb28886d310 (patch) | |
tree | 2430b88bc9b108c5f9fb0826637bed98f8df047c /src/server/shared/Cryptography/BigNumber.h | |
parent | 8160633e12a5596a3a608cdc87ee9d51a78720c8 (diff) |
Fix BigNumber::AsByteArray function by returning Auto_Ptr.
Remove mutex from BigNumber class - it didn't do what it was advertised to do - consider using the "locked" array outside of the function in which it was "locked".
Diffstat (limited to 'src/server/shared/Cryptography/BigNumber.h')
-rw-r--r-- | src/server/shared/Cryptography/BigNumber.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/server/shared/Cryptography/BigNumber.h b/src/server/shared/Cryptography/BigNumber.h index fe56fd7e6f9..6129a24d1bc 100644 --- a/src/server/shared/Cryptography/BigNumber.h +++ b/src/server/shared/Cryptography/BigNumber.h @@ -20,7 +20,7 @@ #define _AUTH_BIGNUMBER_H #include "Define.h" -#include <ace/Mutex.h> +#include <ace/Auto_Ptr.h> struct bignum_st; @@ -86,17 +86,14 @@ class BigNumber struct bignum_st *BN() { return _bn; } uint32 AsDword(); - uint8* AsByteArray(int32 minSize = 0, bool reverse = true); + + ACE_Auto_Array_Ptr<uint8> AsByteArray(int32 minSize = 0, bool littleEndian = true); char * AsHexStr() const; char * AsDecStr() const; private: struct bignum_st *_bn; - uint8 *_array; - - // This mutex only controls thread-safe access to AsByteArray() and should be replaced with a thread-safe implementation of BigNumber - ACE_Mutex _lock; }; #endif |