Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fixed const and missing XOF issue
  • Loading branch information
tiran committed Jan 13, 2022
commit 90bf1617d6f98ca7829c6510a4cbe4626ac408b4
7 changes: 5 additions & 2 deletions Modules/_hashopenssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -886,9 +886,12 @@ py_evp_fromname(PyObject *module, const char *digestname, PyObject *data_obj,
goto exit;
}

#ifdef PY_OPENSSL_HAS_SHAKE
if ((EVP_MD_flags(digest) & EVP_MD_FLAG_XOF) == EVP_MD_FLAG_XOF) {
type = get_hashlib_state(module)->EVPXOFtype;
} else {
} else
#endif
{
type = get_hashlib_state(module)->EVPtype;
}

Expand Down Expand Up @@ -1452,7 +1455,7 @@ _hashlib_hmac_singleshot_impl(PyObject *module, Py_buffer *key,
unsigned char md[EVP_MAX_MD_SIZE] = {0};
unsigned int md_len = 0;
unsigned char *result;
const EVP_MD *evp;
PY_EVP_MD *evp;

evp = py_digest_by_name(module, digest, Py_ht_mac);
if (evp == NULL) {
Expand Down