Ensure that bootstrapped users of QCryptographicHash only use SHA-1

This reduces code size quite considerably in the bootstrapped tools.

Change-Id: I7475650b1936e93afcf327cb4def2f7763609179
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This commit is contained in:
Thiago Macieira 2013-08-13 13:42:55 -07:00 committed by The Qt Project
parent d5ed6936be
commit 37215efeea
2 changed files with 9 additions and 1 deletions

View File

@ -45,6 +45,10 @@
#include "../../3rdparty/sha1/sha1.cpp"
#if defined(QT_BOOTSTRAPPED) && !defined(QT_CRYPTOGRAPHICHASH_ONLY_SHA1)
# error "Are you sure you need the other hashing algorithms besides SHA-1?"
#endif
#ifndef QT_CRYPTOGRAPHICHASH_ONLY_SHA1
// qdoc and qmake only need SHA-1
#include "../../3rdparty/md5/md5.h"

View File

@ -55,9 +55,12 @@ class Q_CORE_EXPORT QCryptographicHash
{
public:
enum Algorithm {
#ifndef QT_CRYPTOGRAPHICHASH_ONLY_SHA1
Md4,
Md5,
Sha1,
#endif
Sha1 = 2,
#ifndef QT_CRYPTOGRAPHICHASH_ONLY_SHA1
Sha224,
Sha256,
Sha384,
@ -66,6 +69,7 @@ public:
Sha3_256,
Sha3_384,
Sha3_512
#endif
};
explicit QCryptographicHash(Algorithm method);