diff options
| author | xiphon <xiphon@protonmail.com> | 2020-06-10 12:26:52 +0000 |
|---|---|---|
| committer | xiphon <xiphon@protonmail.com> | 2020-06-10 15:11:15 +0000 |
| commit | ff4de8e8f74a641d3cc31303f3b172ea7b1be17f (patch) | |
| tree | 6345e838b3d3ae673ff4fd7cada112663e9ef1ce /src/qt/updater.cpp | |
| parent | c8f4355e15e6574c7139bfb5f6ea195ad4199644 (diff) | |
| download | monzero-gui-ff4de8e8f74a641d3cc31303f3b172ea7b1be17f.tar.gz monzero-gui-ff4de8e8f74a641d3cc31303f3b172ea7b1be17f.tar.xz monzero-gui-ff4de8e8f74a641d3cc31303f3b172ea7b1be17f.zip | |
updater: use monero tools::sha256sum
Diffstat (limited to 'src/qt/updater.cpp')
| -rw-r--r-- | src/qt/updater.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/qt/updater.cpp b/src/qt/updater.cpp index 17d6eddb..b8afc761 100644 --- a/src/qt/updater.cpp +++ b/src/qt/updater.cpp @@ -28,6 +28,8 @@ #include "updater.h" +#include <common/util.h> + #include <openpgp/hash.h> #include "network.h" @@ -111,10 +113,9 @@ QPair<QString, QString> Updater::verifySignaturesAndHashSum( QByteArray Updater::getHash(const void *data, size_t size) const { - openpgp::hash hasher(openpgp::hash::algorithm::sha256); - hasher << epee::span<const uint8_t>(reinterpret_cast<const uint8_t *>(data), size); - const std::vector<uint8_t> hash = hasher.finish(); - return QByteArray(reinterpret_cast<const char *>(&hash[0]), hash.size()); + QByteArray hash(sizeof(crypto::hash), 0); + tools::sha256sum(static_cast<const uint8_t *>(data), size, *reinterpret_cast<crypto::hash *>(hash.data())); + return hash; } QByteArray Updater::parseShasumOutput(const QString &message, const QString &filename) const |
