summaryrefslogtreecommitdiffstats
path: root/Modules/_hashopenssl.c
Commit message (Collapse)AuthorAgeFilesLines
* [3.8] bpo-40515: Require OPENSSL_THREADS (GH-19953) (GH-20119)Christian Heimes2020-05-151-0/+4
|
* bpo-38684: haslib: fix build when Blake2 not enabled in OpenSSL (GH-17043)Miss Islington (bot)2019-11-061-1/+1
| | | | | (cherry picked from commit 6552563b3d5061816720a5a6c7d4ffd6ba35b98b) Co-authored-by: Alexandru Ardelean <ardeleanalex@gmail.com>
* [3.8] bpo-38270: More fixes for strict crypto policy (GH-16418) (#16437)Christian Heimes2019-09-301-1/+1
| | | | | | | | | | | | | | | | test_hmac and test_hashlib test built-in hashing implementations and OpenSSL-based hashing implementations. Add more checks to skip OpenSSL implementations when a strict crypto policy is active. Use EVP_DigestInit_ex() instead of EVP_DigestInit() to initialize the EVP context. The EVP_DigestInit() function clears alls flags and breaks usedforsecurity flag again. Signed-off-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue38270. (cherry picked from commit 90558158093c0ad893102158fd3c2dd9f864e82e) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-33936: Don't call obsolete init methods with OpenSSL 1.1.0+ (GH-16140)Miss Islington (bot)2019-09-161-1/+1
| | | | | | | | ``OPENSSL_VERSION_1_1`` was never defined in ``_hashopenssl.c``. https://bugs.python.org/issue33936 (cherry picked from commit 724f1a57231f9287c37255adf0e4364d12cf693d) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-38153: detect shake independently from sha3 (GH-16143)Miss Islington (bot)2019-09-161-2/+11
| | | | | | | | XOF digests (SHAKE) are not available in OpenSSL 1.1.0 but SHA3 fixed-length digests are. Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit eb2b0c694aef6122fdf95015abb24e0d095b6401) Co-authored-by: Christian Heimes <christian@python.org>
* [3.8] bpo-38153: Normalize hashlib algorithm names (GH-16083) (GH-16144)Christian Heimes2019-09-161-21/+146
| | | | | | Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit 995b5d38e7cc24cac3de8dfd516115f86b0bcf80) Co-authored-by: Christian Heimes <christian@python.org>
* [3.8] bpo-37206: Unrepresentable default values no longer represented as ↵Serhiy Storchaka2019-09-141-2/+2
| | | | | | | | | | None. (GH-13933) (GH-16141) In ArgumentClinic, value "NULL" should now be used only for unrepresentable default values (like in the optional third parameter of getattr). "None" should be used if None is accepted as argument and passing None has the same effect as not passing the argument at all. (cherry picked from commit 279f44678c8b84a183f9eeb85e0b086228154497) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.8] bpo-38137: Re-add OpenSSL 1.0.2 compat (GH-16051) (GH-16057)Stéphane Wirtel2019-09-121-0/+6
| | | | | | | | | | | | | | | | | The defines are required for OpenSSL 1.0.2 and LibreSSL. https://bugs.python.org/issue38134 Automerge-Triggered-By: @tiran (cherry picked from commit 9a4963b932a087b78596cca0b8394ac898faa490) Co-authored-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue38137 Automerge-Triggered-By: @matrixise
* bpo-38132: Check EVP_DigestUpdate for error (GH-16041)Miss Islington (bot)2019-09-121-6/+16
| | | | | (cherry picked from commit 8c74574e0aaf1a00719fbc9acbdc27a3923520aa) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-38132: Simplify _hashopenssl code (GH-16023) (#16040)Miss Islington (bot)2019-09-121-121/+162
| | | | | | Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit 5a4f82f457049b5b07b6fba4ca42bc1ecf597976) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-38134: Remove PKBDF2_HMAC_fast from _hashopenssl (GH-16028)Miss Islington (bot)2019-09-121-114/+0
| | | | | | Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit 64117e059b79236c7345bc9afc1cc707162411de) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async ↵Jeroen Demeyer2019-05-311-2/+2
| | | | | | | | | (GH-13464) Automatically replace tp_print -> tp_vectorcall_offset tp_compare -> tp_as_async tp_reserved -> tp_as_async
* bpo-36209: Fix typo on hashlib error message (GH-12194)Emmanuel Arias2019-03-061-1/+1
|
* bpo-36179: Fix ref leaks in _hashopenssl (GH-12158)Christian Heimes2019-03-041-5/+7
| | | | | | | | | | Fix two unlikely reference leaks in _hashopenssl. The leaks only occur in out-of-memory cases. Thanks to Charalampos Stratakis. Signed-off-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue36179
* Dead code removal from _hashopenssl. (GH-11379)Gregory P. Smith2018-12-311-80/+18
| | | | HASH_OBJ_CONSTRUCTOR has always been defined as 0 since I created hashlib in Python 2.5. Delete all code associated with it.
* bpo-20182: AC convert remaining functions/methods in _hashopenssl.c (GH-9213)Tal Einat2018-12-271-99/+109
|
* bpo-33012: Fix invalid function cast warnings with gcc 8. (GH-6749)Serhiy Storchaka2018-11-271-3/+3
| | | | | | Fix invalid function cast warnings with gcc 8 for method conventions different from METH_NOARGS, METH_O and METH_VARARGS excluding Argument Clinic generated code.
* bpo-20216: Correct docstrings of digest() methods in hashlib. (GH-9873)Srinivas Thatiparthy (శ్రీనివాస్ తాటిపర్తి)2018-10-191-1/+1
|
* closes bpo-34646: Remove PyAPI_* macros from declarations. (GH-9218)Benjamin Peterson2018-09-121-1/+1
|
* bpo-33729: Fix issues with arguments parsing in hashlib. (GH-8346)Serhiy Storchaka2018-07-311-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | * help(hashlib) didn't work because of incorrect module name in blake2b and blake2s classes. * Constructors blake2*(), sha3_*(), shake_*() and keccak_*() incorrectly accepted keyword argument "string" for binary data, but documented as accepting the "data" keyword argument. Now this parameter is positional-only. * Keyword-only parameters in blake2b() and blake2s() were not documented as keyword-only. * Default value for some parameters of blake2b() and blake2s() was None, which is not acceptable value. * The length argument for shake_*.digest() was wrapped out to 32 bits. * The argument for shake_128.digest() and shake_128.hexdigest() was not positional-only as intended. * TypeError messages for incorrect arguments in all constructors sha3_*(), shake_*() and keccak_*() incorrectly referred to sha3_224. Also made the following enhancements: * More accurately specified input and result types for strings, bytes and bytes-like objects. * Unified positional parameter names for update() and constructors. * Improved formatting.
* bpo-31787: Prevent refleaks when calling __init__() more than once (GH-3995)Oren Milman2018-02-131-2/+2
|
* bpo-32746: Fix multiple typos (GH-5144)Leo Arias2018-02-041-1/+1
| | | Fix typos found by codespell in docs, docstrings, and comments.
* bpo-32433: Optimized HMAC digest (#5023)Christian Heimes2018-01-271-2/+57
| | | | | | | The hmac module now has hmac.digest(), which provides an optimized HMAC digest for short messages. hmac.digest() is up to three times faster than hmac.HMAC().digest(). Signed-off-by: Christian Heimes <christian@python.org>
* bpo-32240: Add the const qualifier to declarations of PyObject* array ↵Serhiy Storchaka2017-12-151-1/+1
| | | | arguments. (#4746)
* Replace KB unit with KiB (#4293)Victor Stinner2017-11-081-1/+1
| | | | | | | | | | | kB (*kilo* byte) unit means 1000 bytes, whereas KiB ("kibibyte") means 1024 bytes. KB was misused: replace kB or KB with KiB when appropriate. Same change for MB and GB which become MiB and GiB. Change the output of Tools/iobench/iobench.py. Round also the size of the documentation from 5.5 MB to 5 MiB.
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-071-10/+0
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* bpo-30102: Call OPENSSL_add_all_algorithms_noconf (#3112)Christian Heimes2017-09-051-1/+4
| | | | | | | | The ssl and hashlib modules now call OPENSSL_add_all_algorithms_noconf() on OpenSSL < 1.1.0. The function detects CPU features and enables optimizations on some CPU architectures such as POWER8. Patch is based on research from Gustavo Serra Scalet. Signed-off-by: Christian Heimes <christian@python.org>
* Remove _PyArg_NoStackKeywords(). (#2641)Serhiy Storchaka2017-07-101-6/+2
|
* bpo-29464: Rename METH_FASTCALL to METH_FASTCALL|METH_KEYWORDS and make (#1955)Serhiy Storchaka2017-07-031-1/+1
| | | | | the bare METH_FASTCALL be used for functions with positional-only parameters.
* bpo-20627: Fix error message when keyword arguments are used (#2115)Sylvain2017-06-151-2/+2
|
* bpo-9146: Raise a ValueError if OpenSSL fails to init a hash func. (#1777)Gregory P. Smith2017-05-241-9/+36
| | | | This helps people in weird FIPS mode environments where common things like MD5 are not available in the binary as a matter of policy.
* _hashopenssl uses METH_FASTCALLVictor Stinner2017-01-171-3/+7
|
* Issue #27928: Add scrypt (password-based key derivation function) to hashlib ↵Christian Heimes2016-09-061-0/+129
| | | | module (requires OpenSSL 1.1.0).
* Issue #26470: Port ssl and hashlib module to OpenSSL 1.1.0.Christian Heimes2016-09-051-59/+106
|\
| * Issue #26470: Port ssl and hashlib module to OpenSSL 1.1.0.Christian Heimes2016-09-051-59/+106
| |
* | Issue #27895: Spelling fixes (Contributed by Ville Skyttä).Raymond Hettinger2016-08-301-1/+1
|/
* Issue #25523: Merge "a" to "an" fixes from 3.4 into 3.5Martin Panter2015-11-021-1/+1
|\
| * Issue #25523: Correct "a" article to "an" articleMartin Panter2015-11-021-1/+1
| | | | | | | | | | | | This changes the main documentation, doc strings, source code comments, and a couple error messages in the test suite. In some cases the word was removed or edited some other way to fix the grammar.
* | merge 3.4Benjamin Peterson2015-09-271-2/+2
|\ \ | |/
| * fix spacingBenjamin Peterson2015-09-271-2/+2
| |
* | Issue9951: update _hashopenssl and md5module to use _Py_strhex().Gregory P. Smith2015-04-251-19/+3
| | | | | | | | Also update _posixsubprocess to use Py_hexdigits instead of its own constant.
* | Issue #23143: Remove compatibility with OpenSSLs older than 0.9.8.Antoine Pitrou2015-01-031-12/+0
|/ | | | (now the hashlib module)
* exclude _hashopenssl.c:_setException() from LCOV coverageChristian Heimes2013-12-051-0/+2
|
* Remove unused code path from PBKDF2 that is causing a warning on Win64Christian Heimes2013-11-181-5/+1
|
* Fix compiler warnings on Windows 64 bit: add an explicit cast from Py_ssize_tVictor Stinner2013-11-151-1/+1
| | | | to int, password.len was checked for being smaller than INT_MAX.
* Issue #18582: fix memory leak in pbkdf2 codeChristian Heimes2013-11-061-0/+1
|
* Silence a compiler warning about an unused functionBrett Cannon2013-11-011-28/+28
|
* Issue #19420: Fix reference leak in module initalization code of _hashopenssl.cChristian Heimes2013-10-291-1/+1
|
* Issue #18742: Expose the internal hash type object for ABCs.Christian Heimes2013-10-221-3/+1
|
* Load SSL's error strings in hashlib.Christian Heimes2013-10-211-0/+1
| | | | Without ERR_load_crypto_strings() functions like ERR_lib_error_string() return NULL.