Skip to content

Support Nettle 4 besides version 3 - #844

Open
gsauthof wants to merge 1 commit into
ronf:developfrom
gsauthof:nettle4
Open

gsauthof wants to merge 1 commit into
ronf:developfrom
gsauthof:nettle4

Conversation

@gsauthof

Copy link
Copy Markdown
Contributor

i.e. drop the digest size argument when the nettle library version 4 is loaded due to version 4 API changes

fixes #842

@codecov

codecov Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.57143% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.86%. Comparing base (fab96ac) to head (8aeb0e4).
⚠️ Report is 260 commits behind head on develop.

Files with missing lines Patch % Lines
asyncssh/crypto/umac.py 78.57% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #844      +/-   ##
===========================================
+ Coverage    99.85%   99.86%   +0.01%     
===========================================
  Files           95      102       +7     
  Lines        27784    32702    +4918     
  Branches      2908     3139     +231     
===========================================
+ Hits         27743    32658    +4915     
- Misses          38       40       +2     
- Partials         3        4       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gsauthof

Copy link
Copy Markdown
Contributor Author

Hm, looks like the style of type annotations I copied relies on being evaluated lazily, i.e. requires at least python 3.14, where that lazy evaluation was introduced.

Hence the failing CI checks on python < 3.14.

This also means that the same style inside _build_umac() must also fail on python < 3.14.
Perhaps that code isn't invoked in the CI though because libnettle isn't found or similar.

i.e. drop the digest size argument when the nettle library version 4 is
loaded due to version 4 API changes

fixes ronf#842
@gsauthof

Copy link
Copy Markdown
Contributor Author

This also means that the same style inside _build_umac() must also fail on python < 3.14. Perhaps that code isn't invoked in the CI though because libnettle isn't found or similar.

No, this is wrong.

Apparently, with python < 3.14 these annotations are already lazily evaluated/ignored in a context like in _build_umac() but not at global scope ...

Updated the pull-request with a fix for older python versions.

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.

UMAC support segfaults with Nettle 4

1 participant