| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
The following custom exceptions are replaced with ValueError:
* Crypto.Util.PaddingError
* Crypto.PublicKey.KeyFormatError
The custom Crypto.Util.asn1.NoDerElementError is now private to the
module.
Some white spaces have been removed.
|
| |
|
|
|
| |
so that they call `Crypto.SelfTest.st_common.handle_fastmath_import_error`,
thereby eliminiating duplicate code.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
```
ext_suffix = get_config_var("EXT_SUFFIX") or get_config_var("SO")
```
because `get_config_var("SO")` returns None in Python 3.4.0a4 because the "SO"
variable is deprecated and "EXT_SUFFIX" is the new way to get this information
(see: http://bugs.python.org/issue19555)
This fixes `TypeError: Can't convert 'NoneType' object to str implicitly`
errors when running the tests on Python 3.4.0a4.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
[dlitz@dlitz.net: Re-ordered commits; so don't import S2V yet]
[dlitz@dlitz.net: Included an additional 'import *' change from the following commit:]
commit 4ec64d8eaaa4965889eb8e3b801fc77aa84e0a4e
Author: Legrandin <helderijs@gmail.com>
Date: Tue Sep 10 07:28:08 2013 +0200
Removed last references to ApiUsageError
[dlitz@dlitz.net: Removed unrelated whitespace changes]
|
| |
|
|
|
|
|
| |
[dlitz@dlitz.net: Whitespace changes extracted from the author's pull request:]
- [9c13f9c] Rename 'IV' parameter to 'nonce' for AEAD modes.
- [4ec64d8] Removed last references to ApiUsageError
- [ee46922] Removed most 'import *' statements
|
| |
|
|
|
|
|
|
| |
Under Python 3.2, unhexlify expects to receive a `bytes` object.
Passing it a (unicodr) `str` object causes it to raise the following
exception:
TypeError: 'str' does not support the buffer interface
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This patch adds methods importKey() to DSA module
and exportKey() to _DSAobj object.
Public and private keys can be imported/exported
in a variety of formats:
* DER vs PEM
* PKCS#8 vs OpenSSL vs OpenSSH/OpenSSL
* Encrypted vs clear
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| | |
|
| | |
|
| |
|
|
| |
Also add a test case for it.
|
| |
|
|
| |
RSA.exportKey claims to return a byte string, so really return one.
|
| |
|
|
|
|
|
|
| |
The test suite contains tests that are disabled because they have the same name
as other tests. Renaming them enables them again.
PKCS1_OAEP_Tests.testEncryptDecrypt1 is updated to work with the new interface
of PKCS1_OAEP.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Verify that Elgamal signature works with longs (it was disabled by
mistake).
|
| | |
|
| | |
|
| |
|
|
| |
in ElGamal code.
|
| |\ |
|
| | |
| |
| |
| | |
We work with bytes, not unicode.
|
| | | |
|
| | |
| |
| |
| |
| | |
- Use absolute imports
- Fix StringIO import so that 2to3 can translate it
|
| | |
| |
| |
| |
| |
| |
| |
| | |
one (BUG 702835).
Conflicts:
lib/Crypto/SelfTest/PublicKey/test_importKey.py
|
| |\ \
| |/ |
|
| | |
| |
| |
| | |
Doing the wraping later, at the point of use instead.
|
| | |
| |
| |
| |
| | |
o Add Ron Rivet DES test to test_DES.py
o Started on API documentation for 3.x
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | |
| |
| |
| | |
divmod(a,b)[0]; move to assertEqual throughout the test suite to prep for assert_ and failIf being removed in 3.3/3.4
|
| | |
| |
| |
| | |
Python 3.2b2
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
(as submitted here https://bugs.launchpad.net/pycrypto/+bug/544792)
so that they are available also in Python 2.1, 2.2, 2.3 and 2.4.
Regardless where the implementation comes from (Python standard
library or our native modules, depending on the Python version),
all Crypto.Hash objects are always used as front-ends.
|
| | |
| |
| |
| | |
FIX: Certain public exponents were not correctly exported in OpenSSH keys.
|
| | |
| |
| |
| | |
import and export.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
it (that is, because it helps a little the inversion step that follows).
|
| | |
| |
| |
| |
| |
| |
| |
| | |
Small fix to importKey documentation (ASN.1 structure names were
incorrect for public keys).
Factors of an RSA private key are computed from private exponent d
(both slowmath and fastmath).
|
| | | |
|
| | |
| |
| |
| | |
one (BUG 702835).
|
| |/
|
|
| |
performed on a single sub-package or module only.
|
| |
|
|
| |
This makes _slowmath behave the same as _fastmath in this regard.
|
| |
|
|
|
|
| |
This patch add support for older python 2.1/2.2 to the previous one (DER/PEM).
Committer: Legrandin <gooksankoo@hoiptorrow.mailexpire.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Typical usage for importing an RSA key:
f = file("ssl.pem")
key = RSA.importKey(f.read())
f.close()
key.verify(hash, signature)
Typical usage for exporting an RSA public key:
key = RSA.generate(512, randfunc)
f = file("ssl.der","w")
f.write(key.publickey.exportKey('DER'))
f.close()
I confirm I am eligible for submitting code to pycrypto according
to http://www.dlitz.net/software/pycrypto/submission-requirements/
fetched on 27 December 2009.
Committer: Legrandin <gooksankoo@hoiptorrow.mailexpire.com>
|
| | |
|