I'm actually trying to do the following:
- Queries
- All Stories
- Search
- Advanced Search
- Transactions
- Transaction Logs
Advanced Search
Sep 2 2020
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.
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).
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
I've meant scdaemon rather than OpenSC. I'll correct the descritpion.
gpg-agent has only very limited support for ssh certificates which is the reason that your command fails.
Jul 20 2020
Any news on this?
Jul 14 2020
Dec 12 2019
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
@werner Yes, that sounds great, and would help already a lot, but extending it for card keys would be optimal. Thanks for your work.
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
Also fixed for 2.2
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
Applied to master and 2.2. Thanks.
May 14 2019
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
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
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.
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
Nov 16 2018
Oct 29 2018
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
there should be clearer labelling of smartcards so that users can tell them apart more easily
Oct 5 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
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
@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
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 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 ;-)
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.
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
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 6 2018
Apr 5 2018
Jun 26 2017
Fixed in 273964798592cd479c111f47e8ce46d5b1999d6a.
Jun 23 2017
Well, can you then please fix it?
May 24 2017
Fixed as of 525f2c482abb6bc2002eb878b03558fb43e6b004.
May 17 2017
Apr 7 2017
Applied as ebe12be034f0.
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
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
Feb 8 2017
I can reproduce this. Our test indeed feeds a passphrase to the agent.
Feb 5 2017
Any thoughts or progress on this?
Jan 26 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
Oct 13 2016
John is using 2.1.14, but this bug was fixed in 2.1.15.
Oct 12 2016
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
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.
Apr 15 2016
Apr 14 2016
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
The solution is to remove the key in private-keys-v1.d before running ssh-add.
Jan 21 2016
Jan 20 2016
Thanks, now this works as expected for me :-)
Jan 11 2016
Right, getkey_next had a somewhat surprising semantic. I fixed that with commit
b280aa6.
It also works with ECDSA keys.
Jan 8 2016
Current master b2da3951 segfaults on me.
Btw. I think this is likely because i have a local ID without an Authentication
subkey for aheinecke@gnupg.org
(gdb) run --export-ssh-key aheinecke@gnupg.org
Starting program: /opt/gnupg/bin/gpg2 --export-ssh-key aheinecke@gnupg.org
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
gpg: NOTE: THIS IS A DEVELOPMENT VERSION!
gpg: It is only intended for test purposes and should NOT be
gpg: used in a production environment or with production keys!
gpg: enabled debug flags: memstat
Program received signal SIGSEGV, Segmentation fault.
lookup (ctx=ctx@entry=0x6dd940, ret_keyblock=ret_keyblock@entry=0x0,
ret_found_key=ret_found_key@entry=0x7fffffffd998,
want_secret=<optimized out>) at ../../g10/getkey.c:3116
3116 *ret_keyblock = keyblock; /* Return the keyblock. */
(gdb) bt full
#0 lookup (ctx=ctx@entry=0x6dd940, ret_keyblock=ret_keyblock@entry=0x0,
ret_found_key=ret_found_key@entry=0x7fffffffd998,
want_secret=<optimized out>) at ../../g10/getkey.c:3116 rc = 0 no_suitable_key = 0 keyblock = 0x0 found_key = 0x701980
#1 0x0000000000415bb6 in getkey_next (ctx=0x6dd940, pk=0x0, ret_keyblock=0x0)
at ../../g10/getkey.c:1636
rc = <optimized out> found_key = 0x0
#2 0x000000000045713a in export_ssh_key (ctrl=0x6dd810, userid=0x7fffffffe420
"aheinecke@gnupg.org") at ../../g10/export.c:1437
getkeyctx = 0x6dd940 keyblock = 0x6fd160 desc = {mode = KEYDB_SEARCH_MODE_SUBSTR, skipfnc = 0x0, skipfncvalue =
0x0, sn = 0x0, snlen = 0, u = {
name = 0x7fffffffe420 "aheinecke@gnupg.org", fpr = "
\344\377\377\377\177", '\000' <repeats 17 times>, kid = {
4294960160, 32767}, grip = " \344\377\377\377\177", '\000'
<repeats 13 times>}, exact = 0}
curtime = 1452288169 pk = 0x0 identifier = 0x6ddb80 "" mb = {len = 0, size = 4096, buf = 0x6e5d70 "", out_of_core = 0} fp = 0x6dd810 b64_state = {flags = 7199040, idx = 0, quad_count = -153676256, fp =
0x10, stream = 0x6dd800, title = 0x6ddb80 "",
radbuf = "\000\000\000", crc = 0, stop_seen = -1, invalid_encoding =
0, lasterr = 0}
fname = 0x7fffffffe420 "aheinecke@gnupg.org"
#3 0x000000000040dc00 in main (argc=1, argv=0x7fffffffdfe8) at ../../g10/gpg.c:4193
pargs = {argc = 0x7fffffffdb9c, argv = 0x7fffffffdb90, flags = 32769,
err = 0, r_opt = 0, r_type = 0, r = {ret_int = 0,
ret_long = 0, ret_ulong = 0, ret_str = 0x0}, internal = {idx = 2,
inarg = 0, stopped = 1,
last = 0x7fffffffe420 "aheinecke@gnupg.org", aliases = 0x0,
cur_alias = 0x0, iio_list = 0x0}}
a = 0x6dd800 orig_argc = 0 orig_argv = 0x6ddb80 fname = 0x7fffffffe420 "aheinecke@gnupg.org" sl = 0x0 remusr = 0x6ddb40 locusr = 0x0 nrings = 0x0 afx = 0x7fffffffe420 configfp = 0x7fffffffe420 configlineno = 27 parse_debug = 7198720 cmd = aExportSshKey malloc_hooks = {malloc = 0x405ee0 <gcry_malloc@plt>, realloc = 0x406d40
<gcry_realloc@plt>, free = 0x406290 <gcry_free@plt>}
ctrl = 0x6dd810
Done with commit 4970868 to be released with 2.1.11.
This uses a new command and not an export option so that export options can be
kept in the conf file.
ECDSA keys (NIST keys) do not yet work.
Jan 7 2016
Right, this is what I actually had in mind. Using the "<keyid>!" notaion it
would also be possible to export any primary of subkey in ssh format.
Dec 18 2015
That fingerprint looks more like gibberish than something which should be
compared by the user. In that regard a SHA-1 fingerprint looks much more
serious and IMHO will be more secure than a base-64 fingerprint where you have
to explain that the users also need to match the case - if they are at all able
to compare that fingerprint.
We should take this to the mailing list.