From 363b8d8cb785c25937460b552fefde5fbccfb6ba Mon Sep 17 00:00:00 2001 From: Jameson Graef Rollins Date: Tue, 17 Jun 2008 14:35:06 -0400 Subject: Add preliminary script to try to import a gpg private key into the ssh agent. --- src/seckey2sshagent | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 src/seckey2sshagent (limited to 'src/seckey2sshagent') diff --git a/src/seckey2sshagent b/src/seckey2sshagent new file mode 100755 index 0000000..0e8d695 --- /dev/null +++ b/src/seckey2sshagent @@ -0,0 +1,25 @@ +#!/bin/sh + +cleanup() { + echo -n "removing temp gpg home... " + rm -rf $FOO + echo "done." +} + +trap cleanup EXIT + +GPGID="$1" + +idchars=$(echo $GPGID | wc -m) +if [ "$idchars" -ne 17 ] ; then + echo "GPGID is not 16 characters ($idchars)." + exit 1 +fi + +FOO=$(mktemp -d) + +gpg --export-secret-key --export-options export-reset-subkey-passwd $GPGID | GNUPGHOME=$FOO gpg --import + +GNUPGHOME=$FOO gpg --edit-key $GPGID + +GNUPGHOME=$FOO gpg --export-secret-key $GPGID | openpgp2ssh $GPGID | ssh-add -c /dev/stdin -- cgit v1.2.3 From fe0e35fa72edb5bbb9e2026b8e5c920a5c3f6a86 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Thu, 19 Jun 2008 15:28:16 -0400 Subject: added comments to seckey2sshagent. --- src/seckey2sshagent | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/seckey2sshagent') diff --git a/src/seckey2sshagent b/src/seckey2sshagent index 0e8d695..d8e9b79 100755 --- a/src/seckey2sshagent +++ b/src/seckey2sshagent @@ -1,5 +1,20 @@ #!/bin/sh +# seckey2sshagent: this is a hack of a script to cope with the fact +# that openpgp2ssh currently cannot support encrypted secret keys. + +# the basic operating principal is: + +# export the secret key in encrypted format to a new keyring + +# remove the passphrase in that keyring + +# use that keyring with openpgp2ssh + +# Authors: Daniel Kahn Gillmor , +# Jameson Rollins + + cleanup() { echo -n "removing temp gpg home... " rm -rf $FOO -- cgit v1.2.3