diff options
author | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2008-06-22 00:22:42 -0400 |
---|---|---|
committer | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2008-06-22 00:22:42 -0400 |
commit | c911568316173454e5286c7253dc88f3fb5679e5 (patch) | |
tree | 20998eadafce074aa46d78ef27e3134be7c0e534 /src/seckey2sshagent | |
parent | 4ae6630069f48d714115c18d6f9e1433f90673b6 (diff) | |
parent | d263f30d4fe03d1976ecd899ba2482cb870c2a4d (diff) |
Merge commit 'jrollins/master'
Diffstat (limited to 'src/seckey2sshagent')
-rwxr-xr-x | src/seckey2sshagent | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/src/seckey2sshagent b/src/seckey2sshagent index 4d08c66..1266db5 100755 --- a/src/seckey2sshagent +++ b/src/seckey2sshagent @@ -16,27 +16,37 @@ 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 <<EOF +# passwd +# $PASSWD +# \n +# \n +# \n +# yes +# save +# EOF +# ) +# echo -e "$cmd" | GNUPGHOME="$FOO" gpg --command-fd 0 --edit-key $GPGID -GNUPGHOME=$FOO gpg --edit-key $GPGID +GNUPGHOME="$FOO" gpg --edit-key $GPGID -ln -s /dev/stdin $FOO/monkeysphere-key +ln -s /dev/stdin "$FOO"/openpgp -GNUPGHOME=$FOO gpg --export-secret-key $GPGID | openpgp2ssh $GPGID | (cd $FOO && ssh-add -c monkeysphere-key) +GNUPGHOME="$FOO" gpg --export-secret-key $GPGID | \ + openpgp2ssh $GPGID | ssh-add -c "$FOO"/openpgp |