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

set correct signarue digest name when using ECDSA cert #127

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

outsinre
Copy link

When using ECDSA certificate, the signature name is the full name (e.g., ecdsa-with-SHA384), but indeed should be the digest part only (e.g., SHA384).

This PR fixes the issue. Make sure lua-resty-openssl is bumped to 0.8.10.

@gsimko
Copy link

gsimko commented Oct 6, 2022

What's needed here to get this merged? @leafo can you please take a look?

@gsimko
Copy link

gsimko commented Oct 6, 2022

Just an update that this also fixes when the signature is RSA-SHA1.

If we want to stay closer to what postgres does, instead of objects.txt2nid(signature) we could directly do server_cert.get_signature_nid().
For reference, here is the postgres code: https://github.com/postgres/postgres/blob/a601366a460f68472bf70c4d94c57baa0a3ed1b2/src/backend/libpq/be-secure-openssl.c#L1434

@leafo
Copy link
Owner

leafo commented Oct 7, 2022

This code is only compatible with openresty, not the other socket layers. Additionally it looks like the test suite did not run, does it need to be rebased to pick up the latest workflow?

@gsimko
Copy link

gsimko commented Oct 8, 2022

I couldn't find a solution with cqueues and luasocket for the signature -> digest conversion but added manual handling for the two scenarios I have observed (ecdsa-with-sha384 and rsa-sha1).
Can you please take a look at #130 @leafo ?

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