diff options
author | drebs <drebs@leap.se> | 2014-07-29 16:09:48 -0300 |
---|---|---|
committer | drebs <drebs@leap.se> | 2014-07-29 16:09:48 -0300 |
commit | 0c6348fc64adbbe0a2dc55eb408186ec92bbc7c4 (patch) | |
tree | 6e7119a0d160f649ad22ca5b4757da866fb1d05c /src/leap/keymanager/openpgp.py | |
parent | bc1d3adfc408085b0fbc8f09c930a68b42e4c46a (diff) | |
parent | b05c3f0020ab4ca4761cc1042e55cc37b007d297 (diff) |
Merge branch 'bug/tests-dont-pass' into develop
Diffstat (limited to 'src/leap/keymanager/openpgp.py')
-rw-r--r-- | src/leap/keymanager/openpgp.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/leap/keymanager/openpgp.py b/src/leap/keymanager/openpgp.py index 950d022c..46ae2aab 100644 --- a/src/leap/keymanager/openpgp.py +++ b/src/leap/keymanager/openpgp.py @@ -649,13 +649,17 @@ class OpenPGPScheme(EncryptionScheme): result = gpg.verify(data) else: # to verify using a detached sig we have to use - # gpg.verify_file(), which receives the data as a binary - # stream and the name of a file containing the signature. + # gpg.verify_file(), which receives the name of + # files containing the date and the signature. sf, sfname = tempfile.mkstemp() with os.fdopen(sf, 'w') as sfd: sfd.write(detached_sig) - with closing(_make_binary_stream(data, gpg._encoding)) as df: - result = gpg.verify_file(df, sig_file=sfname) + df, dfname = tempfile.mkstemp() + with os.fdopen(df, 'w') as sdd: + sdd.write(data) + result = gpg.verify_file(dfname, sig_file=sfname) + os.unlink(sfname) + os.unlink(dfname) gpgpubkey = gpg.list_keys().pop() valid = result.valid rfprint = result.fingerprint |