Open BugsMonkeyspherehttp://web.monkeysphere.info/bugs/Monkeysphereikiwiki2010-03-21T21:47:50Zuse getopts instead of getopthttp://web.monkeysphere.info/bugs/use_getopts_instead_of_getopt/2010-03-21T21:47:50Z2008-12-01T04:27:36Z
<p>Since Monkeysphere is using bash, it would be nice to use the shell
build in getopts function, instead of the external getopt program.
This would reduce an external dependency, which would definitely be
better for portability.</p>
<hr />
<p>So it looks like the sh built-in getopts does not include long options
(eg. "--expire"). Is it worth getting rid of the long options for
this?</p>
<hr />
<p>Why not just get rid of getopts altogether and perform a simple
argument-processing loop with bash string tests? We're only invoking
getopt in three places, and each invocation is no more complex than
three arguments -- and most arguments take a separate parameter, which
means that handling tricky arg blobs like -aCxr are not gonna be
supported anyway.</p>
posix compliancehttp://web.monkeysphere.info/bugs/posix_compliance/2010-03-21T21:47:50Z2008-12-01T04:27:36Z
<p>It would be nice to make all of the Monkeysphere scripts POSIX
compliant, for portability and light-weightedness. Better POSIX
compliance would probably at least be better for compatibility with
o{ther,lder} versions of bash. Unfortunately there are quite a few
bashism at the moment, so this may not be trivial. For instance:</p>
<pre><code> servo:~/cmrg/monkeysphere/git 0$ checkbashisms -f src/monkeysphere-server 2>&1 | wc -l
50
servo:~/cmrg/monkeysphere/git 0$
</code></pre>
<p>It looks like the biggest complication for this would be the
occasional use of bash arrays.</p>
useful informationhttp://web.monkeysphere.info/bugs/useful_information/2010-03-21T21:47:50Z2008-11-15T23:03:34Z
<p>I would like to know, at INFO (default) log level, when the
monkeyspehere makes a "real" modification to my known_hosts file; that
is, when it adds or deletes a key.</p>
<p>Apparently this is hard because monkeysphere is currently configured to
delete all keys and then add good keys, so a key added for the first
time seems to the monkeysphere very similar to a key re-added ten
seconds after last login.</p>
<p>Still, from a UI perspective, I want to know what monkeysphere is doing.</p>
<hr />
<p>It looks like jrollins committed a change for reporting at INFO level
when a host key gets added by the monkeysphere:
2459fa3ea277d7b9289945748619eab1e3441e5c</p>
<p>When i connect to a host whose key is not already present in my
known_hosts file, i get the following to stderr:</p>
<pre><code>ms: * new key for squeak.fifthhorseman.net added to known_hosts file.
</code></pre>
<p>This doesn't fully close this bug, because we aren't notifying on key
deletion, afaict.</p>
<hr />
<p>So current log level DEBUG will output a message if the known host
file has been modified. If the issue is that you want to know at the
default log level everytime the known_hots file is modified, then we
should just move this message to INFO instead of debug, and then maybe
remove the message that I added above. I was under the impression
that the issue was more about notification that a <em>new</em> key was added
to the known_hosts file, and therefore the new INFO message above
fixed that problem. Should we do this instead?</p>
<p>In general, more verbose log levels <em>do</em> tell the user what the
monkeysphere is doing. Moving to DEBUG log level will tell you pretty
much everything that happens. I do <em>not</em> think that this should be
the default log level, though.</p>
<hr />
<p>I wouldn't want to see an extremely verbose default log level. But i
do think that saying something like "key blah blah blah was stripped
from your known_hosts file because it was expired" (for example)
would be useful. I think this case would occur infrequently enough
that it is worth reporting in the UI at the regular log level.</p>
<p>--dkg</p>
ssh config files not parsedhttp://web.monkeysphere.info/bugs/ssh_config_files_not_parsed/2010-03-21T21:47:50Z2008-10-27T02:16:32Z
<p>In <code>~/.ssh/config</code>, i have:</p>
<pre><code>HashKnownHosts No
</code></pre>
<p>But when <code>monkeysphere-ssh-proxycommand</code> adds new hosts to
<code>~/.ssh/known_hosts</code>, they appear to be added in a hashed form,
instead of in the clear.</p>
<p>fwiw: i'm using OpenSSH 5.1p1 on a debian lenny system (backported
from sid)</p>
<hr />
<p>I can confirm this too (I'm running openssh-client 1:4.7p1-12)</p>
<p>-- Jamie (Jam Jam)</p>
<hr />
<p>There is absolutely no attempt by any monkeysphere utility to parse
any ssh or sshd config file. This will probably need to be delt with
down the line, but it's not a particular easy task at the moment.</p>
<p>-- Big Jimmy.</p>
<hr />
<p>I've <a href="http://marc.info/?l=openssh-unix-dev&m=121804767122918&w=2">posted to the <code>openssh-unix-dev</code> list to see if there is a
possibility of openssh making our lives easier
here</a>, but
i haven't had much of a response yet.</p>
<p>--dkg</p>
<hr />
<p>For some reason this didn't get mentioned in this bug earlier, but
there is a monkeysphere config variable about hashing known_hosts
lines, which is set to true by default (to be in sync with the Debian
openssh-client package).</p>
<p>I think this bug is really more about the fact that monkeysphere does
not parse the ssh config files for any directives relavent to what the
monkeysphere is doing. I'm changing the name of this bug to reflect
what the real issue is.</p>
<p>-- Big Jimmy.</p>
Problems with root-owned gpg keyringshttp://web.monkeysphere.info/bugs/problems-with-root-owned-gpg-keyrings/2010-03-21T21:47:50Z2008-09-15T01:41:18Z
<p><code>/var/lib/monkeysphere/gnupg-host/</code> is root-owned, and the public
keyring in that directory is controlled by the superuser.</p>
<p>We currently expect the <code>monkeysphere</code> user to read from (but not
write to) that keyring. But using a keyring in a directory that you
don't control appears to trigger <a href="http://bugs.debian.org/361539">a subtle bug in
gpg</a> that has been unresolved for quite
a long time.</p>
<p>With some of the new error checking i'm doing in
<code>monkeysphere-server</code>, typical operations that involve both keyrings
as the non-privileged user can fail with an error message like:</p>
<pre><code>gpg: failed to rebuild keyring cache: file open error
</code></pre>
<p>Running the relevant operation a second time as the same user usually
lets things go through without a failure, but this seems like it would
be hiding a bug, rather than getting it fixed correctly.</p>
<p>Are there other ways we can deal with this problem?</p>
<p>--dkg</p>
<p>Here is an example when using monkeysphere-server
add-identity-certifier on a host with a newly-installed monkeysphere
installaton. Note that running the same command a second time works
as expected:</p>
<pre><code> 0 pip:~# monkeysphere-server c+ 0EE5BE979282D80B9F7540F1CCD2ED94D21739E9
gpg: requesting key D21739E9 from hkp server pool.sks-keyservers.net
gpg: key D21739E9: public key "Daniel Kahn Gillmor <dkg@fifthhorseman.net>" imported
gpg: can't create `/var/lib/monkeysphere/gnupg-host/pubring.gpg.tmp': Permission denied
gpg: failed to rebuild keyring cache: file open error
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: next trustdb check due at 2009-03-30
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
Could not receive a key with this ID from the 'pool.sks-keyservers.net' keyserver.
255 pip:~# monkeysphere-server c+ 0EE5BE979282D80B9F7540F1CCD2ED94D21739E9
gpg: requesting key D21739E9 from hkp server pool.sks-keyservers.net
gpg: key D21739E9: "Daniel Kahn Gillmor <dkg@fifthhorseman.net>" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
key found:
pub 4096R/D21739E9 2007-06-02 [expires: 2012-05-31]
Key fingerprint = 0EE5 BE97 9282 D80B 9F75 40F1 CCD2 ED94 D217 39E9
uid [ unknown] Daniel Kahn Gillmor <dkg@fifthhorseman.net>
uid [ unknown] Daniel Kahn Gillmor <dkg@openflows.com>
uid [ unknown] Daniel Kahn Gillmor <dkg@astro.columbia.edu>
uid [ unknown] Daniel Kahn Gillmor <dkg-debian.org@fifthhorseman.net>
uid [ unknown] [jpeg image of size 3515]
sub 2048R/4BFA08E4 2008-06-19 [expires: 2009-06-19]
sub 4096R/21484CFF 2007-06-02 [expires: 2012-05-31]
Are you sure you want to add the above key as a
certifier of users on this system? (y/N) y
gpg: key D21739E9: public key "Daniel Kahn Gillmor <dkg@fifthhorseman.net>" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: next trustdb check due at 2009-03-30
gpg (GnuPG) 1.4.9; Copyright (C) 2008 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
pub 4096R/D21739E9 created: 2007-06-02 expires: 2012-05-31 usage: SC
trust: unknown validity: unknown
[ unknown] (1). Daniel Kahn Gillmor <dkg@fifthhorseman.net>
[ unknown] (2) Daniel Kahn Gillmor <dkg@openflows.com>
[ unknown] (3) Daniel Kahn Gillmor <dkg@astro.columbia.edu>
[ unknown] (4) Daniel Kahn Gillmor <dkg-debian.org@fifthhorseman.net>
[ unknown] (5) [jpeg image of size 3515]
pub 4096R/D21739E9 created: 2007-06-02 expires: 2012-05-31 usage: SC
trust: unknown validity: unknown
Primary key fingerprint: 0EE5 BE97 9282 D80B 9F75 40F1 CCD2 ED94 D217 39E9
Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Daniel Kahn Gillmor <dkg@openflows.com>
Daniel Kahn Gillmor <dkg@astro.columbia.edu>
Daniel Kahn Gillmor <dkg-debian.org@fifthhorseman.net>
[jpeg image of size 3515]
This key is due to expire on 2012-05-31.
Please decide how far you trust this user to correctly verify other users' keys
(by looking at passports, checking fingerprints from different sources, etc.)
1 = I trust marginally
2 = I trust fully
Please enter the depth of this trust signature.
A depth greater than 1 allows the key you are signing to make
trust signatures on your behalf.
Please enter a domain to restrict this signature, or enter for none.
Are you sure that you want to sign this key with your
key "ssh://pip.fifthhorseman.net" (9B83C17D)
The signature will be marked as non-exportable.
gpg: can't create `/var/lib/monkeysphere/gnupg-host/pubring.gpg.tmp': Permission denied
gpg: failed to rebuild keyring cache: file open error
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0 valid: 1 signed: 1 trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: depth: 1 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 1f, 0u
gpg: next trustdb check due at 2009-03-30
Identity certifier added.
0 pip:~#
</code></pre>
make tarball is not idempotenthttp://web.monkeysphere.info/bugs/make-tarball-is-not-idempotent/2010-03-21T21:47:50Z2008-09-15T00:50:00Z
<p>The current monkeysphere Makefile has a "tarball" target, which
produces the "upstream tarball". Unfortunately, it is not idempotent.
That is, if you run it twice in a row (without changing any other
source), the second .orig.tar.gz file is bytewise different from the
first.</p>
<p>We should fix this so that the tarball generated is the same at least
as long as no local file has been touched.</p>
<p>--dkg</p>
proposed new monkeysphere-server subcommand: setuphttp://web.monkeysphere.info/bugs/setup-subcommand-for-monkeysphere-server/2010-03-21T21:47:50Z2008-09-13T19:14:15Z
<p>What if everything that's done in the package post-installation
scripts (aside from maybe the creation of the monkeysphere user
itself) was done with a single call to something like</p>
<pre><code>monkeysphere-server setup
</code></pre>
<p>This would make things more obvious to folks installing from source
directly, and put less maintenance load on porters. The end of
<code>monkeysphere-server setup</code> could also invoke <code>monkeysphere-server
diagnostics</code> to get the admin pointed in the right direction.</p>
<p>Think of this as a sort of automated "Getting Started" documentation.</p>
<p>Of course, a hypothetical <em>full</em> setup command would do things like
<code>gen-key</code>, auto-modify <code>sshd_config</code>, etc. We wouldn't want to do
those things automatically without the guiding hand of the local
sysadmin.</p>
<p>But perhaps we could even smooth that process with:</p>
<pre><code>monkeysphere-server setup --full
</code></pre>
<p>I'd like to know what other folks think about these possibilities.
Would either of these be useful? Are they confusing? Could they be
clarified?</p>
<p>--dkg</p>
<hr />
<p>I'm not sure how I feel about this idea. I feel like it should just
be the job of the package to setup the initial server environment. I
don't really feel like the admin should have to worry about it. But
then again, I can sort of see it from the point of view of someone
just installing from source (but who the hell really does that
anymore anyway?).</p>
<p>I'm also sort of mixed about the setup --full idea as well. At first
I thought that it wasn't a good idea, and that I didn't like the idea
of monkeysphere monkeying around with the config files of other
packages (ie. ssh). However, once I started to think about setting up
monkeysphere on lots of servers, I started to think that it's maybe a
good idea. It might be good to have a single command that would just
end with the server being on the monkeysphere:</p>
<ul>
<li>generate the server key</li>
<li>modify sshd to point to it</li>
<li>restart ssh</li>
<li>publish the key to the keyserver</li>
</ul>
<p>So I'm starting to think that this might be a good idea. Also curious
what other think.</p>
<p>-- jrollins</p>
Monkeysphere support for options in authorized_keyshttp://web.monkeysphere.info/bugs/authorized_keys-options/2010-03-21T21:47:50Z2008-09-08T02:36:15Z
<p>OpenSSH <a href="http://www.hackinglinuxexposed.com/articles/20030109.html">allows users to control the capabilities granted to remote
key-based
logins</a> by
supplying options that should limit the use of the key.</p>
<p>For example, specifying <code>no-pty</code> means that <code>sshd</code> should not allocate
a pseudo-terminal for sessions created based on an authentication with
that key.</p>
<p>It is unclear if it is possible to do this sort of limiting in
<code>~/.monkeysphere/authorized_user_ids</code>, and if it is possible, how
you'd actually do it.</p>
<p>--dkg</p>
monkeysphere-gen-subkey-treats-revoked-auth-subkey-as-validhttp://web.monkeysphere.info/bugs/monkeysphere-gen-subkey-treats-revoked-auth-subkey-as-valid/2010-03-21T21:47:50Z2008-09-03T19:27:59Z
<p>If you have a revoked authentication subkey in your keyring,
monkeysphere gen-subkey thinks that I have an authentication subkey
already, which I do, but it probably shouldn't care about it, since it
is revoked:</p>
<pre><code> 21:30@pond> monkeysphere gen-subkey F67E2A5D1CF2D62A
An authentication subkey already exists for key 'F67E2A5D1CF2D62A'.
Are you sure you would like to generate another one? (y/N)
</code></pre>
<p>However: this key was revoked on 2008-04-28 by DSA key 1CF2D62A Micah Anderson <a href="mailto:micah@riseup.net">micah@riseup.net</a>
sub 1024R/866F47D3 created: 2008-02-25 revoked: 2008-04-28 usage: A </p>
<p>I can continue to create a new authorization subkey, so its not a
blocker or anything (I suppose I could also delete the revoked key
from my keyring as well, although thats less than ideal).</p>
<p>It seems like the secret keyring doesn't mention that it has been
revoked, so probably monkeysphere needs to be looking at gpg's
computed validity from the public keyring instead of the secret
keyring to be able to get the "r" flag from field 2, in addition to
the "e" flag from field 12.</p>
<hr />
<p>So the problem is that there is no field 2 for secret keys. From
/usr/share/doc/gnupg/DETAILS.gz:</p>
<pre><code> 2. Field: A letter describing the calculated trust. This is a single
letter, but be prepared that additional information may follow
in some future versions. (not used for secret keys)
</code></pre>
<p>Why would secret keys not have this field? They have validity too,
right? This doesn't make any sense. I verify that indeed there is no
output in field 2 for secret keys. I would say this is a bug in gpg,
but it's clearly done on purpose. Any ideas?</p>
<p>-- jrollins</p>
gpg-authentication-cmd requires single inputhttp://web.monkeysphere.info/bugs/gpg-authentication-cmd_requires_single_input/2010-03-21T21:47:50Z2008-08-19T05:22:29Z
<p>In monkeysphere-server, the gpg_authentication function, and
consequently the gpg_authentication_cmd, currently requires that all
arguments be put in a single quoted argument, eg:</p>
<pre><code> gpg_authentication "--list-key --with-colons --with-fingerprint 0x${keyID}!"
</code></pre>
<p>This is obviously a little lame, but it seems to be necessary to do
the necessary argument passing from the function, to the su function
called as the monkeysphere user that controls the gpg authentication
keyring.</p>
<p>I'm not sure how to fix it. I think the problem is mostly in how
arguments are passed to su.</p>
<p>-- Big Jimmy.</p>
Add man pages to web sitehttp://web.monkeysphere.info/bugs/add-man-pages-to-website/2010-03-21T21:47:50Z2008-08-18T03:40:12Z
<p>We should publish the various monkeysphere man pages in browsable form
somewhere under http://web.monkeysphere.info/. Ideally, this would be
updated automatically from the sources for the official man pages
themselves.</p>
<p>This strikes me as an ikiwiki subproject (implementing a man2html wiki
compilation language perhaps?).</p>
<p>Interestingly, <a href="http://ikiwiki.info/usage/">ikiwiki's own man page</a>
appears to be written in markdown and then converted to nroff.</p>
revoke-hostname function revokes wrong hostname user IDhttp://web.monkeysphere.info/bugs/revoke-hostname-revoking-wrong-userid/2010-03-21T21:47:50Z2008-08-17T07:13:31Z
<p>It appears that the monkeysphere-server revoke-hostname function will
occasionaly revoke the wrong hostname. I say occasionally, but it
seems to be doing it pretty consistently for me at the moment:</p>
<pre><code>servo:~ 0$ sudo monkeysphere-server n- servo.finestructure.net
The following host key user ID will be revoked:
ssh://servo.finestructure.net
Are you sure you would like to revoke this user ID? (y/N) y
gpg (GnuPG) 1.4.9; Copyright (C) 2008 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Secret key is available.
pub 1024R/9EEAC276 created: 2008-07-10 expires: never usage: CA
trust: ultimate validity: ultimate
[ultimate] (1) ssh://localhost.localdomain
[ultimate] (2). ssh://servo.finestructure.net
[ revoked] (3) ssh://jamie.rollins
[ revoked] (4) asdfsdflkjsdf
[ revoked] (5) ssh://asdfsdlf.safsdf
[ revoked] (6) ssh://bar.baz
[ revoked] (7) ssh://foo.bar
[ revoked] (8) ssh://
pub 1024R/9EEAC276 created: 2008-07-10 expires: never usage: CA
trust: ultimate validity: ultimate
[ultimate] (1)* ssh://localhost.localdomain
[ultimate] (2). ssh://servo.finestructure.net
[ revoked] (3) ssh://jamie.rollins
[ revoked] (4) asdfsdflkjsdf
[ revoked] (5) ssh://asdfsdlf.safsdf
[ revoked] (6) ssh://bar.baz
[ revoked] (7) ssh://foo.bar
[ revoked] (8) ssh://
Please select the reason for the revocation:
0 = No reason specified
4 = User ID is no longer valid
Q = Cancel
(Probably you want to select 4 here)
Enter an optional description; end it with an empty line:
Reason for revocation: User ID is no longer valid
Hostname removed by monkeysphere-server 2008-08-16T17:34:02
pub 1024R/9EEAC276 created: 2008-07-10 expires: never usage: CA
trust: ultimate validity: ultimate
[ revoked] (1) ssh://localhost.localdomain
[ultimate] (2). ssh://servo.finestructure.net
[ revoked] (3) ssh://jamie.rollins
[ revoked] (4) asdfsdflkjsdf
[ revoked] (5) ssh://asdfsdlf.safsdf
[ revoked] (6) ssh://bar.baz
[ revoked] (7) ssh://foo.bar
[ revoked] (8) ssh://
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0 valid: 1 signed: 2 trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: depth: 1 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 2f, 0u
gpg: next trustdb check due at 2012-01-07
sec 1024R/9EEAC276 2008-07-10
Key fingerprint = C094 43E0 6882 8BE2 E9AD 516C 45CF 974D 9EEA C276
uid ssh://servo.finestructure.net
uid [ revoked] ssh://localhost.localdomain
uid [ revoked] ssh://jamie.rollins
uid [ revoked] asdfsdflkjsdf
uid [ revoked] ssh://asdfsdlf.safsdf
uid [ revoked] ssh://bar.baz
uid [ revoked] ssh://foo.bar
uid [ revoked] ssh://
NOTE: User ID revoked, but revokation not published.
Run 'monkeysphere-server publish-key' to publish the revocation.
servo:~ 0$
</code></pre>
<p>Clearly this is unacceptable. gpg does not let you can't specify a
uid to revoke from the command line. The uid revokation can only be
done through edit-key. We do edit-key scripting in other contexts,
but to revoke a user id you have to specify the uid by "number". We
currently try to guess the number from the ordering of the output of
list-key. However, this output does not appear to coincide with the
ordering in edit-key. I don't have a good solution or fix at the
moment. Suggestions are most welcome. It may just require some trial
and error with edit-key to come up with something workable.</p>
<p>This underlines the problem that gpg is currently not very well suited
for manipulating gpg keyrings non-interactively. It's possible that I
just haven't figured out how to do it yet, but it's not very clear if
it is possible. It would be nice to have some alternate tools to use.</p>
<p>-- Big Jimmy.</p>
MonkeySphere can't deal with passphrase-locked primary keyshttp://web.monkeysphere.info/bugs/handle-passphrase-locked-secret-keys/2010-03-21T21:47:50Z2008-08-13T19:57:31Z
<p>At the moment, the only tool we have to export passphrase-locked
secret keys from the GPG keyring is <code>gpg</code> itself (and <code>gpg2</code>, which
has roughly the same behavior).</p>
<p>As a result, we have the <code>seckey2sshagent</code> hack, which is unfriendly
and awkward to use.</p>
<p>Ideally, <code>openpgp2ssh</code> would be able to convert passphrase-locked
secret keys into clean subkeys. However, i've tried to do this via
GnuTLS, and that library is not ready for this.</p>
<p>OpenCDK, which is the component of GnuTLS which reads OpenPGP-style
keys, cannot cope with encrypted secret key material. I have had
<a href="http://lists.gnu.org/archive/html/gnutls-devel/2008-06/msg00092.html">some
success</a>
in getting GnuTLS's OpenCDK to accept the existence of encrypted
secret key packets, <a href="http://lists.gnu.org/archive/html/gnutls-devel/2008-07/msg00012.html">i learned that OpenCDK as included in GnuTLS is
incapable of dealing with the encrypted packets
themselves</a>.</p>
<p>Some possible resolutions:</p>
<hr />
<p>If we can assume that the passphrase-encrypted key we want to use is
actually a subkey, and if we could fix GnuTLS to ignore the use of the
"gnu-dummy S2K" produced by <code>gpg --export-secret-subkeys</code> for the
primary key, then something like the following script should actually
work for reasonable values of <code>$KEYID</code>:</p>
<pre><code>TMPDIR=$(mktemp -d)
umask 077
mkfifo "$TMPDIR/passphrase"
kname="MonkeySphere Key $KEYID"
mkfifo "$TMPDIR/$kname"
ssh-askpass "Please enter the passphrase for MonkeySphere key $KEYID" >"$TMPDIR/passphrase" &
gpg --passphrase-fd 3 3<"$TMPDIR/passphrase" \
--export-options export-reset-subkey-passwd,export-minimal,no-export-attributes \
--export-secret-subkeys "$KEYID"\! | openpgp2ssh "$KEYID" > "$TMPDIR/$kname" &
(cd "$TMPDIR" && ssh-add -c "$kname")
rm -rf "$TMPDIR"
</code></pre>
<p>Good news! <a href="http://lists.gnu.org/archive/html/gnutls-devel/2008-08/msg00005.html">I've crafted a patch for GnuTLS to enable it to read
exported subkeys using this GNU
extension</a>,
so if we can get it incorporated into upstream (and/or into debian),
we have a possible solution, as long as the authentication key is a
subkey, and not a primary key.</p>
<p>As of version 0.11-1, <code>monkeysphere subkey-to-ssh-agent</code> implements
this particular strategy (and fails cleanly if the version of GnuTLS
present doesn't support the GNU dummy S2K extension).</p>
<hr />
<p>Ben Laurie and Rachel Willmer's
<a href="http://openpgp.nominet.org.uk">OpenPGPSDK</a> is a candidate: this is a
C-based library that intends to implement RFC 4880 functionality.</p>
<p>We could potentially re-write <code>openpgp2ssh</code> using this library, and it
<em>should</em> be able to handle everything we need from the OpenPGP side
(though it might need to be re-linked to OpenSSL to handle PEM-encoded
exports.</p>
<p>Concerns:</p>
<ul>
<li><p>OpenPGPSDK is not in debian yet, and doesn't currently (2008-08-13)
build with gcc 4.2 or 4.3.</p></li>
<li><p>OpenPGPSDK uses the apache license and appears to link to OpenSSL,
which has a GPL-incompatible license. I think this would mean that
<code>openpgp2ssh</code> could not remain GPL (though the rest of the
monkeysphere could).</p></li>
</ul>
<hr />
<p>We could try to use perl. The last time i checked, the pure-perl
OpenPGP implementations all depended on Math::PARI, which <a href="http://bugs.debian.org/440527">is not in
debian</a>. The most likely candidate is
<a href="http://search.cpan.org/~btrott/Crypt-OpenPGP">Crypt::OpenPGP</a>,
despite <a href="http://cpanratings.perl.org/dist/Crypt-OpenPGP">some
bugginess</a>. </p>
<p>Concerns:</p>
<ul>
<li><p>the aforementioned buggy reviews</p></li>
<li><p>there's a lot of dependency chasing to get anything like this
available in debian.</p></li>
</ul>
<hr />
<p>Other alternatives?</p>
<hr />
<p>Can this bug be closed? dkg <a href="http://web.monkeysphere.info/bugs/install-seckey2sshagent-in-usr-bin/">reported in a comment for a related
bug</a>:</p>
<pre><code>Version 0.11-1 now has the monkeysphere subkey-to-ssh-agent
subcommand, which works cleanly in the presence of a
functionally-patched GnuTLS.
</code></pre>
<hr />
<p>Even with the patched GnuTLS, monkeysphere currently can't currently
deal with passphrase-locked primary keys. I've changed the title of
this bug, but i'd like to keep it open until we are able to deal with
that. The other comments here seem still quite relevant to that
need.</p>
<p>I've changed the title of this bug to reflect the narrowed scope.</p>
<pre><code> --dkg
</code></pre>
Running `monkeysphere gen-key` on a headless server takes way too longhttp://web.monkeysphere.info/bugs/headless-servers-take-too-long-to-generate-host-key/2010-03-21T21:47:50Z2008-08-07T02:37:50Z
<p>When i try to generate a key on a headless machine (no kbd, no mouse,
no Human Input Device (HID) at all), <code>monkeysphere gen-key</code> hangs for
a <em>very</em> long time (over an hour so far!) during the generation
process, particularly at this point:</p>
<pre><code>ms: generating server key...
Not enough random bytes available. Please do some other work to give
the OS a chance to collect more entropy! (Need 197 more bytes)
</code></pre>
<p>And sure enough, there really is very little entropy in these systems
at the time requested:</p>
<pre><code>0 chomsky:~# cat /proc/sys/kernel/random/entropy_avail
32
0 chomsky:~#
</code></pre>
<p>It's not clear to me how to increase the entropy available to the
kernel without an HID.</p>
<p>I've seen this happen on two machines now in the last week, and was
able to resolve it on the first one by plugging in a keyboard and
"massaging" it. This won't work for a machine that's out of physical
range, and has no keyboard to be plugged in anyway.</p>
<p>One thing that might help is to suggest that the system administrator
install a package like <code>bsdgames</code> and play console-based games as a
non-privileged user, since that seems to feed the entropy count
somewhat.</p>
add-identity-certifier-behaves-oddly-without-ptyhttp://web.monkeysphere.info/bugs/add-identity-certifier-behaves-oddly-without-pty/2010-03-21T21:47:50Z2008-08-04T01:09:37Z
<p>When executing <code>monkeysphere-server add-identity-certifier</code> across a
link without a pseudo-terminal, it behaves oddly (prompts are created
that are only halfway-readable, gpg gives error messages about lacking
access to a <code>/dev/tty</code>, etc.</p>
<p>You can try this directly if you have remote ssh access to the
superuser on a monkeysphere-enabled host, assuming that <code>$GPGID</code> is
set to the full fingerprint of a key you want to add as a trusted
identity certifier:</p>
<pre><code>ssh root@example.org monkeysphere-server add-identity-certifier $GPGID
</code></pre>
<p>Compare this behavior with:</p>
<pre><code>ssh -t root@example.org monkeysphere-server add-identity-certifier $GPGID
</code></pre>
hostkeyalias-confuses-monkeyspherehttp://web.monkeysphere.info/bugs/hostkeyalias-confuses-monkeysphere/2010-03-21T21:47:50Z2008-08-04T00:32:59Z
<p>Consider the following snippet in <code>~/.ssh/config</code>:</p>
<pre><code> Host foo
HostKeyAlias bar
</code></pre>
<p>for a host which is <em>not</em> participating in the monkeysphere.</p>
<p>For such a host, when using <code>monkeysphere-ssh-proxy-command</code>, the
public keyservers will be queried on each attempted ssh connection
(even after a successful connection).</p>
<p>This appears to be because:</p>
<ul>
<li><p><code>ssh</code> itself will write a line to <code>~/.ssh/known_hosts</code>, but it will
be labeled with <code>bar</code> because of the <code>HostKeyAlias</code>. </p></li>
<li><p><code>monkeysphere</code> won't be able to find any mention of it in the
keyring (it's not in the monkeysphere)</p></li>
<li><p><code>monkeysphere-ssh-proxycommand</code> won't be able to find it in the
<code>known_hosts</code> file because it looks for <code>foo</code>, which is never
matched.</p></li>
</ul>
<p>excessive keyserver querying is bad behavior, because it causes delays
for the users, and puts excessive load on the public keyserver
infrastructure.</p>
<p>How can we resolve this?</p>