From 9c08c27b168320cb2fa9e80fe0c7e09f8a5b1952 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Tue, 27 Feb 2024 14:08:27 +0100 Subject: verify_hash utils: Clarify return value meaning --- src/utils/cpp/verify_hash.hpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/utils/cpp/verify_hash.hpp') 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 { if (!std::all_of(s.begin(), s.end(), [](unsigned char c) { -- cgit v1.2.3