QCryptographicHash: enable -Wswitch in methodToName()

Let the compiler alert us to adjust this switch in case we add more
Algorithm enumerators.

Amends 633c1365966eda89fc883c039683a727d0a0813e.

Pick-to: 6.7 6.5
Change-Id: I2ce16ac3045d3eebfe74c4080c3b326dd865cf37
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 0abf0d26a938e9cf7c67d8bf6f6bfdf4e49f1cab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2024-08-24 14:33:40 +02:00 committed by Qt Cherry-pick Bot
parent 5c2796a079
commit 92284a5c02

View File

@ -270,9 +270,21 @@ static constexpr const char * methodToName(QCryptographicHash::Algorithm method)
CASE(RealSha3_512, "SHA3-512");
CASE(Blake2b_512, "BLAKE2B512");
CASE(Blake2s_256, "BLAKE2S256");
// not supported by OpenSSL:
CASE(Keccak_224, nullptr);
CASE(Keccak_256, nullptr);
CASE(Keccak_384, nullptr);
CASE(Keccak_512, nullptr);
CASE(Blake2b_160, nullptr);
CASE(Blake2b_256, nullptr);
CASE(Blake2b_384, nullptr);
CASE(Blake2s_128, nullptr);
CASE(Blake2s_160, nullptr);
CASE(Blake2s_224, nullptr);
CASE(NumAlgorithms, nullptr);
#undef CASE
default: return nullptr;
}
return nullptr;
}
/*