Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #78718

Python gnupg verification issue

From Martin Manns <mmanns@gmx.net>
Newsgroups comp.lang.python
Subject Python gnupg verification issue
Date 2014-10-05 17:56 +0200
Organization A noiseless patient Spider
Message-ID <20141005175633.1c76127f@Fuddel> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi

I have trouble with gnupg when verifying files with whitespace in the
filename using detached signatures.

Example:
I have two identical files "Hello_World.txt" and "Hello World.txt"
along with two externally generated signature files
"Hello_World.txt.sig" and "Hello World.txt.sig" (see attachments).

When verifying on the command line everything goes well:
----------
mn@Fuddel:~/tmp$ gpg --verify Hello\ World.txt.sig 
gpg: Signature made Sun 05 Oct 2014 04:57:25 PM CEST using DSA key ID
AE2EB31C gpg: Good signature from "xxx"
mn@Fuddel:~/tmp$ gpg --verify Hello_World.txt.sig 
gpg: Signature made Sun 05 Oct 2014 04:57:13 PM CEST using DSA key ID
AE2EB31C gpg: Good signature from "xxx"
----------

However, when using Python, the first file fails:
----------
>>> import os, gnupg
>>> hp = os.path.expanduser("~")+"/.gnupg"
>>> gpg = gnupg.GPG(gnupghome=hp)
>>> with open("Hello World.txt.sig", "rb") as sigfile:
...         verified = gpg.verify_file(sigfile, "Hello World.txt")
... 
>>> verified.valid
False

>>> with open("Hello_World.txt.sig", "rb") as sigfile:
...         verified = gpg.verify_file(sigfile, "Hello_World.txt")
... 
>>> verified.valid
True
----------

Should I use gnupg verification in a different way?
Should I file a bug report?


My system:
Debian unstable 32 bit
Python 2.7.8
gnupg 0.3.6


Regards

Martin

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Python gnupg verification issue Martin Manns <mmanns@gmx.net> - 2014-10-05 17:56 +0200

csiph-web