Merge #619: Clear a copied secret key after negation

069870d Clear a copied secret key after negation (Seonpyo Kim)

Pull request description:

  It closes #618

Tree-SHA512: 05299597c886c5d1a913fd0ce8c698d2e513eb80fbd33d571a02fc6910cfd337324c6f0f27175eaf125eb3478d38187763680e859ece9a469a034c9b8a8d6920
This commit is contained in:
Gregory Maxwell 2019-05-16 08:37:20 +00:00
commit 735fbde04e
No known key found for this signature in database
GPG Key ID: EAB5AF94D9E9ABE7
1 changed files with 1 additions and 0 deletions

View File

@ -457,6 +457,7 @@ int secp256k1_ec_privkey_negate(const secp256k1_context* ctx, unsigned char *sec
secp256k1_scalar_negate(&sec, &sec);
secp256k1_scalar_get_b32(seckey, &sec);
secp256k1_scalar_clear(&sec);
return 1;
}