Skip to content

Commit

Permalink
Fix compilation with crypto++ >= 6.0.0 (#5974)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocobozzz authored and hatstand committed Feb 1, 2018
1 parent 790fc2f commit 38c1f87
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/internet/spotify/spotifyblobdownloader.cpp
Expand Up @@ -42,6 +42,11 @@
#ifdef HAVE_CRYPTOPP
#include <cryptopp/pkcspad.h>
#include <cryptopp/rsa.h>

// Compatibility with cryptocpp >= 6.0.0
namespace CryptoPP {
typedef unsigned char byte;
}
#endif // HAVE_CRYPTOPP

const char* SpotifyBlobDownloader::kSignatureSuffix = ".sha512";
Expand Down Expand Up @@ -189,7 +194,7 @@ bool SpotifyBlobDownloader::CheckSignature(

try {
CryptoPP::ByteQueue bytes;
bytes.Put(reinterpret_cast<const byte*>(public_key_data.constData()),
bytes.Put(reinterpret_cast<const CryptoPP::byte*>(public_key_data.constData()),
public_key_data.size());
bytes.MessageEnd();

Expand All @@ -204,9 +209,9 @@ bool SpotifyBlobDownloader::CheckSignature(
actual_filename.remove(kSignatureSuffix);

const bool result = verifier.VerifyMessage(
reinterpret_cast<const byte*>(file_data[actual_filename].constData()),
reinterpret_cast<const CryptoPP::byte*>(file_data[actual_filename].constData()),
file_data[actual_filename].size(),
reinterpret_cast<const byte*>(
reinterpret_cast<const CryptoPP::byte*>(
file_data[signature_filename].constData()),
file_data[signature_filename].size());
qLog(Debug) << "Verifying" << actual_filename << "against"
Expand Down

0 comments on commit 38c1f87

Please sign in to comment.