Fix verify pubkey initialization

This commit is contained in:
Jason Rhinelander 2020-02-13 00:53:43 -04:00
parent 98a4aed68f
commit b11d2870bd
1 changed files with 1 additions and 1 deletions

View File

@ -372,7 +372,7 @@ LokiMQ::LokiMQ(
// Verify the pubkey. We could get by with taking just the privkey and just generate this
// for ourselves, but this provides an extra check to make sure we and the caller agree
// cryptographically (e.g. to make sure they don't pass us an ed25519 keypair by mistake)
std::string verify_pubkey{crypto_box_PUBLICKEYBYTES, 0};
std::string verify_pubkey(crypto_box_PUBLICKEYBYTES, 0);
crypto_scalarmult_base(reinterpret_cast<unsigned char*>(&verify_pubkey[0]), reinterpret_cast<unsigned char*>(&privkey[0]));
if (verify_pubkey != pubkey)
throw std::invalid_argument("Invalid pubkey/privkey values given to LokiMQ construction: pubkey verification failed");