QCryptographicHash: don't include openssl/sha.h
... it conflicts with rfc6234/sha.h's SHA{1,224,256,384,512} symbols. We can't drop the rfc6234/sha.h header, as openssl/sha.h doesn't give us the algorithm's block sizes, necessary for HMAC (QMessageAuthenticationCode). But we can drop openssl/sha.h. The only reason we included the header was to get access to SHA<N>_DIGEST_LENGTH, but this is a well-known value and easily obtained from rfc6234/sha.h as SHA<N>HashSize, so use that. Even reduces #ifdef'ery. Amends d9f9d03fd34d951eb587fe082a0dbda33b8df248. Fixes: QTBUG-111467 Change-Id: Ice19ad8c788fb2828666647cc40abb894cd7af2b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit e388d219a4a29e7a5a81ff1a6dcf995662177b43) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
4d2c4ff384
commit
080f2654bb
@ -116,7 +116,6 @@ static inline int SHA384_512AddLength(SHA512Context *context, unsigned int lengt
|
||||
#define USING_OPENSSL30
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/provider.h>
|
||||
#include <openssl/sha.h>
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
@ -158,17 +157,10 @@ static constexpr int hashLengthInternal(QCryptographicHash::Algorithm method) no
|
||||
#ifndef QT_CRYPTOGRAPHICHASH_ONLY_SHA1
|
||||
CASE(Md4, 16);
|
||||
CASE(Md5, 16);
|
||||
#ifdef USING_OPENSSL30
|
||||
CASE(Sha224, SHA224_DIGEST_LENGTH);
|
||||
CASE(Sha256, SHA256_DIGEST_LENGTH);
|
||||
CASE(Sha384, SHA384_DIGEST_LENGTH);
|
||||
CASE(Sha512, SHA512_DIGEST_LENGTH);
|
||||
#else
|
||||
CASE(Sha224, SHA224HashSize);
|
||||
CASE(Sha256, SHA256HashSize);
|
||||
CASE(Sha384, SHA384HashSize);
|
||||
CASE(Sha512, SHA512HashSize);
|
||||
#endif
|
||||
CASE(Blake2s_128, 128 / 8);
|
||||
case QCryptographicHash::Blake2b_160:
|
||||
case QCryptographicHash::Blake2s_160:
|
||||
|
Loading…
x
Reference in New Issue
Block a user