Skip to content
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

Add fallback to pure-python ripemd160 #277

Merged
merged 2 commits into from
Jul 29, 2022
Merged

Conversation

windsok
Copy link
Contributor

@windsok windsok commented Jul 26, 2022

Newer versions of OpenSSL have removed support for ripemd160 by default which results in an ValueError: unsupported hash type ripemd160 exception being raised any time the Hash160 function is used within python-bitcoinlib.

See bitcoin/bitcoin#23710 for further details of the issue.

This PR adds a fallback to a pure-python implementation of ripemd160. The code is taken from bitcoin/bitcoin#23716, and the implementation here is based on diybitcoinhardware/embit@2e293b0

@petertodd
Copy link
Owner

petertodd commented Jul 27, 2022 via email

@windsok
Copy link
Contributor Author

windsok commented Jul 27, 2022

Makes sense to me, I have added the new commit

@petertodd
Copy link
Owner

petertodd commented Jul 29, 2022 via email

@petertodd petertodd merged commit de5c6a0 into petertodd:master Jul 29, 2022
@kristapsk
Copy link

There was actually kinda better version of this with type annotations added. Simplexum#65

niftynei added a commit to niftynei/lnprototest that referenced this pull request Sep 8, 2022
OpenSSL removed ripemd160, which impacts the default impl of hashlib for
most python installs (true as of 22.04 LTS)

See also:

- openssl/openssl#16994
- bitcoin/bitcoin#23710
- petertodd/python-bitcoinlib#277
niftynei added a commit to niftynei/lnprototest that referenced this pull request Sep 8, 2022
OpenSSL removed ripemd160, which impacts the default impl of hashlib for
most python installs (true as of 22.04 LTS)

See also:

- openssl/openssl#16994
- bitcoin/bitcoin#23710
- petertodd/python-bitcoinlib#277
niftynei added a commit to niftynei/lnprototest that referenced this pull request Sep 9, 2022
OpenSSL removed ripemd160, which impacts the default impl of hashlib for
most python installs (true as of 22.04 LTS)

See also:

- openssl/openssl#16994
- bitcoin/bitcoin#23710
- petertodd/python-bitcoinlib#277
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.

None yet

3 participants