Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 851395 Details for
Bug 1030710
Review Request: python-pgpdump - PGP packet parser library in Python
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
python-pgpdump patch for Python 2.6
python-pgpdump-1.4.el6.patch (text/plain), 3.24 KB, created by
Avram Lubkin
on 2014-01-17 04:47:28 UTC
(
hide
)
Description:
python-pgpdump patch for Python 2.6
Filename:
MIME Type:
Creator:
Avram Lubkin
Created:
2014-01-17 04:47:28 UTC
Size:
3.24 KB
patch
obsolete
>diff -ru python-pgpdump-1.4.orig/pgpdump/packet.py python-pgpdump-1.4/pgpdump/packet.py >--- python-pgpdump-1.4.orig/pgpdump/packet.py 2012-10-22 11:14:03.000000000 -0400 >+++ python-pgpdump-1.4/pgpdump/packet.py 2014-01-16 17:05:47.831757283 -0500 >@@ -4,7 +4,7 @@ > from warnings import warn > > from .utils import (PgpdumpException, get_int2, get_int4, get_mpi, >- get_key_id, get_int_bytes) >+ get_key_id, get_int_bytes, pack_data) > > > class Packet(object): >@@ -383,8 +383,8 @@ > elif self.pubkey_version == 4: > sha1 = hashlib.sha1() > seed_bytes = (0x99, (self.length >> 8) & 0xff, self.length & 0xff) >- sha1.update(bytearray(seed_bytes)) >- sha1.update(self.data) >+ sha1.update(pack_data(seed_bytes)) >+ sha1.update(pack_data(self.data)) > self.fingerprint = sha1.hexdigest().upper().encode('ascii') > self.key_id = self.fingerprint[24:] > >@@ -620,7 +620,7 @@ > user_re = re.compile(r'^([^<]+)? ?<([^>]*)>?') > > def parse(self): >- self.user = self.data.decode('utf8', errors='replace') >+ self.user = self.data.decode() > matches = self.user_re.match(self.user) > if matches: > if matches.group(1): >diff -ru python-pgpdump-1.4.orig/pgpdump/test.py python-pgpdump-1.4/pgpdump/test.py >--- python-pgpdump-1.4.orig/pgpdump/test.py 2012-10-22 11:14:03.000000000 -0400 >+++ python-pgpdump-1.4/pgpdump/test.py 2014-01-16 15:52:58.000000000 -0500 >@@ -104,19 +104,23 @@ > data = fileobj.read() > return data > >+ def assertIsNotNone(self, x): >+ return bool(x is not None) >+ >+ def assertIsNone(self, x): >+ return bool(x is None) >+ >+ > > class ParseTestCase(TestCase, Helper): > def test_parse_empty(self): >- with self.assertRaises(PgpdumpException): >- BinaryData(None) >+ self.assertRaises(PgpdumpException, BinaryData, None) > > def test_parse_short(self): >- with self.assertRaises(PgpdumpException): >- BinaryData([0x00]) >+ self.assertRaises(PgpdumpException, BinaryData, [0x00]) > > def test_parse_invalid(self): >- with self.assertRaises(PgpdumpException): >- BinaryData([0x00, 0x00]) >+ self.assertRaises(PgpdumpException, BinaryData, [0x00, 0x00]) > > def test_parse_single_sig_packet(self): > base64_sig = b"iEYEABECAAYFAk6A4a4ACgkQXC5GoPU6du1ATACgodGyQne3Rb7"\ >diff -ru python-pgpdump-1.4.orig/pgpdump/utils.py python-pgpdump-1.4/pgpdump/utils.py >--- python-pgpdump-1.4.orig/pgpdump/utils.py 2012-10-22 11:14:03.000000000 -0400 >+++ python-pgpdump-1.4/pgpdump/utils.py 2014-01-16 16:58:00.395248375 -0500 >@@ -1,5 +1,5 @@ > import binascii >- >+import struct > > class PgpdumpException(Exception): > '''Base exception class raised by any parsing errors, etc.''' >@@ -99,11 +99,14 @@ > offset += to_process > return mpi, offset > >+def pack_data(data): >+ '''Pack iterable of binary data into a string.''' >+ return struct.pack('%dB' % len(data), *data) > > def get_key_id(data, offset): > '''Pull eight bytes from data at offset and return as a 16-byte hex-encoded > string.''' >- key_id = binascii.hexlify(data[offset:offset + 8]) >+ key_id = binascii.hexlify(bytes(data[offset:offset + 8])) > return key_id.upper() > >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1030710
: 851395 |
851396