X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=src%2Fseckey2sshagent;h=1266db5b329987af795f1b6ea286a33f27eb5691;hb=0f1c6ac9c3c18a46720a8b96854a6624f3a1b8df;hp=0e8d69526a360fa7710d753d3d93d8928e7b1175;hpb=363b8d8cb785c25937460b552fefde5fbccfb6ba;p=monkeysphere.git diff --git a/src/seckey2sshagent b/src/seckey2sshagent index 0e8d695..1266db5 100755 --- a/src/seckey2sshagent +++ b/src/seckey2sshagent @@ -1,25 +1,52 @@ #!/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... " + echo -n "removing temp gpg home... " 1>&2 rm -rf $FOO - echo "done." + echo "done." 1>&2 } 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 +#GPGID="$1" +GPGID=$(echo "$1" | cut -c 25-) FOO=$(mktemp -d) -gpg --export-secret-key --export-options export-reset-subkey-passwd $GPGID | GNUPGHOME=$FOO gpg --import +gpg --export-secret-key $GPGID | GNUPGHOME="$FOO" gpg --import + +# idea to script the password stuff. not working. +# read -s -p "enter gpg password: " PASSWD; echo +# cmd=$(cat <