Lots of cleanup, more work on certificates, some security fixes.

This commit is contained in:
Adam Ierymenko 2013-10-16 17:47:26 -04:00
parent 58fa6cab43
commit 46f868bd4f
13 changed files with 632 additions and 216 deletions

View file

@ -163,15 +163,10 @@ bool CertificateOfMembership::agreesWith(const CertificateOfMembership &other) c
// Compare to determine if the absolute value of the difference
// between these two parameters is within our maxDelta.
uint64_t a = _qualifiers[myidx].value;
uint64_t b = other._qualifiers[myidx].value;
if (a >= b) {
if ((a - b) > _qualifiers[myidx].maxDelta)
return false;
} else {
if ((b - a) > _qualifiers[myidx].maxDelta)
return false;
}
const uint64_t a = _qualifiers[myidx].value;
const uint64_t b = other._qualifiers[myidx].value;
if (((a >= b) ? (a - b) : (b - a)) > _qualifiers[myidx].maxDelta)
return false;
++myidx;
}