cpython/Modules
Will Childs-Klein b8eaad3009
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

## 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`.

## 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.

Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
2024-04-11 16:49:41 +02:00
..
_blake2 gh-116116: Backport blake2 change to fix building with clang-cl on windows-i686 (GH-116117) 2024-03-04 16:59:57 +00:00
_ctypes gh-117142: Port _ctypes to multi-phase init (GH-117181) 2024-04-10 11:00:01 +00:00
_decimal gh-113024: C API: Add PyObject_GenericHash() function (GH-113025) 2024-03-22 20:19:10 +02:00
_hacl gh-99108: Refresh HACL*; update modules accordingly; fix namespacing (GH-117237) 2024-03-26 00:35:26 +00:00
_io gh-117068: Remove useless code in bytesio.c:resize_buffer() (GH-117069) 2024-03-22 11:25:38 +00:00
_multiprocessing gh-117435: Make SemLock thread-safe in free-threaded build (#117436) 2024-04-04 14:09:38 -04:00
_sqlite gh-111926: Make weakrefs thread-safe in free-threaded builds (#117168) 2024-04-08 10:58:38 -04:00
_sre gh-112075: Add critical sections for most dict APIs (#114508) 2024-02-06 14:03:43 -08:00
_ssl gh-111926: Make weakrefs thread-safe in free-threaded builds (#117168) 2024-04-08 10:58:38 -04:00
_testcapi gh-111140: PyLong_From/AsNativeBytes: Take *flags* rather than just *endianness* (GH-116053) 2024-04-05 16:21:16 +02:00
_testinternalcapi gh-110850: Cleanup PyTime API: PyTime_t are nanoseconds (#115753) 2024-02-21 11:46:00 +01:00
_testlimitedcapi gh-114329: Fix PyList_GetItemRef() limited C API definition (#117520) 2024-04-03 21:02:42 +00:00
_xxtestfuzz When the Py_CompileStringExFlags fuzzer encounters a SystemError, abort (#115147) 2024-02-07 17:21:33 -05:00
cjkcodecs gh-85287: Change codecs to raise precise UnicodeEncodeError and UnicodeDecodeError (#113674) 2024-03-17 04:58:42 +00:00
clinic gh-111926: Make weakrefs thread-safe in free-threaded builds (#117168) 2024-04-08 10:58:38 -04:00
expat gh-115398: Expose Expat >=2.6.0 reparse deferral API (CVE-2023-52425) (GH-115623) 2024-02-29 14:52:50 -08:00
_abc.c gh-113743: Make the MRO cache thread-safe in free-threaded builds (#113930) 2024-02-15 10:54:57 -08:00
_asynciomodule.c gh-116720: Fix corner cases of taskgroups (#117407) 2024-04-09 08:17:28 -07:00
_bisectmodule.c
_bz2module.c
_codecsmodule.c
_collectionsmodule.c gh-112050: Make collections.deque thread-safe in free-threaded builds (#113830) 2024-02-15 09:22:47 +01:00
_contextvarsmodule.c
_csv.c gh-116437: Use new C API PyDict_Pop() to simplify the code (GH-116438) 2024-03-07 11:21:08 +02:00
_curses_panel.c gh-110964: Remove private _PyArg functions (#110966) 2023-10-17 14:30:31 +02:00
_cursesmodule.c gh-110093: Replace trivial Py_BuildValue() with direct C API call (GH-110094) 2023-10-20 18:08:41 +03:00
_datetimemodule.c gh-117534: Add checking for input parameter in iso_to_ymd (#117543) 2024-04-09 13:53:00 -04:00
_dbmmodule.c Remove redundant check in dbm.open() (GH-111844) 2023-11-08 19:42:41 +02:00
_elementtree.c gh-116437: Use new C API PyDict_Pop() to simplify the code (GH-116438) 2024-03-07 11:21:08 +02:00
_functoolsmodule.c gh-111696, PEP 737: Add PyType_GetModuleName() function (#116824) 2024-03-14 18:17:43 +00:00
_gdbmmodule.c gh-110964: Remove private _PyArg functions (#110966) 2023-10-17 14:30:31 +02:00
_hashopenssl.c gh-117233: Detect support for several hashes at hashlib build time (GH-117234) 2024-04-11 16:49:41 +02:00
_heapqmodule.c
_interpreters_common.h gh-76785: Add More Tests to test_interpreters.test_api (gh-117662) 2024-04-10 18:37:01 -06:00
_json.c gh-112066: Use PyDict_SetDefaultRef in place of PyDict_SetDefault. (#112211) 2024-02-07 13:43:18 -05:00
_localemodule.c gh-108765: Python.h no longer includes <ctype.h> (#108831) 2023-09-03 18:54:27 +02:00
_lsprof.c gh-103092: Add a mutex to make the PRNG state of rotatingtree concurrent-safe (#115301) 2024-03-01 00:04:16 +01:00
_lzmamodule.c gh-104282: Fix null pointer dereference in lzma._decode_filter_properties (GH-104283) 2024-01-17 13:15:44 +00:00
_math.h
_opcode.c gh-112383: teach dis how to interpret ENTER_EXECUTOR (#117171) 2024-03-23 22:32:33 +00:00
_operator.c
_pickle.c gh-111140: Adds PyLong_AsNativeBytes and PyLong_FromNative[Unsigned]Bytes functions (GH-114886) 2024-02-12 20:13:13 +00:00
_posixsubprocess.c gh-113964: Don't prevent new threads until all non-daemon threads exit (#116677) 2024-03-19 14:40:20 -04:00
_queuemodule.c gh-110850: Use public PyTime functions (#115746) 2024-02-20 23:31:30 +00:00
_randommodule.c gh-110850: Use public PyTime functions (#115746) 2024-02-20 23:31:30 +00:00
_scproxy.c gh-108494: Fix Argument Clinic LIMITED_CAPI_REGEX (#116610) 2024-03-11 22:42:18 +00:00
_ssl.c gh-111926: Make weakrefs thread-safe in free-threaded builds (#117168) 2024-04-08 10:58:38 -04:00
_ssl.h
_ssl_data_31.h
_ssl_data_111.h
_ssl_data_300.h
_stat.c gh-108494: Fix Argument Clinic LIMITED_CAPI_REGEX (#116610) 2024-03-11 22:42:18 +00:00
_statisticsmodule.c gh-85283: Build _statistics extension with the limited C API (#116927) 2024-03-17 18:59:02 +01:00
_struct.c gh-111140: Adds PyLong_AsNativeBytes and PyLong_FromNative[Unsigned]Bytes functions (GH-114886) 2024-02-12 20:13:13 +00:00
_suggestions.c gh-110721: Remove unused code from suggestions.c after moving PyErr_Display to use the traceback module (#113712) 2024-01-08 15:10:45 +00:00
_sysconfig.c gh-111863: Rename term Py_NOGIL to Py_GIL_DISABLED in sysconfig (gh-112307) 2023-11-22 10:32:43 +09:00
_testbuffer.c GH-115776: Embed the values array into the object, for "normal" Python objects. (GH-116115) 2024-04-02 11:59:21 +01:00
_testcapi_feature_macros.inc gh-91325: Skip Stable ABI checks with Py_TRACE_REFS special build (GH-92046) 2024-01-29 16:45:31 +01:00
_testcapimodule.c GH-115776: Embed the values array into the object, for "normal" Python objects. (GH-116115) 2024-04-02 11:59:21 +01:00
_testclinic.c gh-115015: Argument Clinic: fix generated code for METH_METHOD methods without params (#115016) 2024-02-05 21:49:17 +01:00
_testclinic_limited.c gh-116646: Add limited C API support to AC fildes converter (#116769) 2024-03-14 10:28:58 +01:00
_testexternalinspection.c gh-114099 - Add iOS testbed, plus Makefile target to invoke it. (gh-115930) 2024-03-06 23:24:52 -05:00
_testimportmultiple.c gh-108494: Fix Argument Clinic LIMITED_CAPI_REGEX (#116610) 2024-03-11 22:42:18 +00:00
_testinternalcapi.c gh-76785: Add More Tests to test_interpreters.test_api (gh-117662) 2024-04-10 18:37:01 -06:00
_testlimitedcapi.c gh-115754: Add Py_GetConstant() function (#116883) 2024-03-21 16:07:00 +00:00
_testmultiphase.c gh-110964: Remove private _PyArg functions (#110966) 2023-10-17 14:30:31 +02:00
_testsinglephase.c gh-110850: Use public PyTime functions (#115746) 2024-02-20 23:31:30 +00:00
_threadmodule.c gh-113964: Don't prevent new threads until all non-daemon threads exit (#116677) 2024-03-19 14:40:20 -04:00
_tkinter.c gh-111140: Adds PyLong_AsNativeBytes and PyLong_FromNative[Unsigned]Bytes functions (GH-114886) 2024-02-12 20:13:13 +00:00
_tracemalloc.c
_typingmodule.c
_uuidmodule.c gh-108494: Fix Argument Clinic LIMITED_CAPI_REGEX (#116610) 2024-03-11 22:42:18 +00:00
_weakref.c gh-111926: Make weakrefs thread-safe in free-threaded builds (#117168) 2024-04-08 10:58:38 -04:00
_winapi.c gh-114570: Add PythonFinalizationError exception (#115352) 2024-02-14 23:35:06 +01:00
_xxinterpchannelsmodule.c gh-76785: Add More Tests to test_interpreters.test_api (gh-117662) 2024-04-10 18:37:01 -06:00
_xxinterpqueuesmodule.c gh-116386: Fix format string "%ld" warning in _xxinterpqueuesmodule (#116387) 2024-03-07 09:44:26 +03:00
_xxsubinterpretersmodule.c gh-76785: Add More Tests to test_interpreters.test_api (gh-117662) 2024-04-10 18:37:01 -06:00
_zoneinfo.c gh-111789: Use PyDict_GetItemRef() in Modules/_zoneinfo.c (GH-112078) 2024-01-10 15:35:10 +02:00
addrinfo.h
arraymodule.c gh-116447: Fix possible UB in arraymodule and getargs (#116459) 2024-03-08 13:49:52 +03:00
atexitmodule.c gh-108082: Remove _PyErr_WriteUnraisableMsg() (GH-111643) 2023-11-03 09:45:53 +02:00
binascii.c gh-105967: Work around a macOS bug, limit zlib C library crc32 API calls to 1gig (#112615) 2023-12-04 12:04:05 -08:00
cmathmodule.c
config.c.in gh-104169: Fix test_peg_generator after tokenizer refactoring (#110727) 2023-10-12 09:34:35 +02:00
errnomodule.c gh-108494: Fix Argument Clinic LIMITED_CAPI_REGEX (#116610) 2024-03-11 22:42:18 +00:00
faulthandler.c gh-110850: Cleanup pycore_time.h includes (#115724) 2024-02-20 16:50:43 +00:00
fcntlmodule.c gh-85283: Build fcntl extension with the limited C API (#116791) 2024-03-14 12:01:13 +00:00
gc_weakref.txt
gcmodule.c GH-117108: Change the size of the GC increment to about 1% of the total heap size. (GH-117120) 2024-03-22 18:43:25 +00:00
getaddrinfo.c
getbuildinfo.c
getnameinfo.c
getpath.c gh-115136: Fix possible NULL deref in getpath_joinpath() (GH-115137) 2024-02-08 08:40:38 +00:00
getpath.py gh-106718: Treat PyConfig.stdlib_dir as highest-priority setting for stdlib_dir when calculating paths (GH-108730) 2023-11-01 21:11:18 +00:00
getpath_noop.c
grpmodule.c gh-85283: Convert grp extension to the limited C API (#116611) 2024-03-12 00:46:53 +00:00
hashlib.h gh-111863: Rename Py_NOGIL to Py_GIL_DISABLED (#111864) 2023-11-20 15:52:00 +02:00
itertoolsmodule.c gh-115874: Don't use module state in teedataobject tp_dealloc (#116204) 2024-03-18 13:24:24 +01:00
ld_so_aix.in
main.c gh-67224: Show source lines in tracebacks when using the -c option when running Python (#111200) 2023-10-26 15:17:28 +09:00
makesetup gh-111225: Link extension modules against libpython on Android (#115780) 2024-02-21 23:18:57 +00:00
makexp_aix
mathmodule.c gh-73468: Add math.fma() function (#116667) 2024-03-17 13:58:26 +00:00
md5module.c gh-99108: Refresh HACL*; update modules accordingly; fix namespacing (GH-117237) 2024-03-26 00:35:26 +00:00
mmapmodule.c gh-78502: Add a trackfd parameter to mmap.mmap() (GH-25425) 2024-01-16 08:51:46 +01:00
overlapped.c gh-91227: Ignore ERROR_PORT_UNREACHABLE in proactor recvfrom() (#32011) 2024-03-23 08:39:35 -07:00
posixmodule.c gh-117267: Ensure DirEntry.stat().st_ctime still contains creation time during deprecation period (GH-117354) 2024-04-03 23:14:55 +01:00
posixmodule.h gh-85283: Convert grp extension to the limited C API (#116611) 2024-03-12 00:46:53 +00:00
pwdmodule.c gh-85283: Build pwd extension with the limited C API (#116841) 2024-03-15 08:49:58 +01:00
pyexpat.c gh-115398: Expose Expat >=2.6.0 reparse deferral API (CVE-2023-52425) (GH-115623) 2024-02-29 14:52:50 -08:00
readline.c gh-105323: Remove WITH_APPLE_EDITLINE to use the same declaration for all editline (gh-112513) 2023-12-05 23:52:28 +09:00
README
resource.c gh-108494: Fix Argument Clinic LIMITED_CAPI_REGEX (#116610) 2024-03-11 22:42:18 +00:00
rotatingtree.c gh-103092: Add a mutex to make the PRNG state of rotatingtree concurrent-safe (#115301) 2024-03-01 00:04:16 +01:00
rotatingtree.h
selectmodule.c gh-91565: Update issue tracker URL in error message. (#117450) 2024-04-03 10:43:52 +02:00
Setup gh-115773: Add tests to exercise the _Py_DebugOffsets structure (#115774) 2024-02-28 10:17:34 +00:00
Setup.bootstrap.in gh-110721: Remove unused code from suggestions.c after moving PyErr_Display to use the traceback module (#113712) 2024-01-08 15:10:45 +00:00
Setup.stdlib.in gh-94808:Improve coverage of PyObject_Print (GH-98749) 2024-04-01 12:52:25 +00:00
sha1module.c gh-99108: Refresh HACL*; update modules accordingly; fix namespacing (GH-117237) 2024-03-26 00:35:26 +00:00
sha2module.c gh-99108: Refresh HACL*; update modules accordingly; fix namespacing (GH-117237) 2024-03-26 00:35:26 +00:00
sha3module.c gh-99108: Refresh HACL*; update modules accordingly; fix namespacing (GH-117237) 2024-03-26 00:35:26 +00:00
signalmodule.c gh-110850: Cleanup pycore_time.h includes (#115724) 2024-02-20 16:50:43 +00:00
socketmodule.c gh-116616: Use relaxed atomic ops to access socket module defaulttimeout (#116623) 2024-03-12 14:44:39 +01:00
socketmodule.h gh-110850: Cleanup pycore_time.h includes (#115724) 2024-02-20 16:50:43 +00:00
symtablemodule.c gh-110045: Update symtable module for PEP 695 (#110066) 2023-09-29 02:08:04 +00:00
syslogmodule.c gh-117440: Make syslog thread-safe in free-threaded builds (#117441) 2024-04-02 10:44:26 -04:00
termios.c gh-85283: Build termios extension with the limited C API (#116928) 2024-03-17 15:12:29 +00:00
timemodule.c gh-116437: Use new C API PyDict_Pop() to simplify the code (GH-116438) 2024-03-07 11:21:08 +02:00
tkappinit.c
tkinter.h
unicodedata.c gh-96954: use a directed acyclic word graph for storing the unicodedata codepoint names (#97906) 2023-11-04 15:56:58 +01:00
unicodedata_db.h gh-96954: Fix make regen-unicodedata in out-of-tree builds (#112118) 2023-11-15 16:42:17 +00:00
unicodename_db.h gh-96954: Fix make regen-unicodedata in out-of-tree builds (#112118) 2023-11-15 16:42:17 +00:00
winreparse.h
xxlimited.c gh-108494: Fix Argument Clinic LIMITED_CAPI_REGEX (#116610) 2024-03-11 22:42:18 +00:00
xxlimited_35.c gh-108494: Fix Argument Clinic LIMITED_CAPI_REGEX (#116610) 2024-03-11 22:42:18 +00:00
xxmodule.c
xxsubtype.c
zlibmodule.c gh-105967: Work around a macOS bug, limit zlib C library crc32 API calls to 1gig (#112615) 2023-12-04 12:04:05 -08:00

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