mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-21 16:49:10 +01:00
Merge pull request #965 from majestrate/fix-leak-2017-09-27
try fixing leak
This commit is contained in:
commit
5e0d4163a2
1 changed files with 2 additions and 1 deletions
|
@ -353,6 +353,7 @@ namespace crypto
|
||||||
BN_mod_mul (x, x, I, q, ctx);
|
BN_mod_mul (x, x, I, q, ctx);
|
||||||
if (BN_is_odd (x))
|
if (BN_is_odd (x))
|
||||||
BN_sub (x, q, x);
|
BN_sub (x, q, x);
|
||||||
|
BN_CTX_end (ctx);
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -370,7 +371,7 @@ namespace crypto
|
||||||
buf1[0] &= 0x7f; // clear highest bit
|
buf1[0] &= 0x7f; // clear highest bit
|
||||||
BIGNUM * y = BN_new ();
|
BIGNUM * y = BN_new ();
|
||||||
BN_bin2bn (buf1, EDDSA25519_PUBLIC_KEY_LENGTH, y);
|
BN_bin2bn (buf1, EDDSA25519_PUBLIC_KEY_LENGTH, y);
|
||||||
auto x = RecoverX (y, ctx);
|
BIGNUM * x = RecoverX (y, ctx);
|
||||||
if (BN_is_bit_set (x, 0) != isHighestBitSet)
|
if (BN_is_bit_set (x, 0) != isHighestBitSet)
|
||||||
BN_sub (x, q, x); // x = q - x
|
BN_sub (x, q, x); // x = q - x
|
||||||
BIGNUM * z = BN_new (), * t = BN_new ();
|
BIGNUM * z = BN_new (), * t = BN_new ();
|
||||||
|
|
Loading…
Add table
Reference in a new issue