-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes to build on ubuntu 20.04 #14
base: master
Are you sure you want to change the base?
Conversation
@@ -367,7 +367,7 @@ bool MultiSig::MultiSigVerify(const bytes& message, unsigned int offset, | |||
return false; | |||
} | |||
err2 = (BN_nnmod(challenge_built.get(), challenge_built.get(), | |||
Schnorr::GetCurveOrder(), NULL) == 0); | |||
Schnorr::GetCurveOrder(), ctx.get()) == 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This caused a SEGV when running ubuntu 20.04 - the API for bignum indicates that this argument should be provided. It is a scratch variable:
https://linux.die.net/man/3/bn_nnmod
For all functions, ctx is a previously allocated BN_CTX used for temporary variables;
@@ -129,6 +129,11 @@ void Challenge::Set(const CommitPoint& aggregatedCommit, | |||
|
|||
bytes buf(Schnorr::PUBKEY_COMPRESSED_SIZE_BYTES); | |||
|
|||
unique_ptr<BN_CTX, void (*)(BN_CTX*)> ctx(BN_CTX_new(), BN_CTX_free); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allocate temporary ctx variable here
shared_ptr<EC_POINT> result = | ||
ECPOINTSerialize::GetNumber(src, offset, PUB_KEY_SIZE); | ||
ECPOINTSerialize::GetNumber(src, offset, src.size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when the size of src was not PUB_KEY_SIZE this would fail. However if you allow compressed and uncompressed signatures your pub key size could vary.
Codecov Report
@@ Coverage Diff @@
## master #14 +/- ##
==========================================
- Coverage 76.83% 76.50% -0.33%
==========================================
Files 19 19
Lines 1105 1111 +6
==========================================
+ Hits 849 850 +1
- Misses 256 261 +5
Continue to review full report at Codecov.
|
See comments inline