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

maybe switch HTTP Signatures lib #430

Open
snarfed opened this issue Feb 17, 2023 · 9 comments
Open

maybe switch HTTP Signatures lib #430

snarfed opened this issue Feb 17, 2023 · 9 comments
Labels

Comments

@snarfed
Copy link
Owner

snarfed commented Feb 17, 2023

We currently use https://github.com/ahknight/httpsig, but it's been unmaintained since 2018. We're already on our own fork, https://github.com/snarfed/httpsig, to get ahknight/httpsig#26.

Looks like https://dev.funkwhale.audio/funkwhale/requests-http-message-signatures is more recently maintained. Or if not, maybe https://github.com/pyauth/http-message-signatures, but less likely.

@snarfed
Copy link
Owner Author

snarfed commented Apr 16, 2023

Merging #472 in here. From that issue:

Looks like https://mostr.pub/ is currently sending us hs2019 sigs, which we don't yet support. Example, with added newlines for readability:

Signature:
keyId="https://mostr.pub/users/82341f882b6eabcd2ba7f1ef90aad961cf074af15b9ef44a09f9d2a8fbfbe6a2#main-key",
algorithm="hs2019",
headers="(request-target) date host digest",
signature="QKlTxp2ax7u5crANhXF5n9dK2sN/5Y2ZpD/FIIai2POoxCXY1x+Ca8WUAa15UbHkX3hXEzz2t0drbGnVlQfQxisKn/ViNRpJ0WMVAFTO+XH8rGpMoRoorxDSzoMcV/TFkjZ387d30gbC/ddPck4WPZyfeRZilEKXQ1gi437Xg4A="

Related:

@snarfed
Copy link
Owner Author

snarfed commented Apr 16, 2023

Checking these libs for hs2019 support. Looks like https://codeberg.org/socialhome/python-httpsig-socialhome.git has it.

@snarfed snarfed changed the title Consider switching HTTP Signatures library HTTP Signatures: support hs2019, maybe switch lib Apr 16, 2023
@snarfed
Copy link
Owner Author

snarfed commented Apr 16, 2023

Nothing in pyauth-http-signatures: https://github.com/pyauth/http-message-signatures/search?q=hs2019&type=

@snarfed
Copy link
Owner Author

snarfed commented Apr 16, 2023

Am I even understanding this right? https://arewehs2019yet.vpzom.click/ makes it sound like hs2019 isn't a cipher/algorithm at all, but a directive that passes through to rsa-sha256 or 512 or something.

@snarfed
Copy link
Owner Author

snarfed commented Apr 16, 2023

Aha. From TritonDataCenter/node-http-signature#106 :

In the newest version of the specification draft (https://tools.ietf.org/html/draft-cavage-http-signatures-12) it is recommended to hide the algorithm from the signature by using hs2019. In fact in appendix E.2. it states that every other algorithm is deprecated.

@snarfed
Copy link
Owner Author

snarfed commented Apr 16, 2023

...but that version of the spec is superceded by https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-message-signatures-16, which doesn't mention hs2019 at all 🤷

@snarfed
Copy link
Owner Author

snarfed commented Apr 17, 2023

conclusion seems to be that the fediverse is still generally on cavage v12 at most, and hasn't migrated to httpbis yet.

sounds like hs2019 technically moves algorithm into either key metadata or sec:signingAlgorithm LD context, but I haven't seen examples of either of those in the wild yet. in practice people often seem to be just assuming rsa-sha256.

@snarfed
Copy link
Owner Author

snarfed commented Apr 17, 2023

I hacked this in 842f8ac and ba38d68 by hard coding hs2019 to rsa-sha256. 😎

@snarfed snarfed changed the title HTTP Signatures: support hs2019, maybe switch lib maybe switch HTTP Signatures lib Apr 17, 2023
@edent
Copy link

edent commented Mar 3, 2024

This is very confusing! Thank you for documenting it!

@snarfed snarfed added now infra and removed now labels May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants