Clear asserts under DEBUG builds

This commit is contained in:
Jeffrey Walton 2019-07-06 15:57:08 -04:00
parent fd7115fc8b
commit 2ffa70fbc6
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
2 changed files with 3 additions and 2 deletions

View File

@ -405,8 +405,9 @@ RandomNumberGenerator & NullRNG()
bool HashTransformation::TruncatedVerify(const byte *digest, size_t digestLength)
{
// Allocate at least 1 for calculated to avoid triggering diagnostics
ThrowIfInvalidTruncatedSize(digestLength);
SecByteBlock calculated(digestLength);
SecByteBlock calculated(digestLength ? digestLength : 1);
TruncatedFinal(calculated, digestLength);
return VerifyBufsEqual(calculated, digest, digestLength);
}

View File

@ -41,7 +41,7 @@ bool CryptoSystemValidate(PK_Decryptor &priv, PK_Encryptor &pub, bool thorough)
std::cout << (fail ? "FAILED " : "passed ");
std::cout << "cryptosystem key validation\n";
const byte *message = (byte *)"test message";
const byte message[] = "test message";
const int messageLen = 12;
SecByteBlock ciphertext(priv.CiphertextLength(messageLen));
SecByteBlock plaintext(priv.MaxPlaintextLength(ciphertext.size()));