Skip to content

Commit 4f8d6f1

Browse files
committed
no need to actually change Py_ht_evp_md
1 parent d409a2c commit 4f8d6f1

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Modules/_hashopenssl.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@
8282
*/
8383

8484
typedef enum Py_hash_type {
85-
Py_ht_evp_md, // usedforsecurity=True / default
86-
Py_ht_evp_md_nosecurity, // usedforsecurity=False
87-
Py_ht_mac, // HMAC
88-
Py_ht_pbkdf2, // PKBDF2
85+
Py_ht_evp, // usedforsecurity=True / default
86+
Py_ht_evp_nosecurity, // usedforsecurity=False
87+
Py_ht_mac, // HMAC
88+
Py_ht_pbkdf2, // PKBDF2
8989
} Py_hash_type;
9090

9191
typedef struct {
@@ -416,7 +416,7 @@ get_openssl_evp_md_by_utf8name(PyObject *module, const char *name,
416416

417417
if (entry != NULL) {
418418
switch (py_ht) {
419-
case Py_ht_evp_md:
419+
case Py_ht_evp:
420420
case Py_ht_mac:
421421
case Py_ht_pbkdf2:
422422
digest = FT_ATOMIC_LOAD_PTR_RELAXED(entry->evp_md);
@@ -430,7 +430,7 @@ get_openssl_evp_md_by_utf8name(PyObject *module, const char *name,
430430
#endif
431431
}
432432
break;
433-
case Py_ht_evp_md_nosecurity:
433+
case Py_ht_evp_nosecurity:
434434
digest = FT_ATOMIC_LOAD_PTR_RELAXED(entry->evp_md_nosecurity);
435435
if (digest == NULL) {
436436
digest = PY_EVP_MD_fetch(entry->ossl_name, "-fips");
@@ -453,12 +453,12 @@ get_openssl_evp_md_by_utf8name(PyObject *module, const char *name,
453453
} else {
454454
// Fall back for looking up an unindexed OpenSSL specific name.
455455
switch (py_ht) {
456-
case Py_ht_evp_md:
456+
case Py_ht_evp:
457457
case Py_ht_mac:
458458
case Py_ht_pbkdf2:
459459
digest = PY_EVP_MD_fetch(name, NULL);
460460
break;
461-
case Py_ht_evp_md_nosecurity:
461+
case Py_ht_evp_nosecurity:
462462
digest = PY_EVP_MD_fetch(name, "-fips");
463463
break;
464464
}
@@ -979,7 +979,7 @@ _hashlib_HASH(PyObject *module, const char *digestname, PyObject *data_obj,
979979
}
980980

981981
digest = get_openssl_evp_md_by_utf8name(
982-
module, digestname, usedforsecurity ? Py_ht_evp_md : Py_ht_evp_md_nosecurity
982+
module, digestname, usedforsecurity ? Py_ht_evp : Py_ht_evp_nosecurity
983983
);
984984
if (digest == NULL) {
985985
goto exit;

0 commit comments

Comments
 (0)