aboutsummaryrefslogtreecommitdiff
path: root/lib/pluginloader
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pluginloader')
-rw-r--r--lib/pluginloader/pluginloader.cpp6
-rw-r--r--lib/pluginloader/pluginloader.h2
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/pluginloader/pluginloader.cpp b/lib/pluginloader/pluginloader.cpp
index 082a449..ce84c7a 100644
--- a/lib/pluginloader/pluginloader.cpp
+++ b/lib/pluginloader/pluginloader.cpp
@@ -65,7 +65,11 @@ bool PluginLoader::verify(const char *hashName)
const std::size_t buffer_size = 1024;
std::vector<char> buffer(buffer_size);
- while(const auto sz = plugin.readsome(&buffer.front(), buffer_size)) {
+ std::size_t sz = 0;
+ while(true) {
+ sz = static_cast<std::size_t>(plugin.readsome(&buffer.front(), buffer_size));
+ if(sz <= 0)
+ break;
rc = EVP_DigestVerifyUpdate(ctx, reinterpret_cast<unsigned char *>(buffer.data()), sz);
if(rc != 1) {
m_sigError = tr("Failed to compute signature (stage=update)");
diff --git a/lib/pluginloader/pluginloader.h b/lib/pluginloader/pluginloader.h
index 703c285..cc67901 100644
--- a/lib/pluginloader/pluginloader.h
+++ b/lib/pluginloader/pluginloader.h
@@ -45,6 +45,6 @@ public:
bool verify(const char *hashName = "SHA256");
private:
- const int m_state;
+ const signature_state_t m_state;
QString m_sigError;
};