summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-02-27 14:08:27 +0100
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-02-29 15:06:23 +0100
commit9c08c27b168320cb2fa9e80fe0c7e09f8a5b1952 (patch)
treedf61d794451f8bebce60034fa8478534e8478cc7 /src/utils
parentfbfc9e60cdd104108b541dfb7258d99eb519e452 (diff)
downloadjustbuild-9c08c27b168320cb2fa9e80fe0c7e09f8a5b1952.tar.gz
verify_hash utils: Clarify return value meaning
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/cpp/verify_hash.hpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/utils/cpp/verify_hash.hpp b/src/utils/cpp/verify_hash.hpp
index 4ec3a30b..e827680d 100644
--- a/src/utils/cpp/verify_hash.hpp
+++ b/src/utils/cpp/verify_hash.hpp
@@ -24,6 +24,7 @@
/// \brief Check if the passed string \p s is a hash.
/// This function is mainly used to check that the hash of a Digest received
/// over the wire is a real hash, to prevent a malicious attack.
+/// \returns Nullopt on success, error message on failure.
[[nodiscard]] static inline auto IsAHash(std::string const& s) noexcept
-> std::optional<std::string> {
if (!std::all_of(s.begin(), s.end(), [](unsigned char c) {