blob: 5c6c410e04c7f3146d13ff55def64b18c26f02c0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
--- a/Modules/_hashopenssl.c
+++ b/Modules/_hashopenssl.c
@@ -45,7 +45,9 @@
#define MUNCH_SIZE INT_MAX
+#ifdef NID_id_scrypt
#define PY_OPENSSL_HAS_SCRYPT 1
+#endif
#if defined(NID_sha3_224) && defined(NID_sha3_256) && defined(NID_sha3_384) && defined(NID_sha3_512)
#define PY_OPENSSL_HAS_SHA3 1
#endif
@@ -971,11 +973,15 @@ _hashlib_HASH(PyObject *module, const ch
goto exit;
}
+#ifndef EVP_MD_FLAG_XOF
+ type = get_hashlib_state(module)->EVPtype;
+#else
if ((EVP_MD_flags(digest) & EVP_MD_FLAG_XOF) == EVP_MD_FLAG_XOF) {
type = get_hashlib_state(module)->EVPXOFtype;
} else {
type = get_hashlib_state(module)->EVPtype;
}
+#endif
self = newEVPobject(type);
if (self == NULL) {
|