Changeset 773

Show
Ignore:
Timestamp:
12/14/06 11:13:37 (2 years ago)
Author:
mfenniak
Message:

Fix bug where strings inside dicts were not being unencrypted properly.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • pypdf/trunk/pyPdf/pdf.py

    r771 r773  
    368368    def _decryptObject(self, obj, key): 
    369369        if isinstance(obj, StringObject): 
    370             #print len(obj), obj.encode("hex_codec") 
    371370            obj = StringObject(utils.RC4_encrypt(key, obj)) 
    372             #print len(obj), repr(obj) 
    373371        elif isinstance(obj, StreamObject): 
    374372            obj._data = utils.RC4_encrypt(key, obj._data) 
    375373        elif isinstance(obj, DictionaryObject): 
    376             for key, value in obj.items(): 
    377                 #if key == '/Author' or key == '/Producer': 
    378                 #    print repr(key), repr(value), repr(utils.RC4_encrypt(key, value)) 
    379                 obj[key] = self._decryptObject(value, key) 
     374            for dictkey, value in obj.items(): 
     375                obj[dictkey] = self._decryptObject(value, key) 
    380376        elif isinstance(obj, ArrayObject): 
    381377            for i in range(len(obj)):