Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #78718
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Martin Manns <mmanns@gmx.net> |
| Newsgroups | comp.lang.python |
| Subject | Python gnupg verification issue |
| Date | Sun, 5 Oct 2014 17:56:33 +0200 |
| Organization | A noiseless patient Spider |
| Lines | 86 |
| Message-ID | <20141005175633.1c76127f@Fuddel> (permalink) |
| Mime-Version | 1.0 |
| Content-Type | multipart/mixed; boundary="MP_/9CU9eIpNxNAR/+snaMhtTJV" |
| Injection-Info | mx02.eternal-september.org; posting-host="e0fea61d5cf35c30ce6586add635ddc7"; logging-data="4238"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19LASEdrAuPqXAPDyKX3nRv" |
| X-Newsreader | Claws Mail 3.10.1 (GTK+ 2.24.24; i586-pc-linux-gnu) |
| Cancel-Lock | sha1:McqpcC4exw8c/Eki3SlmYBQ/fKI= |
| Xref | csiph.com comp.lang.python:78718 |
Show key headers only | 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
Python gnupg verification issue Martin Manns <mmanns@gmx.net> - 2014-10-05 17:56 +0200
csiph-web