darcs

Issue 1156 darcs apply says pgp/gpg signed bundles are corrupt

Title darcs apply says pgp/gpg signed bundles are corrupt
Priority bug Status given-up
Milestone Resolved in
Superseder Nosy List darcs-devel, dmitry.kurochkin, kowey, thorkilnaur, twb
Assigned To
Topics UI

Created on 2008-10-23.04:30:25 by dagit, last changed 2017-07-30.23:21:45 by gh.

Files
File name Uploaded Type Edit Remove
refactor-to-make-the-env-variables-a-parameter.dpatch dagit, 2009-09-02.05:38:42 text/x-darcs-patch
split-tags_tags-target_.dpatch kowey, 2009-09-02.07:34:49 text/x-darcs-patch
Messages
msg6392 (view) Author: dagit Date: 2008-10-23.04:30:23
If you don't have gpg installed and you try to apply a gpg signed patch bundle
darcs will correctly tell you that the hash on the patch bundle is wrong. 
Actually, the problem is that you need to decrypt the bundle with gpg/pgp to
restore it to the original state.

It would be very nice if darcs told you that the bundle needs to be decrypted
instead of telling you it's corrupt!

Due to my ignorance about gpg bundles I've been getting "corrupt" bundles from
people for a while and I had absolutely no idea that it was gpg related.  I
think this shows that we could do stand to improve the error reporting here
substantially.

The easy quick fix is to have the current error message suggest trying gpg
--decrypt.  Another better solution would be to look for the signs that it was
gpg signed.
msg8530 (view) Author: kowey Date: 2009-08-27.09:00:27
I created a signed bundle with darcs send --sign and applied it just fine, no
complaints about hash failure.

Jason: perhaps you could attach an example?

Also: I'm not sure what you mean by "decrypt" here.  Presumably these are signed
and not encrypted bundles you're receiving.
msg8584 (view) Author: twb Date: 2009-08-29.06:46:26
On Wed, Oct 22, 2008 at 06:30:23PM +0000, Jason Dagit wrote:
> If you don't have gpg installed and you try to apply a gpg signed
> patch bundle darcs will [in]correctly tell you that the hash on the
> patch bundle is wrong.  Actually, the problem is that you need to
> decrypt the bundle with gpg/pgp to restore it to the original state.

I cannot reproduce this problem with Darcs 2.3.  A transcript follows.

    $ with-temp-dir
    with-temp-dir: entering directory `/tmp/with-temp-dir.SJqEIG'
    This directory will be deleted when you exit.
    $ map darcs init --repo -- R S
    $ date >R/f
    $ darcs rec --repo R -lam p f --author twb@cyber.com.au
    Recording changes in "f":

    Finished recording patch 'p'
    $ date >R/f
    $ darcs rec --repo R -lam q f --author twb@cyber.com.au
    Recording changes in "f":

    Finished recording patch 'q'
    $ darcs send --repo R S --sign --dont-edit -aobundle
    You need a passphrase [...]
    Wrote patch to /tmp/with-temp-dir.SJqEIG/bundle.
    $ fgrep -- '- -' bundle         # Does it have the escape?
    - -Sat Aug 29 16:25:37 EST 2009
    $ sudo dpkg --purge --force-all gnupg
    [...]
    $ gpg --help                    # Is gpg gone?
    bash: gpg: command not found
    $ darcs apply --repo R bundle   # So, do we get an error now?
    All these patches have already been applied.  Nothing to do.
    $ darcs apply --repo S bundle
    Finished applying...
    $
msg8627 (view) Author: dagit Date: 2009-09-02.05:38:42
I'm attaching a patch that is problematic.  I believe the error message used to
be more cryptic than the current one.

The error I get now trying to apply it is:
$ darcs apply ~/Downloads/refactor-to-make-the-env-variables-a-parameter.dpatch
darcs failed:  Malformed patch bundle: '{' is not 'Context:'


Followed by a dump of the patch.
Attachments
msg8628 (view) Author: dagit Date: 2009-09-02.05:42:01
I tried running:
gpg2 --decrypt refactor-to-make-the-env-variables-a-parameter.dpatch >
refactor.dpatch

And darcs is giving me the same error that it gave me previously, but it did
strip out the extra '-' on starts of some lines.
msg8632 (view) Author: kowey Date: 2009-09-02.07:34:49
OK: Attached is a bundle which does appear to work.  

One difference I noticed is the Hash: SHA1 in the working bundle vs the Hash:
SHA512 in the one that darcs dislikes.

I think that's our first clue.  Could somebody go study the parsing of patch
bundles?
Attachments
History
Date User Action Args
2008-10-23 04:30:25dagitcreate
2009-08-10 23:48:47adminsetnosy: - dagit
2009-08-25 17:31:45adminsetnosy: + darcs-devel, - simon
2009-08-27 09:00:31koweysetstatus: needs-reproduction -> waiting-for
title: darcs apply should complain about pgp/gpg signed bundles -> darcs apply says pgp/gpg signed bundles are corrupt
nosy: + dagit
messages: + msg8530
topic: + UI
assignedto: dagit
2009-08-27 14:34:07adminsetnosy: kowey, darcs-devel, dagit, thorkilnaur, dmitry.kurochkin
2009-08-29 06:46:29twbsetnosy: + twb
messages: + msg8584
2009-09-02 05:38:45dagitsetfiles: + refactor-to-make-the-env-variables-a-parameter.dpatch
nosy: kowey, darcs-devel, dagit, twb, thorkilnaur, dmitry.kurochkin
messages: + msg8627
2009-09-02 05:42:02dagitsetnosy: kowey, darcs-devel, dagit, twb, thorkilnaur, dmitry.kurochkin
messages: + msg8628
2009-09-02 05:43:29dagitsetnosy: kowey, darcs-devel, dagit, twb, thorkilnaur, dmitry.kurochkin
assignedto: dagit ->
2009-09-02 07:34:51koweysetstatus: waiting-for -> needs-reproduction
nosy: kowey, darcs-devel, dagit, twb, thorkilnaur, dmitry.kurochkin
messages: + msg8632
files: + split-tags_tags-target_.dpatch
2009-09-29 06:44:59dagitsetnosy: - dagit
2017-07-30 23:21:45ghsetstatus: needs-reproduction -> given-up