Skip to content

misc fixes key.py #200

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

Merged
merged 1 commit into from
May 19, 2019
Merged

Conversation

markblundeberg
Copy link
Contributor

  • BN_bin2bn happy to take null ptr as arg and do allocation.
  • EC_POINT_mul hears you the first time, don't need to call twice.
  • EC_KEY_set_private_key makes a copy of the key; without freeing it we have a memory leak.

* EC_POINT_mul hears you the first time, don't need to call twice.
* EC_KEY_set_private_key makes a copy of the key; without freeing it we have a memory leak.
* BN_bin2bn happy to take None as arg and do allocation.
_ssl.EC_KEY_set_private_key(self.k, priv_key)
_ssl.EC_KEY_set_public_key(self.k, pub_key)
_ssl.EC_POINT_free(pub_key)
_ssl.BN_free(priv_key)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is key. Get it?

Yes, you really need to free your private keys from memory.

@petertodd petertodd merged commit c31b6e7 into petertodd:master May 19, 2019
petertodd added a commit that referenced this pull request May 19, 2019
c31b6e7 misc fixes key.py (Mark B Lundeberg)

Pull request description:

  * BN_bin2bn happy to take null ptr as arg and do allocation.
  * EC_POINT_mul hears you the first time, don't need to call twice.
  * EC_KEY_set_private_key makes a copy of the key; without freeing it we have a memory leak.

Tree-SHA512: 6557c788c27933ee1dc3d6085f3c3f259ed0547811c1a3f7bd3679f8ee664772a53cca81a56e6dfac2eaecea613d006b1c5ccaedc7c7ccd121a15fcd41fb58fb
@petertodd
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants