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

gnupg-pkcs11-scd: add PKAUTH command support #28

Merged
merged 1 commit into from
Mar 19, 2021

Conversation

invidian
Copy link
Contributor

@invidian invidian commented Mar 19, 2021

This commit adds PKAUTH command support to gnupg-pkcs11-scd, so
gpg-agent with "enable-ssh-support" setting defined can act as a SSH
Agent when PKCS11 is used as a GPG backend.

Auth operation is almost the same as sign operation, except it looks
like SSH always sends data with hash algorithm signature appended at the
beginning, but the data is of different size than the signature
detection code expects, so it always fallback to default behavior, which
is to append SHA1 signature.

As having 2 different signature prefixes is incorrect, we need to
use the different default value from the sign action, which is to not
append anything in case of auth operation.

Closes #27

Signed-off-by: Mateusz Gozdek mgozdekof@gmail.com

gnupg-pkcs11-scd/command.c Outdated Show resolved Hide resolved
gnupg-pkcs11-scd/command.c Outdated Show resolved Hide resolved
This commit adds PKAUTH command support to gnupg-pkcs11-scd, so
gpg-agent with "enable-ssh-support" setting defined can act as a SSH
Agent when PKCS11 is used as a GPG backend.

Auth operation is almost the same as sign operation, except it looks
like SSH always sends data with hash algorithm signature appended at the
beginning, but the data is of different size than the signature
detection code expects, so it always fallback to default behavior, which
is to append SHA1 signature.

As having 2 different signature prefixes is incorrect, we need to
use the different default value from the sign action, which is to not
append anything in case of auth operation.

Closes alonbl#27

Signed-off-by: Mateusz Gozdek <mgozdekof@gmail.com>
@invidian
Copy link
Contributor Author

Fixed one more inconsistent indentation.

@alonbl alonbl merged commit 13afe73 into alonbl:master Mar 19, 2021
@invidian invidian deleted the add-auth-support branch March 19, 2021 19:09
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.

Support for SSH authentication
2 participants