cpython/Modules
Miss Islington (bot) 9376a9f0d8
[3.12] gh-117233: Detect support for several hashes at hashlib build time (GH-117234) (#117767)
gh-117233: Detect support for several hashes at hashlib build time (GH-117234)

Detect libcrypto BLAKE2, Shake, SHA3, and Truncated-SHA512 support at hashlib build time

GH-GH- BLAKE2

While OpenSSL supports both "b" and "s" variants of the BLAKE2 hash
function, other cryptographic libraries may lack support for one or both
of the variants. This commit modifies `hashlib`'s C code to detect
whether or not the linked libcrypto supports each BLAKE2 variant, and
elides references to each variant's NID accordingly. In cases where the
underlying libcrypto doesn't fully support BLAKE2, CPython's
`./configure` script can be given the following flag to use CPython's
interned BLAKE2 implementation: `--with-builtin-hashlib-hashes=blake2`.

GH-GH- SHA3, Shake, & truncated SHA512.

Detect BLAKE2, SHA3, Shake, & truncated SHA512 support in the
OpenSSL-ish libcrypto library at build time.  This helps allow hashlib's
`_hashopenssl` to be used with libraries that do not to support every
algorithm that upstream OpenSSL does.  Such as AWS-LC & BoringSSL.

(cherry picked from commit b8eaad3009)

Co-authored-by: Will Childs-Klein <willck93@gmail.com>
Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
2024-04-11 18:36:31 +00:00
..
_blake2 gh-116116: Backport blake2 change to fix building with clang-cl on windows-i686 (GH-116117) 2024-03-04 17:22:46 +00:00
_ctypes gh-110190: Fix ctypes structs with array on Windows ARM64 (GH-114753) 2024-01-31 00:15:16 +00:00
_decimal [3.12] gh-114563: C decimal falls back to pydecimal for unsupported format strings (GH-114879) (GH-115353) 2024-02-12 23:31:12 +02:00
_hacl [3.12] gh-99108: Refresh HACL*; update modules accordingly; fix namespacing (GH-117237) (GH-117243) 2024-03-26 01:43:24 +00:00
_io [3.12] gh-95782: Fix io.BufferedReader.tell() etc. being able to return offsets < 0 (GH-99709) (GH-115599) 2024-02-17 14:56:00 +02:00
_multiprocessing [3.12] gh-115886: Handle embedded null characters in shared memory name (GH-115887) (GH-115906) 2024-02-25 11:09:28 +00:00
_sqlite [3.12] gh-108083: Don't ignore exceptions in sqlite3.Connection.__init__() and .close() (#108084) (#108141) 2023-08-20 01:07:41 +02:00
_sre [3.12] gh-115015: Argument Clinic: fix generated code for METH_METHOD methods without params (#115016) (#115067) 2024-02-06 11:20:16 +01:00
_ssl GH-103092: isolate _ssl (#104725) 2023-05-22 06:14:48 +05:30
_testcapi [3.12] gh-117021: Fix integer overflow in PyLong_AsPid() on non-Windows 64-bit platforms (GH-117064) (GH-117070) 2024-03-20 16:44:05 +02:00
_xxtestfuzz [3.12] gh-109098: Fuzz re module instead of internal sre (GH-109911) (#109932) 2023-10-02 17:39:07 +02:00
cjkcodecs [3.12] gh-115015: Argument Clinic: fix generated code for METH_METHOD methods without params (#115016) (#115067) 2024-02-06 11:20:16 +01:00
clinic [3.12] gh-115398: Expose Expat >=2.6.0 reparse deferral API (CVE-2023-52425) (GH-115623) (GH-116248) 2024-03-06 22:01:45 +00:00
expat [3.12] gh-115398: Expose Expat >=2.6.0 reparse deferral API (CVE-2023-52425) (GH-115623) (GH-116248) 2024-03-06 22:01:45 +00:00
_abc.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_asynciomodule.c [3.12] gh-105987: Fix reference counting issue in `_asyncio._swap_cur… (#106099) 2023-06-26 08:51:28 +00:00
_bisectmodule.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_bz2module.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_codecsmodule.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_collectionsmodule.c [3.12] gh-115243: Fix crash in deque.index() when the deque is concurrently modified (GH-115247) (GH-115465) 2024-02-14 17:17:58 +00:00
_contextvarsmodule.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_cryptmodule.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_csv.c [3.12] gh-67044: Always quote or escape \r and \n in csv.writer() (GH-115741) (GH-115866) 2024-02-23 20:45:04 +00:00
_curses_panel.c [3.12] gh-86493: Fix possible leaks in modules initialization: _curses_panel, _decimal, posix, xxsubtype (GH-106767) (#106849) 2023-07-18 10:03:59 +03:00
_cursesmodule.c [3.12] gh-107913: Fix possible losses of OSError error codes (GH-107930) (#108523) 2023-08-27 01:24:40 +02:00
_datetimemodule.c [3.12] gh-117534: Add checking for input parameter in iso_to_ymd (GH-117543) (#117689) 2024-04-09 18:17:21 +00:00
_dbmmodule.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_elementtree.c [3.12] gh-115398: Expose Expat >=2.6.0 reparse deferral API (CVE-2023-52425) (GH-115623) (GH-116248) 2024-03-06 22:01:45 +00:00
_functoolsmodule.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_gdbmmodule.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_hashopenssl.c [3.12] gh-117233: Detect support for several hashes at hashlib build time (GH-117234) (#117767) 2024-04-11 18:36:31 +00:00
_heapqmodule.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_json.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_localemodule.c [3.12] gh-107913: Fix possible losses of OSError error codes (GH-107930) (#108523) 2023-08-27 01:24:40 +02:00
_lsprof.c [3.12] GH-106152: Add PY_THROW event to cProfile (GH-106256) 2023-06-29 23:39:18 +00:00
_lzmamodule.c [3.12] gh-104282: Fix null pointer dereference in lzma._decode_filter_properties (GH-104283) (GH-114181) 2024-01-17 13:31:33 +00:00
_math.h gh-101678: refactor the math module to use special functions from c11 (GH-101679) 2023-02-09 00:40:52 -08:00
_opcode.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_operator.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_pickle.c [3.12] bpo-41422: Visit the Pickler's and Unpickler's memo in tp_traverse (GH-21664) (GH-112464) 2023-11-27 18:42:48 +00:00
_posixsubprocess.c [3.12] gh-113964: Don't prevent new threads until all non-daemon threads exit (GH-116677) (#117029) 2024-03-19 15:22:42 -04:00
_queuemodule.c [3.12] gh-104812: Run Pending Calls in any Thread (gh-104813) (gh-105752) 2023-06-14 00:50:08 +00:00
_randommodule.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_scproxy.c gh-104180: Read SOCKS proxies from macOS System Configuration (#104181) 2023-05-09 10:24:29 +02:00
_ssl.c [3.12] gh-117310: Remove extra DECREF on "no ciphers" error path in _ssl._SSLContext constructor (GH-117309) (GH-117317) 2024-03-28 10:04:57 -07:00
_ssl.h GH-103092: isolate _ssl (#104725) 2023-05-22 06:14:48 +05:30
_ssl_data.h closes bpo-40266, closes bpo-39953: Use numeric lib code if compiling against old OpenSSL. (GH-19506) 2020-04-13 22:11:40 -05:00
_ssl_data_31.h [3.12] gh-103142: Upgrade binary builds and CI to OpenSSL 1.1.1u (GH-105174) (#105199) 2023-06-01 17:13:35 +00:00
_ssl_data_111.h [3.12] gh-103142: Upgrade binary builds and CI to OpenSSL 1.1.1u (GH-105174) (#105199) 2023-06-01 17:13:35 +00:00
_ssl_data_300.h [3.12] gh-103142: Upgrade binary builds and CI to OpenSSL 1.1.1u (GH-105174) (#105199) 2023-06-01 17:13:35 +00:00
_stat.c [3.12] gh-86493: Fix possible leaks in some modules initialization (GH-106768) (GH-106855) 2023-07-18 15:14:10 +03:00
_statisticsmodule.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_struct.c [3.12] gh-112358: Fix Python 3.12 regression with subclassing struct.Struct (GH-112424) (#112426) 2023-11-27 08:25:06 +00:00
_testbuffer.c [3.12] gh-114670: Fix _testbuffer module initialization (GH-114672) (#115272) 2024-02-11 10:53:00 +03:00
_testcapi_feature_macros.inc [3.12] gh-102304: doc: Add links to Stable ABI and Limited C API (#105345) (#105371) 2023-06-06 13:11:28 +00:00
_testcapimodule.c [3.12] gh-117021: Fix integer overflow in PyLong_AsPid() on non-Windows 64-bit platforms (GH-117064) (GH-117070) 2024-03-20 16:44:05 +02:00
_testclinic.c [3.12] gh-115015: Argument Clinic: fix generated code for METH_METHOD methods without params (#115016) (#115067) 2024-02-06 11:20:16 +01:00
_testimportmultiple.c
_testinternalcapi.c [3.12] gh-110241: Add missing error check to record_eval in _testinternalcapi (GH-110242) (#110244) 2023-10-02 21:38:25 +00:00
_testmultiphase.c gh-99113: Add a check for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104206) 2023-05-06 21:57:35 +00:00
_testsinglephase.c [3.12] gh-102251: Explicitly free state for test modules with state in test_import (GH-105085) (#105170) 2023-05-31 21:34:21 +00:00
_threadmodule.c [3.12] gh-113964: Don't prevent new threads until all non-daemon threads exit (GH-116677) (#117029) 2024-03-19 15:22:42 -04:00
_tkinter.c [3.12] gh-112678: Declare Tkapp_CallDeallocArgs() as static (GH-112679) (GH-112690) 2023-12-04 08:21:28 +00:00
_tracemalloc.c GH-101520: Move tracemalloc functionality into core, leaving interface in Modules. (#104508) 2023-05-17 14:17:16 +01:00
_typingmodule.c gh-104549: Set __module__ on TypeAliasType (#104550) 2023-05-18 15:56:15 -07:00
_uuidmodule.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_weakref.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
_winapi.c Use Unicode unconditionally for _winapi.CreateFile (GH-114611) 2024-01-26 17:53:46 +00:00
_xxinterpchannelsmodule.c [3.12] gh-76785: Use Pending Calls When Releasing Cross-Interpreter Data (gh-109556) (gh-112288) 2023-11-27 14:49:48 -07:00
_xxsubinterpretersmodule.c [3.12] gh-105716: Support Background Threads in Subinterpreters Consistently (gh-109921) (gh-110707) 2023-11-27 19:01:05 -07:00
_zoneinfo.c [3.12] bpo-42663: Fix parsing TZ strings in zoneinfo module (GH-23825) (GH-110882) 2023-10-15 10:59:19 +03:00
addrinfo.h gh-95174: WASI: skip missing sockets functions (GH-95179) 2022-07-27 08:19:23 +02:00
arraymodule.c [3.12] gh-116447: Fix possible UB in arraymodule and getargs (GH-116459) (#116496) 2024-03-08 11:22:07 +00:00
atexitmodule.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
audioop.c [3.12] gh-46968: Fix invalid reference to Sound eXchange (SoX) 12.17.7 license (#115094) 2024-02-06 18:59:23 +01:00
binascii.c [3.12] gh-105967: Work around a macOS bug, limit zlib C library crc32 API calls to 1gig (GH-112615) (#112724) 2023-12-04 20:29:23 +00:00
cmathmodule.c [3.12] gh-86493: Fix possible leaks in some modules initialization (GH-106768) (GH-106855) 2023-07-18 15:14:10 +03:00
config.c.in Add tests for the C tokenizer and expose it as a private module (GH-27924) 2021-08-24 17:50:05 +01:00
errnomodule.c [3.12] gh-105375: Improve errnomodule error handling (#105590) (#105596) 2023-06-09 20:36:53 +00:00
faulthandler.c [3.12] gh-110052: Fix faulthandler for freed tstate (#110069) (#110071) 2023-10-02 17:44:51 +02:00
fcntlmodule.c [3.12] gh-107913: Fix possible losses of OSError error codes (GH-107930) (#108523) 2023-08-27 01:24:40 +02:00
gc_weakref.txt Fix links to old SF bugs (#95648) 2022-08-04 18:12:35 +02:00
gcmodule.c Fix linting for Modules/gcmodule.c (#116691) 2024-03-13 00:00:14 +00:00
getaddrinfo.c gh-74895: getaddrinfo no longer raises OverflowError (#2435) 2023-02-13 17:37:34 -08:00
getbuildinfo.c gh-81057: Move Globals in Core Code to _PyRuntimeState (gh-99496) 2022-11-15 09:45:11 -07:00
getnameinfo.c gh-95174: WASI: skip missing sockets functions (GH-95179) 2022-07-27 08:19:23 +02:00
getpath.c [3.12] gh-115136: Fix possible NULL deref in getpath_joinpath() (GH-115137) (GH-115157) 2024-02-08 11:18:38 +02:00
getpath.py gh-101543: Ensure Windows registry path is only used when stdlib can't be found (GH-101544) 2023-02-06 15:55:32 +00:00
getpath_noop.c bpo-45582: Port getpath[p].c to Python (GH-29041) 2021-12-03 00:08:42 +00:00
grpmodule.c [3.12] gh-104432: Use memcpy() to avoid misaligned loads (GH-104433) (#107355) 2023-07-27 13:52:39 -07:00
hashlib.h [3.12] gh-99108: Release the GIL around hashlib built-in computation (GH-104675) (#104776) 2023-05-23 11:24:02 +00:00
itertoolsmodule.c [3.12] gh-115874: Don't use module state in teedataobject tp_dealloc (GH-116204) (#116955) 2024-03-18 12:40:34 +00:00
ld_so_aix.in Issue #10656: Fix out-of-tree building on AIX 2016-11-20 07:56:37 +00:00
main.c [3.12] gh-105716: Support Background Threads in Subinterpreters Consistently (gh-109921) (gh-110707) 2023-11-27 19:01:05 -07:00
makesetup gh-96269: static and shared ext need different deps (#96316) 2022-11-16 14:03:35 +01:00
makexp_aix bpo-42087: Remove support for AIX 5.3 and below (GH-22830) 2020-11-16 16:16:10 +01:00
mathmodule.c [3.12] gh-111342: fix typo in math.sumprod (GH-111416) (gh-111419) 2023-10-28 05:27:33 +00:00
md5module.c [3.12] gh-99108: Refresh HACL*; update modules accordingly; fix namespacing (GH-117237) (GH-117243) 2024-03-26 01:43:24 +00:00
mmapmodule.c gh-81489: Use Unicode APIs for mmap tagname on Windows (GH-14133) 2024-01-11 23:13:02 +00:00
nismodule.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
ossaudiodev.c bpo-15999: Accept arbitrary values for boolean parameters. (#15609) 2022-12-03 11:52:21 -08:00
overlapped.c [3.12] gh-91227: Ignore ERROR_PORT_UNREACHABLE in proactor recvfrom() (GH-32011) (GH-117209) 2024-03-25 12:21:31 +02:00
posixmodule.c gh-117267: Ensure DirEntry.stat().st_ctime still contains creation time during deprecation period (GH-117354) 2024-04-03 22:32:09 +00:00
posixmodule.h bpo-41498: Fix build on platforms without sigset_t (GH-29770) 2021-11-25 12:28:41 +01:00
pwdmodule.c [3.12] gh-116545: Fix error handling in mkpwent in pwdmodule (GH-116548) (#116593) 2024-03-11 11:55:09 +00:00
pyexpat.c [3.12] gh-115398: Expose Expat >=2.6.0 reparse deferral API (CVE-2023-52425) (GH-115623) (GH-116248) 2024-03-06 22:01:45 +00:00
readline.c [3.12] gh-112105: Make completer delims work on libedit (gh-112106) (gh-112487) 2023-11-28 06:42:54 +00:00
README
resource.c [3.12] gh-89886: Rely on HAVE_SYS_TIME_H (GH-105058) (#105192) 2023-06-01 12:08:37 +00:00
rotatingtree.c
rotatingtree.h bpo-32150: Expand tabs to spaces in C files. (#4583) 2017-11-28 17:56:10 +02:00
selectmodule.c [3.12] gh-91565: Update issue tracker URL in error message. (GH-117450) (#117497) 2024-04-03 11:10:12 +02:00
Setup [3.12] gh-99108: Refresh HACL* (GH-104808) (#104893) 2023-05-24 20:55:37 +00:00
Setup.bootstrap.in gh-103763: Implement PEP 695 (#103764) 2023-05-15 20:36:23 -07:00
Setup.stdlib.in [3.12] gh-111495: add stub files for C API test modules (GH-111586) (GH-111592) 2023-11-01 09:43:56 +02:00
sha1module.c [3.12] gh-99108: Refresh HACL*; update modules accordingly; fix namespacing (GH-117237) (GH-117243) 2024-03-26 01:43:24 +00:00
sha2module.c [3.12] gh-99108: Refresh HACL*; update modules accordingly; fix namespacing (GH-117237) (GH-117243) 2024-03-26 01:43:24 +00:00
sha3module.c [3.12] gh-99108: Refresh HACL*; update modules accordingly; fix namespacing (GH-117237) (GH-117243) 2024-03-26 01:43:24 +00:00
signalmodule.c [3.12] gh-104812: Run Pending Calls in any Thread (gh-104813) (gh-105752) 2023-06-14 00:50:08 +00:00
socketmodule.c [3.12] bpo-37013: Fix the error handling in socket.if_indextoname() (GH-13503) (GH-112597) 2023-12-25 20:55:08 +02:00
socketmodule.h gh-103092: Isolate socket module (#103094) 2023-04-09 06:33:52 +05:30
spwdmodule.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
symtablemodule.c [3.12] gh-110045: Update symtable module for PEP 695 (GH-110066) (#110070) 2023-09-29 08:10:22 +02:00
syslogmodule.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
termios.c [3.12] gh-114492: Initialize struct termios before calling tcgetattr() (GH-114495) (GH-114502) 2024-01-23 22:02:02 +00:00
timemodule.c [3.12] gh-111295: Fix error checking in time extension module init (GH-111296) (#111300) 2023-11-01 20:58:02 +01:00
tkappinit.c gh-103538: Remove unused TK_AQUA code (GH-103539) 2023-05-10 18:53:13 +00:00
tkinter.h gh-103532: Remove TKINTER_PROTECT_LOADTK code (GH-103535) 2023-04-14 09:04:16 -05:00
unicodedata.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
unicodedata_db.h closes gh-96734: Update to Unicode 15.0.0. (GH-96809) 2022-09-13 15:45:12 -07:00
unicodename_db.h closes gh-96734: Update to Unicode 15.0.0. (GH-96809) 2022-09-13 15:45:12 -07:00
winreparse.h bpo-31512: Add non-elevated symlink support for Windows (GH-3652) 2019-04-09 11:19:46 -07:00
xxlimited.c [3.12] gh-110968: Py_MOD_PER_INTERPRETER_GIL_SUPPORTED was added to 3.12 (#111588) 2023-11-01 18:13:31 +01:00
xxlimited_35.c [3.12] gh-110968: Py_MOD_PER_INTERPRETER_GIL_SUPPORTED was added to 3.12 (#111588) 2023-11-01 18:13:31 +01:00
xxmodule.c gh-99113: Add Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104205) 2023-05-05 21:11:27 +00:00
xxsubtype.c [3.12] gh-86493: Fix possible leaks in modules initialization: _curses_panel, _decimal, posix, xxsubtype (GH-106767) (#106849) 2023-07-18 10:03:59 +03:00
zlibmodule.c [3.12] gh-105967: Work around a macOS bug, limit zlib C library crc32 API calls to 1gig (GH-112615) (#112724) 2023-12-04 20:29:23 +00:00

Source files for standard library extension modules,
and former extension modules that are now builtin modules.