summaryrefslogtreecommitdiff
path: root/hmqv.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2016-09-16 11:27:15 -0400
committerJeffrey Walton <noloader@gmail.com>2016-09-16 11:27:15 -0400
commit399a1546de71f41598c15edada28e7f0d616f541 (patch)
tree530160789358a3303be180df2d8529c82782156b /hmqv.h
parentfca5fbb36169a7522e6c533df9c322d47e3dc6bb (diff)
downloadcryptopp-git-399a1546de71f41598c15edada28e7f0d616f541.tar.gz
Add CRYPTOPP_ASSERT (Issue 277, CVE-2016-7420)
trap.h and CRYPTOPP_ASSERT has existed for over a year in Master. We deferred on the cut-over waiting for a minor version bump (5.7). We have to use it now due to CVE-2016-7420
Diffstat (limited to 'hmqv.h')
-rw-r--r--hmqv.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/hmqv.h b/hmqv.h
index 2aa4058b..7cbc1c5b 100644
--- a/hmqv.h
+++ b/hmqv.h
@@ -170,7 +170,7 @@ public:
}
else
{
- assert(0);
+ CRYPTOPP_ASSERT(0);
return false;
}
@@ -253,12 +253,12 @@ protected:
{
HASH hash;
size_t idx = 0, req = dlen;
- size_t blk = std::min(dlen, (size_t)HASH::DIGESTSIZE);
+ size_t blk = STDMIN(dlen, (size_t)HASH::DIGESTSIZE);
if(sigma)
{
if (e1len != 0 || s1len != 0) {
- assert(0);
+ CRYPTOPP_ASSERT(0);
}
Integer x = GetAbstractGroupParameters().ConvertElementToInteger(*sigma);
SecByteBlock sbb(x.MinEncodedSize());
@@ -266,7 +266,7 @@ protected:
hash.Update(sbb.BytePtr(), sbb.SizeInBytes());
} else {
if (e1len == 0 || s1len == 0) {
- assert(0);
+ CRYPTOPP_ASSERT(0);
}
hash.Update(e1, e1len);
hash.Update(s1, s1len);
@@ -281,7 +281,7 @@ protected:
hash.Update(&digest[idx], (size_t)HASH::DIGESTSIZE);
idx += (size_t)HASH::DIGESTSIZE;
- blk = std::min(req, (size_t)HASH::DIGESTSIZE);
+ blk = STDMIN(req, (size_t)HASH::DIGESTSIZE);
hash.TruncatedFinal(&digest[idx], blk);
req -= blk;