| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
|
|
|
|
| |
Many years ago, this was removed from block_template, but not from
stream_template.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The `disable_shortcut` option served as a workaround in case
`__PCT_CTR_SHORTCUT__` leaked through a wrapper object, but I don't
think anyone actually used it, and it was a bad idea to expose it as
part of the public API.
Now that we do strong type checking inside block_template.c, there
shoujld be no need to ever use this option. It's now a no-op, retained
for backward compatibility only. It will be removed in some future
version of PyCrypto.
|
|
|
|
|
|
|
|
|
| |
The leak arose from the string creation in this line:
PyObject_HasAttr(counter, PyUnicode_FromString("__PCT_CTR_SHORTCUT__"))
This commit replaces the __PCT_CTR_SHORTCUT__ hack with code that
imports the _counter module and checks the appropriate types.
|
|
|
|
|
| |
- METH_NOARGS was introduced in Python 2.2.
- Python 2.1 doesn't have True and False builtins.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This should fix compilation on HP-UX 11.31. Thanks Adam Woodbeck for
reporting this.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The pure Python wrappers around Crypto.Hash.* were convenient, but they
slowed down hash initialization by 4-7x.
There is a speed trade-off here: The MD5 and SHA1 objects are just
wrapped hashlib objects (or old-style md5/sha objects). To maintain API
compatibility with the rest of PyCrypto, we still have to wrap them, so
they're slower to initialize than the rest of the hash functions. If
hashlib ever adds a .new() method, we will automatically use hashlib
directly and gain the initialization speed-up.
|
|
|
|
|
|
|
|
|
|
|
|
| |
In PyCrypto v2.5, the "oid" attribute was added to hash objects. In
retrospect, this was not a good idea, since the OID is not really a
property of the hash algorithm, it's a protocol-specific identifer for
the hash functions. PKCS#1 v1.5 uses it, but other protocols (e.g.
OpenPGP, DNSSEC, SSH, etc.) use different identifiers, and it doesn't make
sense to add these to Crypto.Hash.* every time a new algorithm is added.
This also has the benefit of being compatible with the Python standard
library's "hashlib" objects, which also have a name attribute.
|
| |
|
|
|
|
| |
The solution is to include Python.h before string.h is included.
|
|
|
|
|
|
|
| |
Fix leaks in getRandomInteger and rsaKeyNew. If randfunc throws an exception
they both don't clean up properly.
Thanks to Andreas Stührk for helping me to debug these two leaks.
|
|
|
|
|
|
| |
Exporting symbols can cause symbol conflicts with external libraries,
causing the dynamic linker to silently pick one of the implementations,
which can lead to subtle bugs if they're actually different functions.
|
| |
|
|
|
|
|
| |
"long int" is equivalent to "long" in C, and it's harder to misread it as
"int" this way.
|
|
|
|
| |
This should never happen, but the behaviour is saner if it does.
|
| |
|
| |
|
|
|
|
|
| |
rabinMillerTest returns an int but getStrongPrime stores the result in an
unsigned long int which makes the tests in line 1545 and 1621 useless.
|
|
|
|
| |
Bug report: https://bugs.launchpad.net/pycrypto/+bug/997464
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
A new module (blockalgo) has been added. It contains a class (BlockAlgo)
all ciphers derive from. The only purpose of such base class
is to centralize all general documentation applicable to all block
ciphers (e.g. modes) into a single file.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
When _fastmath is present, the following code caused the Python interpreter
to abort with a fatal error:
from Crypto.Util.number import isPrime
isPrime(1) # Fatal Python error: PyEval_SaveThread: NULL tstate
Bug report: https://bugs.launchpad.net/pycrypto/+bug/988431
|
|
|
|
|
|
|
| |
This should never happen, but we're already checking that Crypto.Random.new is
callable, so we might as well also check that Crypto.Random.new exists. Also,
fixing this should silence an (arguably false-positive) error emitted by
cpychecker (a static analysis tool used by the Fedora project).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These bugs are likely only triggered during out-of-memory conditions. The bug
report is at:
https://bugs.launchpad.net/pycrypto/+bug/934294
These were found by Dave Malcolm's experimental static analysis tool:
http://fedorapeople.org/~dmalcolm/gcc-python-plugin/2012-02-14/python-crypto-2.5-1.fc17/
See also:
https://fedorahosted.org/gcc-python-plugin/
http://gcc-python-plugin.readthedocs.org/en/latest/cpychecker.html
|
| |
|
| |
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
We use <sys/inttypes.h> on Solaris platforms that don't have <stdint.h>.
This should fix https://bugs.launchpad.net/pycrypto/+bug/518871, reported by
Sebastian Kayser.
|
| | |
|
| |\
| | |
| | |
| | |
| | |
| | | |
Conflicts:
setup.py
src/_fastmath.c
|
| | |
| | |
| | |
| | | |
(libgmp 5 or later)
|
| |\ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
functions.
Update documentation with Python 3.x notes.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|