aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@localhost>2013-02-14 00:00:00 +0000
committerroot <root@localhost>2013-02-14 00:00:00 +0000
commit192befdb62bed177fc81db2f14246294e6ad9e0c (patch)
treee5d62116bf12756ae40db4bcef3602c94047ea10
parentb1f7d3ec225f5e89766be53318e56c39b39196ba (diff)
downloadgit-remote-gcrypt-192befdb62bed177fc81db2f14246294e6ad9e0c.zip
git-remote-gcrypt-192befdb62bed177fc81db2f14246294e6ad9e0c.tar.gz
git-remote-gcrypt-192befdb62bed177fc81db2f14246294e6ad9e0c.tar.bz2
Request signature on manifest before uploading pack
Just to ensure that the user signs the push before we upload any files (pack or manifest) to the remote.
-rwxr-xr-xgit-remote-gcrypt19
1 files changed, 11 insertions, 8 deletions
diff --git a/git-remote-gcrypt b/git-remote-gcrypt
index 89308c7..3fdb932 100755
--- a/git-remote-gcrypt
+++ b/git-remote-gcrypt
@@ -458,7 +458,7 @@ do_push()
make_new_repo
fi
- trap 'rm -f "$TmpPack_Encrypted" "$TmpObjlist"' EXIT
+ trap 'rm -f "$TmpPack_Encrypted" "$TmpObjlist" "$TmpManifest_Enc"' EXIT
if isnonnull "$Branchlist"
then
# filter through batch-check to mark only the commits we have
@@ -499,24 +499,27 @@ EOF
then
pack_id=$(pack_hash < "$TmpPack_Encrypted")
Packlist=$(append "$Packlist" "$Packpfx$pack_id $key_")
- PUT "$URL" "$pack_id" "$TmpPack_Encrypted"
fi
- rm -f "$TmpPack_Encrypted"
- rm -f "$TmpObjlist"
- trap - EXIT
-
- # Update manifest
+ # Generate manifest
echo_info "Encrypting manifest to \"$Recipients\""
echo_info "Requesting manifest signature"
TmpManifest_Enc="$Localdir/manifest.$$"
- trap 'rm -f "$TmpManifest_Enc"' EXIT
(xecho "$Branchlist"; xecho "$Packlist";
repoidstr; xecho "$Extension_list") |
PRIVENCRYPT "$Recipients" > "$TmpManifest_Enc"
+ # Upload pack
+ if [ -s "$TmpObjlist" ]
+ then
+ PUT "$URL" "$pack_id" "$TmpPack_Encrypted"
+ fi
+ rm -f "$TmpPack_Encrypted"
+ rm -f "$TmpObjlist"
+
+ # Upload manifest
PUT "$URL" "$Repoid" "$TmpManifest_Enc"
PUT_FINAL "$URL"