In T5167#139880, @gniibe wrote:Please show us the output of gpg --card-status, and your configuration if you have something special. Are you using Yubikey also for gpg's signing, or is it only for SSH?
- Queries
- All Stories
- Search
- Advanced Search
- Transactions
- Transaction Logs
Feed Advanced Search
Advanced Search
Advanced Search
Dec 7 2020
Dec 7 2020
Please show us the output of gpg --card-status, and your configuration if you have something special. Are you using Yubikey also for gpg's signing, or is it only for SSH?
Dec 6 2020
Dec 6 2020
• werner added projects to T5167: GnuPG 2.25 still have problems related to Yubikey NEO.: scd, ssh, yubikey, gnupg (gpg22).
There is no caching for smardcard PINs. Once a key (or group of keys) on a hard has been used (i.e. PIN entered). that key can be used as long as the card has not been reset or powered-down. No rule without exception: Some cards may require that a PIN entry is required for each crypto operation. For example the OpenPGP card (which is implemented on a Yubikey) does this for the signing key but not for the authentication (ssh) key. To disable this for the signing key you use the "forcesig" command of gpg --card-edit.
Nov 23 2020
Nov 23 2020
• werner edited projects for T5084: Using GPGWin 3.1.13, Putty fails to load the private key from a YubiKey, added: gnupg; removed gnupg (gpg22).
Removing 2.2 tag because it has been fixed in one of the last releases.
Oct 1 2020
Oct 1 2020
@werner can you confirm if the environment I provided will work with OpenSSH support fully implemented?
Sep 26 2020
Sep 26 2020
That code in gnupg has not been touched in a very long time so this may be caused by some side effect.
Sep 11 2020
Sep 11 2020
• gniibe added a project to T5041: gpg-agent/scdaemon/gnuk unable to sign ssh certificate (Couldn't certify key … via agent: agent refused operation): Restricted Project.
• gniibe changed the status of T5041: gpg-agent/scdaemon/gnuk unable to sign ssh certificate (Couldn't certify key … via agent: agent refused operation) from Open to Testing.
Fixed in Gnuk 1.2.16, although it still has a limitation by the I/O buffer size.
Sep 4 2020
Sep 4 2020
So, if there's no support for native OpenSSH yet, I'll wait for it. After it's supported, I should be able to get the scenery I described working, right?
Unfortunately you can't pass extra arguments.
• gniibe added a comment to T5041: gpg-agent/scdaemon/gnuk unable to sign ssh certificate (Couldn't certify key … via agent: agent refused operation).
Thanks for your information. No debug output any more, as I already figured out things.
Sep 3 2020
Sep 3 2020
ccx added a comment to T5041: gpg-agent/scdaemon/gnuk unable to sign ssh certificate (Couldn't certify key … via agent: agent refused operation).
In case of Ed25519 certificate signed by Ed25519 key with only few names and flags it seems to be just below 500 bytes. This could of course grow if names are added or larger public key is being signed.
@bvieira You need to set pinentry-mode=loopback for gpg program used in git.
• gniibe added a comment to T5041: gpg-agent/scdaemon/gnuk unable to sign ssh certificate (Couldn't certify key … via agent: agent refused operation).
Well, from the viewpoint of card specification, "a message M of arbitrary size" for Ed25519/Ed448 in RFC8032 is not good, because card has a limit for buffer size and the protocol in the OpenPGP card specification requires the steps of (1) the message M is buffered and then (2) the compute the signature.
Sep 2 2020
Sep 2 2020
I'm actually trying to do the following:
In the meantime you can use [0]. I have tested with ssh key on yubikey and AuthenticationMethods publickey, win32-ssh (or ssh-portable, which is the new repository name) correctly works with gpg and pinentry is called. Despite it being called wsl, wsl environment is not required.
• gniibe added a comment to T5041: gpg-agent/scdaemon/gnuk unable to sign ssh certificate (Couldn't certify key … via agent: agent refused operation).
I just confirmed that Gnuk has a limitation for the input length is less than or equals to 256.
So, this is the issue of Gnuk, not GnuPG (or at least, Gnuk has the problem).
• gniibe added a comment to T5041: gpg-agent/scdaemon/gnuk unable to sign ssh certificate (Couldn't certify key … via agent: agent refused operation).
Please show us concrete example of debug output by scdaemon, when you run ssh-keygen.
You can have a setup in .gnupg/scdaemon.conf like:
Sep 1 2020
Sep 1 2020
ccx updated the task description for T5041: gpg-agent/scdaemon/gnuk unable to sign ssh certificate (Couldn't certify key … via agent: agent refused operation).
ccx added a comment to T5041: gpg-agent/scdaemon/gnuk unable to sign ssh certificate (Couldn't certify key … via agent: agent refused operation).
I've meant scdaemon rather than OpenSC. I'll correct the descritpion.
• werner added a project to T5041: gpg-agent/scdaemon/gnuk unable to sign ssh certificate (Couldn't certify key … via agent: agent refused operation): ssh.
gpg-agent has only very limited support for ssh certificates which is the reason that your command fails.
Jul 20 2020
Jul 20 2020
Any news on this?
Jul 14 2020
Jul 14 2020
Dec 12 2019
Dec 12 2019
• werner added a project to T3883: Add Win32-OpenSSH support to gpg-agent's ssh-agent: gnupg (gpg23).
Although I don't use the ssh client on Windows I had to integrate the Windows ssh server into our release process (GlobalSign sent us a Windows-only token, for the new cert and so we can't anymore use osslsigncode). The ssh server is really stable and so it makes a lot of sense to better integrate our ssh-agent into Windows.
Oct 14 2019
Oct 14 2019
npreining added a comment to T2760: Populate comment field when exporting authentication key for SSH.
@werner Yes, that sounds great, and would help already a lot, but extending it for card keys would be optimal. Thanks for your work.
• werner edited projects for T2760: Populate comment field when exporting authentication key for SSH, added: gnupg (gpg23), ssh; removed gnupg.
In master (to be 2.3) you can add a Label: line into the sub key file of on-disk keys. I use this for quite some time now to show me alabel for my on-disk ssh keys so that I known which one was requested. We can and should extend this to card keys.
May 21 2019
May 21 2019
• werner closed T4502: keys added via gpg-agent's ssh-agent interface are stored in private-keys-v1.d/ with a trailing null byte as Resolved.
Also fixed for 2.2
• gniibe claimed T4502: keys added via gpg-agent's ssh-agent interface are stored in private-keys-v1.d/ with a trailing null byte.
I located the bug in agent/command-ssh.c.
Our practice is two calls of gcry_sexp_sprint; One to determine the length including last NUL byte, and another to actually fills the buffer.
The first call return +1 for NUL byte.
The second call fills NUL at the end, but returns +0 length (length sans last NUL).
May 15 2019
May 15 2019
Applied to master and 2.2. Thanks.
May 14 2019
May 14 2019
• werner raised the priority of T4490: --export-secret-keys fails with unusually-created secret key from Normal to High.
I think this patch should be backported to STABLE-BRANCH-2-2
I've just pushed 29adca88f5f6425f5311c27bb839718a4956ec3a to the dkg/fix-T4490 branch, which i believe fixes this issue.
And, i just discovered that when i manually edit the key to remove the (comment) list from the *.key S-expression file, the final --export-secret-key works fine. so the failure appears to be due to the presence of the (comment) clause. (same as in T4501)
May 12 2019
May 12 2019
• werner triaged T4502: keys added via gpg-agent's ssh-agent interface are stored in private-keys-v1.d/ with a trailing null byte as Normal priority.
I often put an extra nul byte at the end of binary data so that accidental printing the data (e.g. in gdb) assures that there is a string terminator. But right, it should not go out to a file.
May 10 2019
May 10 2019
I was trying to use the above technique to be able to generate an OpenPGP transferable secret key in an ephemeral homedir. Ephemeral directories are recommended in the GnuPG info page's "unattended usage" section, but they do not work here.
• werner triaged T4490: --export-secret-keys fails with unusually-created secret key as Normal priority.
Mar 5 2019
Mar 5 2019
ssh does nut support brainpool curves and thus GnuPG does not know how to map its internal name of the curve to the name as specified by ssh. GnuPG supports these curves:
Dec 13 2018
Dec 13 2018
Nov 16 2018
Nov 16 2018
• werner triaged T4260: export all valid authentication subkeys in --export-ssh-key as Low priority.
Oct 29 2018
Oct 29 2018
• werner triaged T4167: Pinentry prompt is confusing with regards to multiple smartcards when gpg-agent is used as ssh-agent as Normal priority.
• werner added a comment to T4167: Pinentry prompt is confusing with regards to multiple smartcards when gpg-agent is used as ssh-agent.
We had this idea to have a label: or similar item in the extended-key-format which is displayed in addition to the other info. The user can then use an editor to put whatever she likes into this field.
Oct 19 2018
Oct 19 2018
• gniibe added a comment to T4167: Pinentry prompt is confusing with regards to multiple smartcards when gpg-agent is used as ssh-agent.
there should be clearer labelling of smartcards so that users can tell them apart more easily
Oct 5 2018
Oct 5 2018
May 16 2018
May 16 2018
@werner I was hoping to make a modified gpg-agent build that would let me walk through what's going on after the nonce is sent but it looks like the gpg4win process only takes in a package of pre-built gpg binaries which rules that out. As far as I can figure out, after the nonce is read and accepted, libassuan creates a stream object out of the socket and then finding nothing in the stream terminates the ssh handler. We send the actual client request immediately after the nonce but in a separate call to send() so I now wonder if by not having anything read in at the same time as the nonce gpg-agent or libassuan thinks that it's a 0-length stream.
Apr 21 2018
Apr 21 2018
I just took a look through assuan-socket.c and it appears that we just need to send the nonce and don't need to read anything back. We also found a bug on our side that was preventing the nonce from being sent, which has been fixed. The error message logged above no longer happens.
The nonce is a string of octets thus it needs to be passed verbatim. I would need to study the code in libassun/src/assuan-socket.c to tell more.
Apr 20 2018
Apr 20 2018
@werner After sending the nonce value from the socket file, does anything need to be read back before ssh-agent commands can be sent? Are there any byte ordering requirements for sending the nonce or can they be sent in the same order as they are in the file?
Apr 14 2018
Apr 14 2018
I've been working with one of Microsoft's developers on a temporary tool that should bridge the connection between named pipes and the Unix sockets emulation used by gpg-agent but things appear to trip up with sending the nonce. From the position of the tool, the nonce value is successfully sent (send returns 16), but never seems to be picked up by gpg-agent. Instead both gpg-agent and the bridge sit there until whatever tool is using them (I test using ssh-add -l) is terminated, at which point gpg-agent immediately spits up the message
Apr 11 2018
Apr 11 2018
• gniibe triaged T3880: gpg-agent's ssh-agent does not handle flags in signing requests properly as Normal priority.
Apr 10 2018
Apr 10 2018
Rhat's for the client, right. I never used it. We used to run a Windows 8 instance in a VM to run tests via ssh on it. That worked most not really stable. For obvious reasons I am more interested in the server part ;-)
• werner changed the status of T3880: gpg-agent's ssh-agent does not handle flags in signing requests properly from Open to Testing.
Thanks. I took these patches and simplified them. Not test tested, though,.
I would argue that the Windows port of OpenSSH is not unstable at this point, especially given that Microsoft is even providing it as an installable feature in the next regular Windows 10 release. The fact that the port is now using actual OpenSSH version numbers instead of their own 0.x versions lends credence to this as well.
dkg reopened T3880: gpg-agent's ssh-agent does not handle flags in signing requests properly as "Open".
Thanks for the fix! however, the fix only addresses the two flags we currently know about. I've pushed a branch T3880-fix that tries to implement the If the agent does not support the requested flags […] It must reply with a SSH_AGENT_FAILURE message part of the spec.
Apr 9 2018
Apr 9 2018
• werner closed T3880: gpg-agent's ssh-agent does not handle flags in signing requests properly as Resolved.
It is in 2.2.6
Thanks for the pointer. But as long as the Windows ssh server is that instable I see no urgent need to add this to GnuPG.
Apr 7 2018
Apr 7 2018
Apr 6 2018
Apr 6 2018
• gniibe changed the status of T3880: gpg-agent's ssh-agent does not handle flags in signing requests properly from Open to Testing.
Apr 5 2018
Apr 5 2018
Jun 26 2017
Jun 26 2017
Fixed in 273964798592cd479c111f47e8ce46d5b1999d6a.
Jun 23 2017
Jun 23 2017
Well, can you then please fix it?
May 24 2017
May 24 2017
Fixed as of 525f2c482abb6bc2002eb878b03558fb43e6b004.
justus moved T2106: Support SHA-256 fingerprints for ssh from Backlog to Wishlist on the gnupg (gpg22) board.
May 17 2017
May 17 2017
Apr 7 2017
Apr 7 2017
Applied as ebe12be034f0.
Apr 6 2017
Apr 6 2017
While I can't reproduce this problem myself, I think I found an issue of gpg-agent passphrase caching.
Double free may happen when multiple threads enter agent_put_cache, for example.
Apr 4 2017
Apr 4 2017
In 2.1.19, gpg-agent uses getpeerucred for macOS. I changed it (since it seemed not working). In 2.1.20, gpg-agent now uses getsockopt with LOCAL_PEERPID.
It seems for me that the crash occurs by ucred_free. If this is the case, 2.1.20 fixes this issue.
Mar 30 2017
Mar 30 2017
marcus moved T3027: gpg-agent crash on macOS Sierra triggerd by ssh from In Progress to Backlog on the gnupg board.
marcus moved T3027: gpg-agent crash on macOS Sierra triggerd by ssh from Backlog to In Progress on the gnupg board.
landro added projects to T3027: gpg-agent crash on macOS Sierra triggerd by ssh: MacOS, ssh, gnupg, gnupg (gpg21), gpgagent, Bug Report.
Feb 8 2017
Feb 8 2017
I can reproduce this. Our test indeed feeds a passphrase to the agent.
Feb 5 2017
Feb 5 2017
dkg changed External Link from 846175@bugs.debian.org to https://bugs.debian.org/846175 on T2856: Can't ssh-add a key w/o a passphrase.
Any thoughts or progress on this?
Jan 26 2017
Jan 26 2017
Jan 6 2017
Jan 6 2017
Adding %f does not help much because it is only used internally. I would be in
favor of adding an ssh-key-mode option so that the user can select the hash algo
and the output format.
Nov 29 2016
Nov 29 2016
• werner set External Link to 846175@bugs.debian.org on T2856: Can't ssh-add a key w/o a passphrase.
• werner added projects to T2856: Can't ssh-add a key w/o a passphrase: ssh, gnupg, Bug Report, Debian.
Oct 13 2016
Oct 13 2016
justus added a comment to T2316: ssh-add ignores keys already in private-keys-v1.d but not in sshcontrol.
John is using 2.1.14, but this bug was fixed in 2.1.15.
justus closed T2316: ssh-add ignores keys already in private-keys-v1.d but not in sshcontrol as Resolved.
Oct 12 2016
Oct 12 2016
dkg reopened T2316: ssh-add ignores keys already in private-keys-v1.d but not in sshcontrol as "Open".
dkg added a comment to T2316: ssh-add ignores keys already in private-keys-v1.d but not in sshcontrol.
This is apparently just re-reported on gnupg-users:
https://lists.gnupg.org/pipermail/gnupg-users/2016-October/056892.html
So i don't think it's fixed.
And fwiw, it seems like a clear bug to me if i use "ssh-add" and then it is not
added to the agent.
From the ssh-add's client's perspective, some keys are magically never added,
but others are. This kind of mystery behavior is confusing and frustrating. If
gpg-agent is going to handle the ssh-agent protocol, it should aim toward behave
as the user of the ssh-agent protocol expects, regardless of whether the user
knows that they're using gpg-agent or some other implementation.
Jul 19 2016
Jul 19 2016
justus added a comment to T2316: ssh-add ignores keys already in private-keys-v1.d but not in sshcontrol.
I do consider it a bug, at least because we did not signal an error to ssh-add.
Fortunately, this was easy to fix.
Fixed in 270f7f7b.
justus closed T2316: ssh-add ignores keys already in private-keys-v1.d but not in sshcontrol as Resolved.
Apr 15 2016
Apr 15 2016
• werner added a project to T2316: ssh-add ignores keys already in private-keys-v1.d but not in sshcontrol: gnupg.
Apr 14 2016
Apr 14 2016
• werner added a comment to T2316: ssh-add ignores keys already in private-keys-v1.d but not in sshcontrol.
I would not consider this a bug. sshcontrol is used to enable certain keys for
use with ssh. Updating keys is useless if they are already available.
If you remove the keys from sshcontrol you disable them. I would suggest to put
a '!' in front of the keygrip instead of deleting the line in sshcontrol. This
allows to re-enable a key w/o problems.
Apr 13 2016
Apr 13 2016
DamienCassou added a comment to T2316: ssh-add ignores keys already in private-keys-v1.d but not in sshcontrol.
The solution is to remove the key in private-keys-v1.d before running ssh-add.
DamienCassou set Version to 2.1.11 on T2316: ssh-add ignores keys already in private-keys-v1.d but not in sshcontrol.
Jan 21 2016
Jan 21 2016