summaryrefslogtreecommitdiff
path: root/lib/Crypto/Util/py3compat.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix tobytes() broken by previous commit.Dwayne Litzenberger2014-06-221-16/+9
| | | | Python 2.1 str objects don't have a .decode() method.
* Get rid of catch-all exceptions. LP#1178485.Richard Mitchell2014-06-221-1/+1
|
* Added support for PKCS#8-encrypted private keys.Legrandin2013-07-141-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch contains the following changes: - Private RSA keys can be imported/exported in encrypted form, protected according to PKCS#8 and: * PBKDF2WithHMAC-SHA1AndDES-EDE3-CBC. * PBKDF2WithHMAC-SHA1AndAES128-CBC * PBKDF2WithHMAC-SHA1AndAES192-CBC * PBKDF2WithHMAC-SHA1AndAES256-CBC In addition to that, it is possible to import keys i the following weak formats: * pbeWithMD5AndDES-CBC * pbeWithSHA1AndRC2-CBC * pbeWithMD5AndRC2-CBC * pbeWithSHA1AndDES-CBC - The following new module (and 1 new package) are added: * Crypto.Util.Padding for simple padding/unpadding logic * Crypto.IO._PBES for PBE-related PKCS#5 logic * Crypto.IO.PEM for PEM wrapping/unwrapping * Crypto.IO.PKCS8 for PKCS#8 wrapping/unwrapping - All Object ID (OIDs) are now in dotted form to increase readability. - Add AES support to PEM format (decode only). The PEM module can decrypt messages protected with AES-CBC. - Update RSA import test cases. - Updated to PKCS8 test cases
* Refactoring of the asn1 moduleLegrandin2013-07-141-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following changes are included: - Decoding is a much simpler operation. The internal logic is based on stream of binary data, and not on string indexing anymore. Additionally, decoding used to look like this: bitmap = DerObject() bitmap.decode(input_buffer, True) if bitmap.isType('BIT STRING'): ... proceed with parsing ... else: ... error ... Whereas now, it is cleaner and more compact: bitmap = DerBitString() bitmap.decode(input_buffer) Any error condition will lead to an exception. - isType() method has been removed because of the above. - Added examples and documentation - Added support IMPLICIT tags - Added support for negative INTEGERs - Added DerSetOf ASN.1 class - DerObjectID can be initialized from the dotted representation of the Object ID. - DerBitString has a new member 'value' to hold the binary string. The member 'payload' should not be accessed anymore. - DerObjectID has a new member 'value' to hold the dotted representation of the Object ID string. The member 'payload' should not be accessed anymore. - Added operator += to DER SEQUENCE. Now it is possible to do: my_str = DerOctetString(b'ZYZ') seq = DerSequence() seq += 0 seq += my_str.encode() - Update to test cases
* Added description of what string helper functions in py3compat.py do.Legrandin2011-12-221-0/+33
|
* Further fixed for python 3Legrandin2011-10-191-5/+9
|
* Merged from upstream (py3k support) and modified so that all unit tests pass.Legrandin2011-10-181-0/+16
|
* Add Ron Rivet TestThorsten Behrens2010-12-301-0/+0
| | | | | o Add Ron Rivet DES test to test_DES.py o Started on API documentation for 3.x
* PY3K _fastmath supportThorsten Behrens2010-12-291-1/+1
| | | | | | | | | | | | | | o _fastmath now builds and runs on PY3K o Changes to setup.py to allow /usr/include for gmp.h o Changes to setup.py to allow linking fastmath w/ static mpir on Windows without warning messages o Changes to test_DSA/test_RSA to throw an exception if _fastmath is present but cannot be imported (due to an issue building _fastmath or the shared gmp/mpir libraries not being reachable) o number.py has the code to flag a failing _fastmath, but that code is commented out for a better runtime experience o Clean up the if for py21compat import - should have been == not is o Clean up some '== None' occurences, now 'is None' instead
* Changes to allow pycrpyto to work on Python 3.x as well as 2.1 through 2.7Thorsten Behrens2010-12-281-0/+54