Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cc6cdce

Browse files
committed
Remove unused code path from PBKDF2 that is causing a warning on Win64
1 parent 7f4bf9f commit cc6cdce

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

Modules/_hashopenssl.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -504,10 +504,6 @@ PKCS5_PBKDF2_HMAC_fast(const char *pass, int passlen,
504504
HMAC_CTX_init(&hctx);
505505
p = out;
506506
tkeylen = keylen;
507-
if (!pass)
508-
passlen = 0;
509-
else if(passlen == -1)
510-
passlen = strlen(pass);
511507
if (!HMAC_Init_ex(&hctx_tpl, pass, passlen, digest, NULL)) {
512508
HMAC_CTX_cleanup(&hctx_tpl);
513509
return 0;
@@ -671,7 +667,7 @@ pbkdf2_hmac(PyObject *self, PyObject *args, PyObject *kwdict)
671667

672668
Py_BEGIN_ALLOW_THREADS
673669
retval = PKCS5_PBKDF2_HMAC_fast((char*)password.buf, (int)password.len,
674-
(unsigned char *)salt.buf, salt.len,
670+
(unsigned char *)salt.buf, (int)salt.len,
675671
iterations, digest, dklen,
676672
(unsigned char *)key);
677673
Py_END_ALLOW_THREADS

0 commit comments

Comments
 (0)