From 6fd7d8e5e70665240c6c3b0a0a58e93734885843 Mon Sep 17 00:00:00 2001 From: rhatto Date: Mon, 9 Oct 2006 19:07:39 +0000 Subject: sendkey now send pgp/mime message --- firma | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) (limited to 'firma') diff --git a/firma b/firma index 32e0f03..30be641 100755 --- a/firma +++ b/firma @@ -945,6 +945,7 @@ function ListAdministration { #------------------------------------------------------------- local -i return_code=0 + local subscribers case $# in 1) @@ -976,7 +977,9 @@ function ListAdministration { ;; list) GetSubscribersList - echo $SUBSCRIBERS_LIST + for subscriber in $SUBSCRIBERS_LIST; do + echo " $subscriber" + done ;; subscribe) echo >&2 "$1: missing arguments (try \"subscribe help\")" @@ -1302,7 +1305,7 @@ function SubscribeUsers { help show this help stdin waits for key material from stdin file import pubkeys from file - keyserver [server-address] import from + keyserver [server-address] import from " elif [ "$1" == "stdin" ]; then echo "please paste the key material here, finninshing with Ctrl-D sequence..." @@ -1332,7 +1335,8 @@ function SubscribeUsers { else method="--recv-keys" fi - $GPG --keyserver $keyserver $method $2 + shift + $GPG --keyserver $keyserver $method $* return_code=$? else echo >&2 "subscribe: missing parameters: type subscribe help" @@ -1361,6 +1365,7 @@ function SendListPubkey { local key local keys local keyid + local random if [ "$1" == "help" ]; then echo "usage: sendkey [all|email|help]" @@ -1389,6 +1394,7 @@ function SendListPubkey { fi recipients="$key" + random="$RANDOM" # these are the headers of the message to be sent, so no indentation here MESSAGE_HEADERS="\ @@ -1396,13 +1402,24 @@ From: $LIST_ADDRESS Subject: List public key for $LIST_ADDRESS To: $recipients" - # this is the body of the message to be sent + # this is the body of the message to be sent, so no indentation here MESSAGE_BODY="`$GPG --armor --export $LIST_ADDRESS`" - MESSAGE_BODY="$( - echo -e "${PASSPHRASE}\n${MESSAGE_BODY}" | \ - $GPG_ENCRYPT --recipient $recipients - )" + MESSAGE_BODY=" +Content-Type: multipart/encrypted; protocol="application/pgp-encrypted"; boundary="$random" +--$random +Content-Type: application/pgp-encrypted +Content-Disposition: attachment + +Version: 1 + +--$random +Content-Type: application/octet-stream +Content-Disposition: inline; filename="msg.asc" + +$(echo -e "${PASSPHRASE}\n${MESSAGE_BODY}" | $GPG_ENCRYPT --recipient $recipients) + +--$random--" AssembleMessage @@ -1516,7 +1533,7 @@ FUNCTIONS=" LogMessage SubscribeUsers SendListPubkey - GetSubscriberInfo" + GetSubscribersInfo" for VAR in $GLOBAL_VARS; do declare $VAR -- cgit v1.2.3