From 8bdeded365a07a48114ab80be6d6b51660cec005 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Wed, 4 Feb 2009 01:47:16 -0500 Subject: pem2openpgp: avoid dumping garbage to stderr --- src/keytrans/pem2openpgp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/keytrans/pem2openpgp b/src/keytrans/pem2openpgp index e905644..c765002 100755 --- a/src/keytrans/pem2openpgp +++ b/src/keytrans/pem2openpgp @@ -495,11 +495,8 @@ my $datatosign = $sig_data_to_be_hashed. $trailer; -print STDERR $datatosign; - my $data_hash = Digest::SHA1::sha1_hex($datatosign); - my $issuer_packet = pack('CCa8', 9, $subpacket_types->{issuer}, $keyid); my $sig = Crypt::OpenSSL::Bignum->new_from_bin($rsa->sign($datatosign)); -- cgit v1.2.3 From 7a96cfb6bfa9f5ab8cc82930049b0c46097a2634 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Wed, 4 Feb 2009 01:51:55 -0500 Subject: tests/keytrans: terminate reasonably on success. --- tests/keytrans | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/keytrans b/tests/keytrans index e1ccda5..285d17b 100755 --- a/tests/keytrans +++ b/tests/keytrans @@ -78,3 +78,11 @@ diff -u \ <(PEM2OPENPGP_USAGE_FLAGS=sign,certify \ PEM2OPENPGP_TIMESTAMP="$timestamp" pem2openpgp testtest < \ "$TEMPDIR"/test.pem | hd ) + +trap - EXIT + +echo "##################################################" +echo " Monkeysphere keytrans test completed successfully!" +echo "##################################################" + +cleanup -- cgit v1.2.3 From fa55936fde40619cdb955a089065d27a67f03f10 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Wed, 4 Feb 2009 12:21:45 -0500 Subject: web site: added news item about the planned changes for the pending release of the monkeysphere. --- website/news/plans-for-the-bezoar.mdwn | 45 ++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 website/news/plans-for-the-bezoar.mdwn diff --git a/website/news/plans-for-the-bezoar.mdwn b/website/news/plans-for-the-bezoar.mdwn new file mode 100644 index 0000000..0fb2c5b --- /dev/null +++ b/website/news/plans-for-the-bezoar.mdwn @@ -0,0 +1,45 @@ +[[meta title="Plans for The Golden Bezoar"]] + +A workday with several Monkeysphere contributors on 2009-01-31 +resulted in a significant reorganization of the project in several +areas, primarily driven by the realization that there are two +fundamentally different concepts on the server side: + +* publishing host keys via the Web-of-Trust (WoT), and +* authenticating users via the WoT. + +For simplicity and clarity, those two concepts should be independent +from each other, but earlier releases of the Monkeysphere tangled the +two up together more than we probably should have. + +So the next release, version 0.23 (a.k.a. *The Golden Bezoar*) will +have the following significant changes: + +* __user interface__: `/usr/sbin/monkeysphere-server` is no more, and + its functionality will be split out into + `/usr/sbin/monkeysphere-host` (for functionality dealing with + publishing the ssh host key through the WoT) and + `/usr/sbin/monkeysphere-authentication` (for functionality dealing + with authenticating users via the + WoT). `/usr/bin/monkeysphere-ssh-proxycommand` has been folded into + `/usr/bin/monkeysphere` itself as a new subcommand. + +* __code__: the subfunctions are now stored in their own separate + files, and sourced as-needed by the three top-level commands. The + test suite has also been re-written to reflect the above UI changes. + +* __documentation__: in addition to making the man pages reflect the + above UI changes, we're rewriting the "getting started" + [documentation](/doc/) to use the conceptually-cleaner distinctions + above. + +* __data storage__: `/var/lib/monkeysphere` itself has been + re-organized with the aim of keeping the host/authentication + distinction clear, simplifying the internal use of `gpg`, and + facilitating privilege-separated access. + +*The Golden Bezoar* will also feature the ability to painlessly +publish your current ssh host key to the WoT without needing to re-key +the server. If you're considering adopting the Monkeysphere in the +near future, we recommend waiting for 0.23 to be released, as it +should be conceptually clearer and easier to use. -- cgit v1.2.3 From de36d3b27039141ba6402cb91a19a1d852185a92 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Wed, 4 Feb 2009 14:11:42 -0500 Subject: tests: making the temporary directory be created in a new place. make sure the proxy command used in the test is the new subcommand. --- tests/basic | 11 ++++------- tests/home/testuser/.ssh/proxy-command | 3 ++- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/basic b/tests/basic index 5c6b4bb..0cad727 100755 --- a/tests/basic +++ b/tests/basic @@ -89,12 +89,8 @@ trap failed_cleanup EXIT ## the tests, not system-wide: # make temp dir -TEMPDIR="$TESTDIR"/tmp -if [ -e "$TEMPDIR" ] ; then - echo "tempdir '$TEMPDIR' already exists." - exit 1 -fi -mkdir -p "$TEMPDIR" +mkdir -p "$TESTDIR"/tmp +TEMPDIR=$(mktemp -d ${TMPDIR:-"$TESTDIR"/tmp}/monkeyspheretest.XXXXXXX) # Use the local copy of executables first, instead of system ones. # This should help us test without installing. @@ -130,6 +126,7 @@ cp -a "$TESTDIR"/home/testuser "$TEMPDIR"/ # set up environment for testuser export TESTHOME="$TEMPDIR"/testuser export GNUPGHOME="$TESTHOME"/.gnupg +chmod 0700 "$GNUPGHOME" export SSH_ASKPASS="$TESTHOME"/.ssh/askpass export MONKEYSPHERE_HOME="$TESTHOME"/.monkeysphere cat <> "$TESTHOME"/.ssh/config @@ -236,7 +233,7 @@ gpgadmin --armor --export "$HOSTKEYID" | gpg --import # teach the "server" about the testuser's key echo "##################################################" echo "### export testuser key to server..." -gpg --export testuser | monkeysphere-authentication gpg-cmd --import +gpg --export testuser | monkeysphere-authentication expert gpg-cmd --import # update authorized_keys for user echo "##################################################" diff --git a/tests/home/testuser/.ssh/proxy-command b/tests/home/testuser/.ssh/proxy-command index 21c66fa..214cc23 100755 --- a/tests/home/testuser/.ssh/proxy-command +++ b/tests/home/testuser/.ssh/proxy-command @@ -3,6 +3,7 @@ # simple socket-based proxy-command wrapper for testing monkeysphere. # pass this thing the host, the port, and the socket. +which monkeysphere >&2 -monkeysphere-ssh-proxycommand --no-connect "$1" "$2" && \ +monkeysphere ssh-proxycommand --no-connect "$1" "$2" && \ exec socat STDIO UNIX:"$3" -- cgit v1.2.3 From 8eefc1b98f645d1462442cdb357bfcfe06a9c1e4 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Wed, 4 Feb 2009 15:03:25 -0500 Subject: tests/basic ensure that the directory is actually an absolute path, not a relative one. --- tests/basic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/basic b/tests/basic index 0cad727..455c057 100755 --- a/tests/basic +++ b/tests/basic @@ -90,7 +90,7 @@ trap failed_cleanup EXIT # make temp dir mkdir -p "$TESTDIR"/tmp -TEMPDIR=$(mktemp -d ${TMPDIR:-"$TESTDIR"/tmp}/monkeyspheretest.XXXXXXX) +TEMPDIR=$(mktemp -d ${TMPDIR:-$(cd "$TESTDIR" && printf "%s" $(pwd)/tmp)}/monkeyspheretest.XXXXXXX) # Use the local copy of executables first, instead of system ones. # This should help us test without installing. -- cgit v1.2.3 From f6b18f9a4ad203fd0e02bc7dab298246ffd4ea22 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Wed, 4 Feb 2009 15:19:58 -0500 Subject: set proper permissions on administrator gnupghome. --- tests/basic | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/basic b/tests/basic index 455c057..b0b5e9b 100755 --- a/tests/basic +++ b/tests/basic @@ -32,6 +32,7 @@ which socat >/dev/null || { echo "You must have socat installed to run this test # gpg command for test admin user gpgadmin() { + chmod 0700 "$TEMPDIR"/admin GNUPGHOME="$TEMPDIR"/admin/.gnupg gpg "$@" } -- cgit v1.2.3 From e7108ef5a8b136bea860f239ed1d2dc2110ff186 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Thu, 5 Feb 2009 14:10:16 -0500 Subject: updated man page for pem2openpgp. --- man/man1/pem2openpgp.1 | 72 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 65 insertions(+), 7 deletions(-) diff --git a/man/man1/pem2openpgp.1 b/man/man1/pem2openpgp.1 index 8ac230b..ae75b11 100644 --- a/man/man1/pem2openpgp.1 +++ b/man/man1/pem2openpgp.1 @@ -4,24 +4,82 @@ .Os .Sh NAME pem2openpgp -.Nd translate PEM encoded keys to OpenPGP keys +.Nd translate PEM-encoded RSA keys to OpenPGP certificates .Sh SYNOPSIS -.Nm pem2openpgp $USERID < mykey.pem +.Nm pem2openpgp "$USERID" < mykey.pem | gpg --import .Pp -.Nm ??? gpg --export $KEYID | openpgp2ssh $KEYID -.Pp -.Nm ????gpg --export-secret-key $KEYID | openpgp2ssh $KEYID +.Nm PEM2OPENPGP_EXPIRATION=$((86400 * $DAYS)) PEM2OPENPGP_USAGE_FLAGS=authentication,certify pem2openpgp "$USERID" . .Sh BUGS +Only handles RSA keys at the moment. It would be nice to handle DSA +keys as well. +.Pp +Currently only creates certificates with a single User ID. Should be +able to create certificates with multiple User IDs. +.Pp +Currently only accepts unencrypted RSA keys. It should be able to +deal with passphrase-locked key material. +.Pp +Currently outputs OpenPGP certificates with cleartext secret key +material. It would be good to be able to lock the output with a +passphrase. +.Pp +If you find other bugs, please report them at +https://labs.riseup.net/code/projects/show/monkeysphere .Sh SEE ALSO .Xr openpgp2ssh 1, .Xr monkeysphere 1 , .Xr monkeysphere 7 , .Xr ssh 1 , -.Xr monkeysphere-server 8 +.Xr monkeysphere-host 8 , +.Xr monkeysphere-authentication 8 -- cgit v1.2.3 From 5b27a01c0f34d12118bfee293ec5d2bc8a51c822 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Thu, 5 Feb 2009 14:11:04 -0500 Subject: pem2openpgp now supports generating the key as an alternative to reading it from stdin. --- src/keytrans/pem2openpgp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/keytrans/pem2openpgp b/src/keytrans/pem2openpgp index c765002..2631da6 100755 --- a/src/keytrans/pem2openpgp +++ b/src/keytrans/pem2openpgp @@ -347,13 +347,16 @@ sub fingerprint { return Digest::SHA1::sha1(pack('Cn', 0x99, length($rsabody)).$rsabody); } -# we're just not dealing with newline business right now. slurp in -# the whole file. -undef $/; -my $buf = ; - -my $rsa = Crypt::OpenSSL::RSA->new_private_key($buf); +my $rsa; +if (defined $ENV{PEM2OPENPGP_NEWKEY}) { + $rsa = Crypt::OpenSSL::RSA->generate_key($ENV{PEM2OPENPGP_NEWKEY}); +} else { + # we're just not dealing with newline business right now. slurp in + # the whole file. + undef $/; + $rsa = Crypt::OpenSSL::RSA->new_private_key(); +} $rsa->use_sha1_hash(); -- cgit v1.2.3 From 3e9fd04d34bed8a8c6b43bf111a8b8bbbbe8663f Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Thu, 5 Feb 2009 14:24:49 -0500 Subject: updated pem2openpgp invocation in m-h import-key --- src/share/mh/import_key | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/share/mh/import_key b/src/share/mh/import_key index 2e73a8c..93afb0a 100644 --- a/src/share/mh/import_key +++ b/src/share/mh/import_key @@ -17,7 +17,7 @@ local hostName local userID local fingerprint -# check for presense of secret key +# check for presence of secret key # FIXME: is this the proper test to be doing here? fingerprint_host_key >/dev/null \ && failure "An OpenPGP host key already exists." @@ -32,8 +32,7 @@ chmod 700 "$GNUPGHOME_HOST" log verbose "importing ssh key..." # translate ssh key to a private key -(umask 077 && \ - pem2openpgp "$userID" | gpg_host --import) +PEM2OPENPGP_USAGE_FLAGS=authenticate pem2openpgp "$userID" | gpg_host --import # find the key fingerprint of the newly converted key fingerprint=$(fingerprint_host_key) -- cgit v1.2.3 From 54d5b4d4dd11e432cec4506d1a1eae1d13eb7f0e Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Thu, 5 Feb 2009 14:29:42 -0500 Subject: restoring absolute paths to both TEMPDIR and TESTDIR in tests/basic. --- tests/basic | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/basic b/tests/basic index b0b5e9b..470fffa 100755 --- a/tests/basic +++ b/tests/basic @@ -17,7 +17,8 @@ set -e # piped commands should return the code of the first non-zero return set -o pipefail -export TESTDIR=$(dirname "$0") +# make sure the TESTDIR is an absolute path, not a relative one. +export TESTDIR=$(cd $(dirname "$0") && pwd) source "$TESTDIR"/common @@ -91,7 +92,7 @@ trap failed_cleanup EXIT # make temp dir mkdir -p "$TESTDIR"/tmp -TEMPDIR=$(mktemp -d ${TMPDIR:-$(cd "$TESTDIR" && printf "%s" $(pwd)/tmp)}/monkeyspheretest.XXXXXXX) +TEMPDIR=$(mktemp -d "${TMPDIR:-$TESTDIR/tmp}/monkeyspheretest.XXXXXXX)" # Use the local copy of executables first, instead of system ones. # This should help us test without installing. -- cgit v1.2.3 From 9aee235639e1475cd8aa476c7f2335b3c9ae9884 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Thu, 5 Feb 2009 15:16:05 -0500 Subject: m-a setup: take advantage of the new ability of pem2openpgp to generate its own key. --- src/share/ma/setup | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/share/ma/setup b/src/share/ma/setup index 422cfd3..034f047 100644 --- a/src/share/ma/setup +++ b/src/share/ma/setup @@ -53,17 +53,8 @@ EOF local CORE_UID=$(printf "Monkeysphere authentication trust core UID (random string: %s)" $(head -c21 Date: Thu, 5 Feb 2009 15:18:17 -0500 Subject: fixing dumb typo in tests/basic --- tests/basic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/basic b/tests/basic index 470fffa..8c995f5 100755 --- a/tests/basic +++ b/tests/basic @@ -92,7 +92,7 @@ trap failed_cleanup EXIT # make temp dir mkdir -p "$TESTDIR"/tmp -TEMPDIR=$(mktemp -d "${TMPDIR:-$TESTDIR/tmp}/monkeyspheretest.XXXXXXX)" +TEMPDIR=$(mktemp -d "${TMPDIR:-$TESTDIR/tmp}/monkeyspheretest.XXXXXXX") # Use the local copy of executables first, instead of system ones. # This should help us test without installing. -- cgit v1.2.3 From d1819306cb0b60068d41a2c0d09a6e5b81d8b143 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Thu, 5 Feb 2009 15:40:16 -0500 Subject: fixing out-of-date comments --- tests/basic | 2 +- tests/etc/monkeysphere/monkeysphere-authentication.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/basic b/tests/basic index 8c995f5..978f3d9 100755 --- a/tests/basic +++ b/tests/basic @@ -246,7 +246,7 @@ monkeysphere-authentication update-users $(whoami) ###################################################################### ### TESTS -# connect to test sshd, using monkeysphere-ssh-proxycommand to verify +# connect to test sshd, using monkeysphere ssh-proxycommand to verify # the identity before connection. This should work in both directions! echo "##################################################" echo "### ssh connection test for success..." diff --git a/tests/etc/monkeysphere/monkeysphere-authentication.conf b/tests/etc/monkeysphere/monkeysphere-authentication.conf index 9cc396f..b4ecc05 100644 --- a/tests/etc/monkeysphere/monkeysphere-authentication.conf +++ b/tests/etc/monkeysphere/monkeysphere-authentication.conf @@ -1,4 +1,4 @@ -# Base monkeysphere-server.conf for monkeysphere tests +# Base monkeysphere-authentication.conf for monkeysphere tests # AUTHORIZED_USER_IDS variable will be added dynamically during test. -- cgit v1.2.3 From 7485d66be9e4aebaf273b8b4082caa4c2404f6e7 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Thu, 5 Feb 2009 15:53:18 -0500 Subject: tests/basic created the wrong monkeysphere-authentication.conf --- tests/basic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/basic b/tests/basic index 978f3d9..d9399f0 100755 --- a/tests/basic +++ b/tests/basic @@ -206,7 +206,7 @@ echo "##################################################" echo "### setup monkeysphere authentication..." cp "$TESTDIR"/etc/monkeysphere/monkeysphere-authentication.conf "$TEMPDIR"/ cat <> "$TEMPDIR"/monkeysphere-authentication.conf -AUTHORIZED_USER_IDS="$MONKEYSPHERE_HOME/authentication/authorized_user_ids" +AUTHORIZED_USER_IDS="$MONKEYSPHERE_HOME/authorized_user_ids" EOF monkeysphere-authentication setup get_gpg_prng_arg >> "$MONKEYSPHERE_SYSDATADIR"/authentication/sphere/gpg.conf -- cgit v1.2.3