Linux: allow using GnuTLS instead of OpenSSL for computing SHA256 hashes

Prevents issues with often changing OpenSSL ABI.

Ref #429
This commit is contained in:
Floris Bos 2022-06-14 16:13:55 +02:00
parent 8d943ce2bd
commit cb415a6a02
5 changed files with 61 additions and 16 deletions

View file

@ -16,8 +16,12 @@
#define SHA256_Update CC_SHA256_Update
#define SHA256_Final CC_SHA256_Final
#else
#ifdef HAVE_GNUTLS
#include "gnutls/crypto.h"
#else
#include "openssl/sha.h"
#endif
#endif
class AcceleratedCryptographicHash
{
@ -29,7 +33,11 @@ public:
QByteArray result();
protected:
#ifdef HAVE_GNUTLS
gnutls_hash_hd_t _sha256;
#else
SHA256_CTX _sha256;
#endif
};
#endif // ACCELERATEDCRYPTOGRAPHICHASH_H