Core/Misc: added support for OpenSSL 3, dropped support for OpenSSL 1.0 and fixed build for Fixed build for MariaDB
This commit is contained in:
1 parent
2c94bf0a16
commit
a7527a8698
19 files changed
+268
-214
No files matched your search
@@ -21,6 +21,7 @@
|
||||
#include "Define.h"
|
||||
#include <string>
|
||||
#include <openssl/sha.h>
|
||||
#include <openssl/evp.h>
|
||||
|
||||
class BigNumber;
|
||||
|
||||
@@ -28,8 +29,14 @@ class TC_COMMON_API SHA1Hash
|
||||
{
|
||||
public:
|
||||
SHA1Hash();
|
||||
SHA1Hash(SHA1Hash const &other); // copy
|
||||
SHA1Hash(SHA1Hash &&other); // move
|
||||
SHA1Hash &operator=(SHA1Hash other); // assign
|
||||
~SHA1Hash();
|
||||
|
||||
void Swap(SHA1Hash &other) throw();
|
||||
friend void Swap(SHA1Hash &left, SHA1Hash &right) { left.Swap(right); }
|
||||
|
||||
void UpdateBigNumbers(BigNumber* bn0, ...);
|
||||
|
||||
void UpdateData(const uint8 *dta, int len);
|
||||
@@ -38,12 +45,12 @@ class TC_COMMON_API SHA1Hash
|
||||
void Initialize();
|
||||
void Finalize();
|
||||
|
||||
uint8 *GetDigest(void) { return mDigest; }
|
||||
int GetLength(void) const { return SHA_DIGEST_LENGTH; }
|
||||
uint8 *GetDigest(void) { return m_digest; }
|
||||
int GetLength() const { return SHA_DIGEST_LENGTH; }
|
||||
|
||||
private:
|
||||
SHA_CTX mC;
|
||||
uint8 mDigest[SHA_DIGEST_LENGTH];
|
||||
EVP_MD_CTX *m_ctx;
|
||||
uint8 m_digest[SHA_DIGEST_LENGTH];
|
||||
};
|
||||
|
||||
/// Returns the SHA1 hash of the given content as hex string.
|
||||
|
||||
Reference in new issue
Block a user