# output the server fingerprint
fingerprint_server_key "=${userID}"
# find the key fingerprint of the server primary key
# output the server fingerprint
fingerprint_server_key "=${userID}"
# find the key fingerprint of the server primary key
- GNUPGHOME="$GNUPGHOME_HOST" gpg --export "$fingerprint" | \
- su --preserve-environment "$MONKEYSPHERE_USER" -c -- \
- "GNUPGHOME=$GNUPGHOME_AUTHENTICATION gpg --import"
+ gpg_host --export "$fingerprint" | gpg_authentication --import
- GNUPGHOME="$GNUPGHOME_AUTHENTICATION"
- su --preserve-environment "$MONKEYSPHERE_USER" -c -- \
- "gpg --keyserver $KEYSERVER --recv-key $keyID"
- if [ "$?" != 0 ] ; then
+ if ! su_monkeysphere_user "gpg --keyserver $KEYSERVER --recv-key $keyID" ; then
failure "Could not retrieve key '$keyID'."
fi
# move the key from the authentication keyring to the host keyring
failure "Could not retrieve key '$keyID'."
fi
# move the key from the authentication keyring to the host keyring
- GNUPGHOME="$GNUPGHOME_AUTHENTICATION"
- su --preserve-environment "$MONKEYSPHERE_USER" -c -- \
- "gpg --export $keyID" | \
- GNUPGHOME="$GNUPGHOME_HOST" gpg --import
+ gpg_authentication --export "$keyID" | gpg_host --import
# attach a "non-exportable" signature to the key
# this is required for the key to have any validity at all
# the 'y's on stdin indicates "yes, i really want to sign"
# attach a "non-exportable" signature to the key
# this is required for the key to have any validity at all
# the 'y's on stdin indicates "yes, i really want to sign"
# copy the host keyring into the authentication keyring
mv "$GNUPGHOME_AUTHENTICATION"/pubring.gpg{,.old}
cp "$GNUPGHOME_HOST"/pubring.gpg "$GNUPGHOME_AUTHENTICATION"/pubring.gpg
chown "$MONKEYSPHERE_USER" "$GNUPGHOME_AUTHENTICATION"/pubring.gpg
# copy the host keyring into the authentication keyring
mv "$GNUPGHOME_AUTHENTICATION"/pubring.gpg{,.old}
cp "$GNUPGHOME_HOST"/pubring.gpg "$GNUPGHOME_AUTHENTICATION"/pubring.gpg
chown "$MONKEYSPHERE_USER" "$GNUPGHOME_AUTHENTICATION"/pubring.gpg
- GNUPGHOME="$GNUPGHOME_AUTHENTICATION"
- su --preserve-environment "$MONKEYSPHERE_USER" -c -- \
- "gpg --import ${GNUPGHOME_AUTHENTICATION}/pubring.gpg.old"
+ gpg_authentication --import "$GNUPGHOME_AUTHENTICATION"/pubring.gpg.old
# index trustLevel by one to difference between level in ui and level
# internally
trustLevel=$((trustLevel+1))
# import new owner trust level for key
# index trustLevel by one to difference between level in ui and level
# internally
trustLevel=$((trustLevel+1))
# import new owner trust level for key