mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-19 00:15:21 +01:00
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:
parent
8d943ce2bd
commit
cb415a6a02
5 changed files with 61 additions and 16 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue