mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-29 12:17:49 +02:00
Added VERIFY_ALWAYS_SUCCEEDS conditional to allow signature verifiers to always succeed during fuzzing for maximum code coverage.
This commit is contained in:
parent
acfa3938ba
commit
7c9c5ac12e
3 changed files with 17 additions and 1 deletions
|
@ -126,6 +126,11 @@ namespace crypto
|
||||||
BN_CTX_free (ctx);
|
BN_CTX_free (ctx);
|
||||||
if (!passed)
|
if (!passed)
|
||||||
LogPrint (eLogError, "25519 signature verification failed");
|
LogPrint (eLogError, "25519 signature verification failed");
|
||||||
|
|
||||||
|
#ifdef VERIFY_ALWAYS_SUCCEEDS
|
||||||
|
passed = true;
|
||||||
|
#endif
|
||||||
|
|
||||||
return passed;
|
return passed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -102,6 +102,11 @@ namespace crypto
|
||||||
EC_POINT_free (C);
|
EC_POINT_free (C);
|
||||||
BN_CTX_end (ctx);
|
BN_CTX_end (ctx);
|
||||||
BN_CTX_free (ctx);
|
BN_CTX_free (ctx);
|
||||||
|
|
||||||
|
#ifdef VERIFY_ALWAYS_SUCCEEDS
|
||||||
|
ret = true;
|
||||||
|
#endif
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,13 @@ namespace crypto
|
||||||
|
|
||||||
bool EDDSA25519Verifier::Verify (const uint8_t * buf, size_t len, const uint8_t * signature) const
|
bool EDDSA25519Verifier::Verify (const uint8_t * buf, size_t len, const uint8_t * signature) const
|
||||||
{
|
{
|
||||||
return EVP_DigestVerify (m_MDCtx, signature, 64, buf, len);
|
bool ret = EVP_DigestVerify (m_MDCtx, signature, 64, buf, len);
|
||||||
|
|
||||||
|
#ifdef VERIFY_ALWAYS_SUCCEEDS
|
||||||
|
ret = true;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue